diff --git a/dfp_api/COPYING b/dfp_api/COPYING old mode 100755 new mode 100644 diff --git a/dfp_api/ChangeLog b/dfp_api/ChangeLog old mode 100755 new mode 100644 index 668a429f1..d379f7c39 --- a/dfp_api/ChangeLog +++ b/dfp_api/ChangeLog @@ -1,7 +1,16 @@ +1.2.0: + - Added support for v201802. + - Removed support for v201702. + - Removed examples for v201705. + - Added StatementBuilder for easier PQL statement generation. + - Added DfpDate and DfpDateTime to make using Date and Time objects easier + in the DFP API. + - Deprecated FilterStatement. + 1.1.0: - - Added support for v201711 - - Removed support for v201611 - - Removed examples for v201702 + - Added support for v201711. + - Removed support for v201611. + - Removed examples for v201702. 1.0.0: - Major version bump. The library has been stable and feature complete for diff --git a/dfp_api/LICENSE b/dfp_api/LICENSE old mode 100755 new mode 100644 diff --git a/dfp_api/README.md b/dfp_api/README.md old mode 100755 new mode 100644 diff --git a/dfp_api/dfp_api.yml b/dfp_api/dfp_api.yml old mode 100755 new mode 100644 index 9260606cb..0482187b6 --- a/dfp_api/dfp_api.yml +++ b/dfp_api/dfp_api.yml @@ -47,3 +47,5 @@ #:proxy: INSERT_PROXY_HERE :library: :log_level: INFO + # Optional: uncomment to disable user agent showing used utilities. + #:include_utilities_in_user_agent: false diff --git a/dfp_api/examples/v201705/activity_group_service/get_active_activity_groups.rb b/dfp_api/examples/v201705/activity_group_service/get_active_activity_groups.rb deleted file mode 100755 index bdd3f0c2d..000000000 --- a/dfp_api/examples/v201705/activity_group_service/get_active_activity_groups.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active activity groups. -require 'dfp_api' - -class GetActiveActivityGroups - - def self.run_example(dfp) - activity_group_service = - dfp.service(:ActivityGroupService, :v201705) - - # Create a statement to select activity groups. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of activity groups at a time, paging - # through until all activity groups have been retrieved. - total_result_set_size = 0; - begin - page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) - - # Print out some information for each activity group. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity_group, index| - puts "%d) Activity group with ID %d and name '%s' was found." % [ - index + statement.offset, - activity_group[:id], - activity_group[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of activity groups: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActiveActivityGroups.main() -end diff --git a/dfp_api/examples/v201705/activity_group_service/get_all_activity_groups.rb b/dfp_api/examples/v201705/activity_group_service/get_all_activity_groups.rb deleted file mode 100755 index dcaf51959..000000000 --- a/dfp_api/examples/v201705/activity_group_service/get_all_activity_groups.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all activity groups. -require 'dfp_api' - -class GetAllActivityGroups - - def self.run_example(dfp) - activity_group_service = - dfp.service(:ActivityGroupService, :v201705) - - # Create a statement to select activity groups. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of activity groups at a time, paging - # through until all activity groups have been retrieved. - total_result_set_size = 0; - begin - page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) - - # Print out some information for each activity group. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity_group, index| - puts "%d) Activity group with ID %d and name '%s' was found." % [ - index + statement.offset, - activity_group[:id], - activity_group[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of activity groups: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllActivityGroups.main() -end diff --git a/dfp_api/examples/v201705/activity_service/get_active_activities.rb b/dfp_api/examples/v201705/activity_service/get_active_activities.rb deleted file mode 100755 index a36b0d2db..000000000 --- a/dfp_api/examples/v201705/activity_service/get_active_activities.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active activities. -require 'dfp_api' - -class GetActiveActivities - - def self.run_example(dfp) - activity_service = - dfp.service(:ActivityService, :v201705) - - # Create a statement to select activities. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of activities at a time, paging - # through until all activities have been retrieved. - total_result_set_size = 0; - begin - page = activity_service.get_activities_by_statement( - statement.toStatement()) - - # Print out some information for each activity. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity, index| - puts "%d) Activity with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - activity[:id], - activity[:name], - activity[:type] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of activities: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActiveActivities.main() -end diff --git a/dfp_api/examples/v201705/activity_service/get_all_activities.rb b/dfp_api/examples/v201705/activity_service/get_all_activities.rb deleted file mode 100755 index 2430b25c4..000000000 --- a/dfp_api/examples/v201705/activity_service/get_all_activities.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all activities. -require 'dfp_api' - -class GetAllActivities - - def self.run_example(dfp) - activity_service = - dfp.service(:ActivityService, :v201705) - - # Create a statement to select activities. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of activities at a time, paging - # through until all activities have been retrieved. - total_result_set_size = 0; - begin - page = activity_service.get_activities_by_statement( - statement.toStatement()) - - # Print out some information for each activity. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity, index| - puts "%d) Activity with ID %d and name '%s' was found." % [ - index + statement.offset, - activity[:id], - activity[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of activities: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllActivities.main() -end diff --git a/dfp_api/examples/v201705/audience_segment_service/get_all_audience_segments.rb b/dfp_api/examples/v201705/audience_segment_service/get_all_audience_segments.rb deleted file mode 100755 index b034adf93..000000000 --- a/dfp_api/examples/v201705/audience_segment_service/get_all_audience_segments.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all audience segments. -require 'dfp_api' - -class GetAllAudienceSegments - - def self.run_example(dfp) - audience_segment_service = - dfp.service(:AudienceSegmentService, :v201705) - - # Create a statement to select audience segments. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of audience segments at a time, paging - # through until all audience segments have been retrieved. - total_result_set_size = 0; - begin - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) - - # Print out some information for each audience segment. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |audience_segment, index| - puts "%d) Audience segment with ID %d, name '%s', and size %d was found." % [ - index + statement.offset, - audience_segment[:id], - audience_segment[:name], - audience_segment[:size] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of audience segments: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllAudienceSegments.main() -end diff --git a/dfp_api/examples/v201705/audience_segment_service/get_first_party_audience_segments.rb b/dfp_api/examples/v201705/audience_segment_service/get_first_party_audience_segments.rb deleted file mode 100755 index ae7073cc9..000000000 --- a/dfp_api/examples/v201705/audience_segment_service/get_first_party_audience_segments.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all first party audience segments. -require 'dfp_api' - -class GetFirstPartyAudienceSegments - - def self.run_example(dfp) - audience_segment_service = - dfp.service(:AudienceSegmentService, :v201705) - - # Create a statement to select audience segments. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'FIRST_PARTY' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of audience segments at a time, paging - # through until all audience segments have been retrieved. - total_result_set_size = 0; - begin - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) - - # Print out some information for each audience segment. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |audience_segment, index| - puts "%d) Audience segment with ID %d, name '%s', and size %d was found." % [ - index + statement.offset, - audience_segment[:id], - audience_segment[:name], - audience_segment[:size] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of audience segments: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetFirstPartyAudienceSegments.main() -end diff --git a/dfp_api/examples/v201705/base_rate_service/get_all_base_rates.rb b/dfp_api/examples/v201705/base_rate_service/get_all_base_rates.rb deleted file mode 100755 index ecfb0fd78..000000000 --- a/dfp_api/examples/v201705/base_rate_service/get_all_base_rates.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all base rates. -require 'dfp_api' - -class GetAllBaseRates - - def self.run_example(dfp) - base_rate_service = - dfp.service(:BaseRateService, :v201705) - - # Create a statement to select base rates. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of base rates at a time, paging - # through until all base rates have been retrieved. - total_result_set_size = 0; - begin - page = base_rate_service.get_base_rates_by_statement( - statement.toStatement()) - - # Print out some information for each base rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |base_rate, index| - puts "%d) Base rate with ID %d, type '%s', and rate card ID %d was found." % [ - index + statement.offset, - base_rate[:id], - base_rate[:xsi_type], - base_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of base rates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllBaseRates.main() -end diff --git a/dfp_api/examples/v201705/base_rate_service/get_base_rates_for_rate_card.rb b/dfp_api/examples/v201705/base_rate_service/get_base_rates_for_rate_card.rb deleted file mode 100755 index 84e6e72c0..000000000 --- a/dfp_api/examples/v201705/base_rate_service/get_base_rates_for_rate_card.rb +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all base rates belonging to a rate card. -require 'dfp_api' - -class GetBaseRatesForRateCard - - RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE'; - - def self.run_example(dfp, rate_card_id) - base_rate_service = - dfp.service(:BaseRateService, :v201705) - - # Create a statement to select base rates. - query = 'WHERE rateCardId = :rateCardId' - values = [ - { - :key => 'rateCardId', - :value => { - :xsi_type => 'NumberValue', - :value => rate_card_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of base rates at a time, paging - # through until all base rates have been retrieved. - total_result_set_size = 0; - begin - page = base_rate_service.get_base_rates_by_statement( - statement.toStatement()) - - # Print out some information for each base rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |base_rate, index| - puts "%d) Base rate with ID %d, type '%s', and rate card ID %d was found." % [ - index + statement.offset, - base_rate[:id], - base_rate[:xsi_type], - base_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of base rates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, RATE_CARD_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetBaseRatesForRateCard.main() -end diff --git a/dfp_api/examples/v201705/company_service/get_advertisers.rb b/dfp_api/examples/v201705/company_service/get_advertisers.rb deleted file mode 100755 index a0e506128..000000000 --- a/dfp_api/examples/v201705/company_service/get_advertisers.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all companies that are advertisers. -require 'dfp_api' - -class GetAdvertisers - - def self.run_example(dfp) - company_service = - dfp.service(:CompanyService, :v201705) - - # Create a statement to select companies. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'ADVERTISER' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of companies at a time, paging - # through until all companies have been retrieved. - total_result_set_size = 0; - begin - page = company_service.get_companies_by_statement( - statement.toStatement()) - - # Print out some information for each company. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |company, index| - puts "%d) Company with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - company[:id], - company[:name], - company[:type] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of companies: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAdvertisers.main() -end diff --git a/dfp_api/examples/v201705/company_service/get_all_companies.rb b/dfp_api/examples/v201705/company_service/get_all_companies.rb deleted file mode 100755 index ea99c6837..000000000 --- a/dfp_api/examples/v201705/company_service/get_all_companies.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all companies. -require 'dfp_api' - -class GetAllCompanies - - def self.run_example(dfp) - company_service = - dfp.service(:CompanyService, :v201705) - - # Create a statement to select companies. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of companies at a time, paging - # through until all companies have been retrieved. - total_result_set_size = 0; - begin - page = company_service.get_companies_by_statement( - statement.toStatement()) - - # Print out some information for each company. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |company, index| - puts "%d) Company with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - company[:id], - company[:name], - company[:type] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of companies: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCompanies.main() -end diff --git a/dfp_api/examples/v201705/contact_service/get_all_contacts.rb b/dfp_api/examples/v201705/contact_service/get_all_contacts.rb deleted file mode 100755 index fb7b79639..000000000 --- a/dfp_api/examples/v201705/contact_service/get_all_contacts.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all contacts. -require 'dfp_api' - -class GetAllContacts - - def self.run_example(dfp) - contact_service = - dfp.service(:ContactService, :v201705) - - # Create a statement to select contacts. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of contacts at a time, paging - # through until all contacts have been retrieved. - total_result_set_size = 0; - begin - page = contact_service.get_contacts_by_statement( - statement.toStatement()) - - # Print out some information for each contact. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |contact, index| - puts "%d) Contact with ID %d and name '%s' was found." % [ - index + statement.offset, - contact[:id], - contact[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of contacts: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllContacts.main() -end diff --git a/dfp_api/examples/v201705/contact_service/get_uninvited_contacts.rb b/dfp_api/examples/v201705/contact_service/get_uninvited_contacts.rb deleted file mode 100755 index 2f876d264..000000000 --- a/dfp_api/examples/v201705/contact_service/get_uninvited_contacts.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all contacts that aren't invited yet. -require 'dfp_api' - -class GetUninvitedContacts - - def self.run_example(dfp) - contact_service = - dfp.service(:ContactService, :v201705) - - # Create a statement to select contacts. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'UNINVITED' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of contacts at a time, paging - # through until all contacts have been retrieved. - total_result_set_size = 0; - begin - page = contact_service.get_contacts_by_statement( - statement.toStatement()) - - # Print out some information for each contact. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |contact, index| - puts "%d) Contact with ID %d and name '%s' was found." % [ - index + statement.offset, - contact[:id], - contact[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of contacts: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetUninvitedContacts.main() -end diff --git a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb deleted file mode 100755 index 785529a82..000000000 --- a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all content metadata key hierarchies. -require 'dfp_api' - -class GetAllContentMetadataKeyHierarchies - - def self.run_example(dfp) - content_metadata_key_hierarchy_service = - dfp.service(:ContentMetadataKeyHierarchyService, :v201705) - - # Create a statement to select content metadata key hierarchies. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of content metadata key hierarchies at a time, paging - # through until all content metadata key hierarchies have been retrieved. - total_result_set_size = 0; - begin - page = content_metadata_key_hierarchy_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) - - # Print out some information for each content metadata key hierarchy. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |content_metadata_key_hierarchy, index| - puts "%d) Content metadata key hierarchy with ID %d and name '%s' was found." % [ - index + statement.offset, - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of content metadata key hierarchies: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllContentMetadataKeyHierarchies.main() -end diff --git a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb deleted file mode 100755 index 5d5f9ef86..000000000 --- a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example updates a single content metadata key hierarchy. -# -# This feature is only available to DFP video publishers. - -require 'dfp_api' - - -API_VERSION = :v201705 - -def update_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the ContentMetadataKeyHierarchyService. - cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - - # Set the ID of the content metadata key hierarchy. - content_metadata_key_hierarchy_id = - 'INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE' - - # Set the ID of the custom targeting key to be added as a hierarchy level. - custom_targeting_key_id = "INSERT_CUSTOM_TARGETING_KEY_ID_HERE" - - # Create a statement to only select a single content metadata key hierarchy. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => content_metadata_key_hierarchy_id, - :xsi_type => 'NumberValue'}}, - ], - 1 - } - - # Get content metadata key hierarchies by statement. - page = cmkh_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) - - if page[:results] - content_metadata_key_hierarchy = page[:results].first - - # Update the content metadata key hierarchy by adding a hierarchy level. - hierarchy_levels = content_metadata_key_hierarchy[:hierarchy_levels] - - hierarchy_level = { - :custom_targeting_key_id => custom_targeting_key_id, - :hierarchy_level => hierarchy_levels.length + 1 - } - - content_metadata_key_hierarchy[:hierarchy_levels] = - hierarchy_levels.concat([hierarchy_level]) - - # Update content metadata key hierarchy. - content_metadata_key_hierarchies = - cmkh_service.update_content_metadata_key_hierarchies( - [content_metadata_key_hierarchy]) - - content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| - puts 'Content metadata key hierarchy with ID ' + - '%d, name "%s" was updated.' % [ - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name]] - end - else - puts 'No content metadata key hierarchy found to update.' - end -end - -if __FILE__ == $0 - begin - update_content_metadata_key_hierarchies() - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end -end diff --git a/dfp_api/examples/v201705/content_service/get_all_content.rb b/dfp_api/examples/v201705/content_service/get_all_content.rb deleted file mode 100755 index 9eaec283c..000000000 --- a/dfp_api/examples/v201705/content_service/get_all_content.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all content. -require 'dfp_api' - -class GetAllContent - - def self.run_example(dfp) - content_service = - dfp.service(:ContentService, :v201705) - - # Create a statement to select content. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of content at a time, paging - # through until all content have been retrieved. - total_result_set_size = 0; - begin - page = content_service.get_content_by_statement( - statement.toStatement()) - - # Print out some information for each content. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |content, index| - puts "%d) Content with ID %d and name '%s' was found." % [ - index + statement.offset, - content[:id], - content[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of content: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllContent.main() -end diff --git a/dfp_api/examples/v201705/creative_service/get_all_creatives.rb b/dfp_api/examples/v201705/creative_service/get_all_creatives.rb deleted file mode 100755 index e1203dc70..000000000 --- a/dfp_api/examples/v201705/creative_service/get_all_creatives.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all creatives. -require 'dfp_api' - -class GetAllCreatives - - def self.run_example(dfp) - creative_service = - dfp.service(:CreativeService, :v201705) - - # Create a statement to select creatives. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of creatives at a time, paging - # through until all creatives have been retrieved. - total_result_set_size = 0; - begin - page = creative_service.get_creatives_by_statement( - statement.toStatement()) - - # Print out some information for each creative. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative, index| - puts "%d) Creative with ID %d and name '%s' was found." % [ - index + statement.offset, - creative[:id], - creative[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creatives: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCreatives.main() -end diff --git a/dfp_api/examples/v201705/creative_service/get_image_creatives.rb b/dfp_api/examples/v201705/creative_service/get_image_creatives.rb deleted file mode 100755 index 6dc0d42ba..000000000 --- a/dfp_api/examples/v201705/creative_service/get_image_creatives.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all image creatives. -require 'dfp_api' - -class GetImageCreatives - - def self.run_example(dfp) - creative_service = - dfp.service(:CreativeService, :v201705) - - # Create a statement to select creatives. - query = 'WHERE creativeType = :creativeType' - values = [ - { - :key => 'creativeType', - :value => { - :xsi_type => 'TextValue', - :value => 'ImageCreative' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of creatives at a time, paging - # through until all creatives have been retrieved. - total_result_set_size = 0; - begin - page = creative_service.get_creatives_by_statement( - statement.toStatement()) - - # Print out some information for each creative. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative, index| - puts "%d) Creative with ID %d and name '%s' was found." % [ - index + statement.offset, - creative[:id], - creative[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creatives: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetImageCreatives.main() -end diff --git a/dfp_api/examples/v201705/creative_set_service/get_all_creative_sets.rb b/dfp_api/examples/v201705/creative_set_service/get_all_creative_sets.rb deleted file mode 100755 index 9e5748c6e..000000000 --- a/dfp_api/examples/v201705/creative_set_service/get_all_creative_sets.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all creative sets. -require 'dfp_api' - -class GetAllCreativeSets - - def self.run_example(dfp) - creative_set_service = - dfp.service(:CreativeSetService, :v201705) - - # Create a statement to select creative sets. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of creative sets at a time, paging - # through until all creative sets have been retrieved. - total_result_set_size = 0; - begin - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) - - # Print out some information for each creative set. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_set, index| - puts "%d) Creative set with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_set[:id], - creative_set[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative sets: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCreativeSets.main() -end diff --git a/dfp_api/examples/v201705/creative_set_service/get_creative_sets_for_master_creative.rb b/dfp_api/examples/v201705/creative_set_service/get_creative_sets_for_master_creative.rb deleted file mode 100755 index 1d05dae20..000000000 --- a/dfp_api/examples/v201705/creative_set_service/get_creative_sets_for_master_creative.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all creative sets for a master creative. -require 'dfp_api' - -class GetCreativeSetsForMasterCreative - - MASTER_CREATIVE_ID = 'INSERT_MASTER_CREATIVE_ID_HERE'; - - def self.run_example(dfp, master_creative_id) - creative_set_service = - dfp.service(:CreativeSetService, :v201705) - - # Create a statement to select creative sets. - query = 'WHERE masterCreativeId = :masterCreativeId' - values = [ - { - :key => 'masterCreativeId', - :value => { - :xsi_type => 'NumberValue', - :value => master_creative_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of creative sets at a time, paging - # through until all creative sets have been retrieved. - total_result_set_size = 0; - begin - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) - - # Print out some information for each creative set. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_set, index| - puts "%d) Creative set with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_set[:id], - creative_set[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative sets: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, MASTER_CREATIVE_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetCreativeSetsForMasterCreative.main() -end diff --git a/dfp_api/examples/v201705/creative_template_service/get_all_creative_templates.rb b/dfp_api/examples/v201705/creative_template_service/get_all_creative_templates.rb deleted file mode 100755 index a4360b07a..000000000 --- a/dfp_api/examples/v201705/creative_template_service/get_all_creative_templates.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all creative templates. -require 'dfp_api' - -class GetAllCreativeTemplates - - def self.run_example(dfp) - creative_template_service = - dfp.service(:CreativeTemplateService, :v201705) - - # Create a statement to select creative templates. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of creative templates at a time, paging - # through until all creative templates have been retrieved. - total_result_set_size = 0; - begin - page = creative_template_service.get_creative_templates_by_statement( - statement.toStatement()) - - # Print out some information for each creative template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_template, index| - puts "%d) Creative template with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_template[:id], - creative_template[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative templates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCreativeTemplates.main() -end diff --git a/dfp_api/examples/v201705/creative_template_service/get_system_defined_creative_templates.rb b/dfp_api/examples/v201705/creative_template_service/get_system_defined_creative_templates.rb deleted file mode 100755 index fd80ffaad..000000000 --- a/dfp_api/examples/v201705/creative_template_service/get_system_defined_creative_templates.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all system defined creative templates. -require 'dfp_api' - -class GetSystemDefinedCreativeTemplates - - def self.run_example(dfp) - creative_template_service = - dfp.service(:CreativeTemplateService, :v201705) - - # Create a statement to select creative templates. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'SYSTEM_DEFINED' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of creative templates at a time, paging - # through until all creative templates have been retrieved. - total_result_set_size = 0; - begin - page = creative_template_service.get_creative_templates_by_statement( - statement.toStatement()) - - # Print out some information for each creative template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_template, index| - puts "%d) Creative template with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_template[:id], - creative_template[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative templates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetSystemDefinedCreativeTemplates.main() -end diff --git a/dfp_api/examples/v201705/creative_wrapper_service/get_active_creative_wrappers.rb b/dfp_api/examples/v201705/creative_wrapper_service/get_active_creative_wrappers.rb deleted file mode 100755 index 4906aba83..000000000 --- a/dfp_api/examples/v201705/creative_wrapper_service/get_active_creative_wrappers.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active creative wrappers. -require 'dfp_api' - -class GetActiveCreativeWrappers - - def self.run_example(dfp) - creative_wrapper_service = - dfp.service(:CreativeWrapperService, :v201705) - - # Create a statement to select creative wrappers. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of creative wrappers at a time, paging - # through until all creative wrappers have been retrieved. - total_result_set_size = 0; - begin - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) - - # Print out some information for each creative wrapper. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_wrapper, index| - puts "%d) Creative wrapper with ID %d and label ID %d was found." % [ - index + statement.offset, - creative_wrapper[:id], - creative_wrapper[:label_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative wrappers: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActiveCreativeWrappers.main() -end diff --git a/dfp_api/examples/v201705/creative_wrapper_service/get_all_creative_wrappers.rb b/dfp_api/examples/v201705/creative_wrapper_service/get_all_creative_wrappers.rb deleted file mode 100755 index 6c62cdd87..000000000 --- a/dfp_api/examples/v201705/creative_wrapper_service/get_all_creative_wrappers.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all creative wrappers. -require 'dfp_api' - -class GetAllCreativeWrappers - - def self.run_example(dfp) - creative_wrapper_service = - dfp.service(:CreativeWrapperService, :v201705) - - # Create a statement to select creative wrappers. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of creative wrappers at a time, paging - # through until all creative wrappers have been retrieved. - total_result_set_size = 0; - begin - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) - - # Print out some information for each creative wrapper. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_wrapper, index| - puts "%d) Creative wrapper with ID %d and label ID %d was found." % [ - index + statement.offset, - creative_wrapper[:id], - creative_wrapper[:label_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of creative wrappers: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCreativeWrappers.main() -end diff --git a/dfp_api/examples/v201705/custom_field_service/get_all_custom_fields.rb b/dfp_api/examples/v201705/custom_field_service/get_all_custom_fields.rb deleted file mode 100755 index 11e6c876d..000000000 --- a/dfp_api/examples/v201705/custom_field_service/get_all_custom_fields.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all custom fields. -require 'dfp_api' - -class GetAllCustomFields - - def self.run_example(dfp) - custom_field_service = - dfp.service(:CustomFieldService, :v201705) - - # Create a statement to select custom fields. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of custom fields at a time, paging - # through until all custom fields have been retrieved. - total_result_set_size = 0; - begin - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) - - # Print out some information for each custom field. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID %d and name '%s' was found." % [ - index + statement.offset, - custom_field[:id], - custom_field[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of custom fields: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllCustomFields.main() -end diff --git a/dfp_api/examples/v201705/custom_field_service/get_custom_fields_for_line_items.rb b/dfp_api/examples/v201705/custom_field_service/get_custom_fields_for_line_items.rb deleted file mode 100755 index 2cd0f1086..000000000 --- a/dfp_api/examples/v201705/custom_field_service/get_custom_fields_for_line_items.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all custom fields that can be applied to line items. -require 'dfp_api' - -class GetCustomFieldsForLineItems - - def self.run_example(dfp) - custom_field_service = - dfp.service(:CustomFieldService, :v201705) - - # Create a statement to select custom fields. - query = 'WHERE entityType = :entityType' - values = [ - { - :key => 'entityType', - :value => { - :xsi_type => 'TextValue', - :value => 'LINE_ITEM' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of custom fields at a time, paging - # through until all custom fields have been retrieved. - total_result_set_size = 0; - begin - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) - - # Print out some information for each custom field. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID %d and name '%s' was found." % [ - index + statement.offset, - custom_field[:id], - custom_field[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of custom fields: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetCustomFieldsForLineItems.main() -end diff --git a/dfp_api/examples/v201705/exchange_rate_service/get_all_exchange_rates.rb b/dfp_api/examples/v201705/exchange_rate_service/get_all_exchange_rates.rb deleted file mode 100755 index 93dfb1fa5..000000000 --- a/dfp_api/examples/v201705/exchange_rate_service/get_all_exchange_rates.rb +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all exchange rates. -require 'dfp_api' - -class GetAllExchangeRates - - def self.run_example(dfp) - exchange_rate_service = - dfp.service(:ExchangeRateService, :v201705) - - # Create a statement to select exchange rates. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of exchange rates at a time, paging - # through until all exchange rates have been retrieved. - total_result_set_size = 0; - begin - page = exchange_rate_service.get_exchange_rates_by_statement( - statement.toStatement()) - - # Print out some information for each exchange rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |exchange_rate, index| - puts "%d) Exchange rate with ID %d, currency code '%s', direction '%s', and exchange rate %d was found." % [ - index + statement.offset, - exchange_rate[:id], - exchange_rate[:currency_code], - exchange_rate[:direction], - exchange_rate[:exchange_rate] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of exchange rates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllExchangeRates.main() -end diff --git a/dfp_api/examples/v201705/inventory_service/get_all_ad_units.rb b/dfp_api/examples/v201705/inventory_service/get_all_ad_units.rb deleted file mode 100755 index 76ca28c75..000000000 --- a/dfp_api/examples/v201705/inventory_service/get_all_ad_units.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all ad units. -require 'dfp_api' - -class GetAllAdUnits - - def self.run_example(dfp) - inventory_service = - dfp.service(:InventoryService, :v201705) - - # Create a statement to select ad units. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of ad units at a time, paging - # through until all ad units have been retrieved. - total_result_set_size = 0; - begin - page = inventory_service.get_ad_units_by_statement( - statement.toStatement()) - - # Print out some information for each ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |ad_unit, index| - puts "%d) Ad unit with ID '%s' and name '%s' was found." % [ - index + statement.offset, - ad_unit[:id], - ad_unit[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of ad units: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllAdUnits.main() -end diff --git a/dfp_api/examples/v201705/label_service/get_active_labels.rb b/dfp_api/examples/v201705/label_service/get_active_labels.rb deleted file mode 100755 index c7541f2f6..000000000 --- a/dfp_api/examples/v201705/label_service/get_active_labels.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active labels. -require 'dfp_api' - -class GetActiveLabels - - def self.run_example(dfp) - label_service = - dfp.service(:LabelService, :v201705) - - # Create a statement to select labels. - query = 'WHERE isActive = :isActive' - values = [ - { - :key => 'isActive', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of labels at a time, paging - # through until all labels have been retrieved. - total_result_set_size = 0; - begin - page = label_service.get_labels_by_statement( - statement.toStatement()) - - # Print out some information for each label. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |label, index| - puts "%d) Label with ID %d and name '%s' was found." % [ - index + statement.offset, - label[:id], - label[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of labels: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActiveLabels.main() -end diff --git a/dfp_api/examples/v201705/label_service/get_all_labels.rb b/dfp_api/examples/v201705/label_service/get_all_labels.rb deleted file mode 100755 index bfce2f209..000000000 --- a/dfp_api/examples/v201705/label_service/get_all_labels.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all labels. -require 'dfp_api' - -class GetAllLabels - - def self.run_example(dfp) - label_service = - dfp.service(:LabelService, :v201705) - - # Create a statement to select labels. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of labels at a time, paging - # through until all labels have been retrieved. - total_result_set_size = 0; - begin - page = label_service.get_labels_by_statement( - statement.toStatement()) - - # Print out some information for each label. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |label, index| - puts "%d) Label with ID %d and name '%s' was found." % [ - index + statement.offset, - label[:id], - label[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of labels: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllLabels.main() -end diff --git a/dfp_api/examples/v201705/line_item_service/create_line_items.rb b/dfp_api/examples/v201705/line_item_service/create_line_items.rb deleted file mode 100755 index 29c61d495..000000000 --- a/dfp_api/examples/v201705/line_item_service/create_line_items.rb +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example creates new line items. To determine which line items exist, run -# get_all_line_items.rb. To determine which orders exist, run -# get_all_orders.rb. To determine which placements exist, run -# get_all_placements.rb. To determine the IDs for locations, run -# get_all_cities.rb, get_all_countries.rb, get_all_metros.rb and -# get_all_regions.rb. - -require 'dfp_api' - -API_VERSION = :v201705 -# Number of line items to create. -ITEM_COUNT = 5 - -def create_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the LineItemService. - line_item_service = dfp.service(:LineItemService, API_VERSION) - - # Set the order that all created line items will belong to and the placement - # ID to target. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - targeted_placement_ids = Array.new(ITEM_COUNT) do - 'INSERT_PLACEMENT_ID_HERE'.to_i - end - - # Create inventory targeting. - inventory_targeting = {:targeted_placement_ids => targeted_placement_ids} - - # Create geographical targeting. - geo_targeting = { - # Include targets. - :targeted_locations => [ - {:id => 2840}, # USA. - {:id => 20123}, # Quebec, Canada. - {:id => 9000093} # Postal code B3P (Canada). - ], - # Exclude targets. - :excluded_locations => [ - {:id => 1016367}, # Chicago. - {:id => 200501} # New York. - ] - } - - # Create user domain targeting. Exclude domains that are not under the - # network's control. - user_domain_targeting = {:domains => ['usa.gov'], :targeted => false} - - # Create day-part targeting. - day_part_targeting = { - # Target only the weekend in the browser's timezone. - :time_zone => 'BROWSER', - :day_parts => [ - {:day_of_week => 'SATURDAY', - :start_time => {:hour => 0, :minute => 'ZERO'}, - :end_time => {:hour => 24, :minute => 'ZERO'}}, - {:day_of_week => 'SUNDAY', - :start_time => {:hour => 0, :minute => 'ZERO'}, - :end_time => {:hour => 24, :minute => 'ZERO'}} - ] - } - - # Create technology targeting. - technology_targeting = { - # Create browser targeting. - :browser_targeting => { - :is_targeted => true, - # Target just the Chrome browser. - :browsers => [{:id => 500072}] - } - } - - # Create targeting. - targeting = {:geo_targeting => geo_targeting, - :inventory_targeting => inventory_targeting, - :user_domain_targeting => user_domain_targeting, - :day_part_targeting => day_part_targeting, - :technology_targeting => technology_targeting - } - - # Create an array to store local line item objects. - line_items = (1..ITEM_COUNT).map do |index| - line_item = {:name => "Line item #%d-%d" % [Time.new.to_f * 1000, index], - :order_id => order_id, - :targeting => targeting, - :line_item_type => 'STANDARD', - :allow_overbook => true} - # Set the creative rotation type to even. - line_item[:creative_rotation_type] = 'EVEN' - - # Create the creative placeholder. - creative_placeholder = { - :size => {:width => 300, :height => 250, :is_aspect_ratio => false} - } - - # Set the size of creatives that can be associated with this line item. - line_item[:creative_placeholders] = [creative_placeholder] - - # Set the length of the line item to run. - line_item[:start_date_time_type] = 'IMMEDIATELY' - line_item[:end_date_time] = {:date => {:year => Time.now.year + 1, - :month => 9, - :day => 30}, - :hour => 0, - :minute => 0, - :second => 0, - :time_zone_id => 'America/Los_Angeles'} - - # Set the cost per unit to $2. - line_item[:cost_type] = 'CPM' - line_item[:cost_per_unit] = { - :currency_code => 'USD', - :micro_amount => 2000000 - } - - # Set the number of units bought to 500,000 so that the budget is $1,000. - line_item[:primary_goal] = { - :units => '500000', - :unit_type => 'IMPRESSIONS', - :goal_type => 'LIFETIME' - } - - line_item - end - - # Create the line items on the server. - return_line_items = line_item_service.create_line_items(line_items) - - if return_line_items - return_line_items.each do |line_item| - puts ("Line item with ID: %d, belonging to order ID: %d, " + - "and named: %s was created.") % - [line_item[:id], line_item[:order_id], line_item[:name]] - end - else - raise 'No line items were created.' - end -end - -if __FILE__ == $0 - begin - create_line_items() - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end -end diff --git a/dfp_api/examples/v201705/line_item_service/create_video_line_item.rb b/dfp_api/examples/v201705/line_item_service/create_video_line_item.rb deleted file mode 100755 index ca1d97f77..000000000 --- a/dfp_api/examples/v201705/line_item_service/create_video_line_item.rb +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example create a new line item to serve to video content. To determine -# which line items exist, run get_all_line_items.rb. To determine which orders -# exist, run get_all_orders.rb. To create a video ad unit, run -# create_video_ad_unit.rb. To create criteria for categories, run -# create_custom_targeting_keys_and_values.rb. -# -# This feature is only available to DFP premium solution networks. - -require 'dfp_api' - -API_VERSION = :v201705 - -def create_video_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the LineItemService. - line_item_service = dfp.service(:LineItemService, API_VERSION) - - # Set the order that the created line item will belong to and the video ad - # unit ID to target. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - targeted_video_ad_unit_id = 'INSERT_VIDEO_AD_UNIT_ID_HERE'.to_s - - # Set the custom targeting key ID and value ID representing the metadata on - # the content to target. This would typically be a key representing a "genre" - # and a value representing something like "comedy". - content_custom_targeting_key_id = - 'INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - content_custom_targeting_value_id = - 'INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i - - # Create custom criteria for the content metadata targeting. - content_custom_criteria = { - :xsi_type => 'CustomCriteria', - :key_id => content_custom_targeting_key_id, - :value_ids => [content_custom_targeting_value_id], - :operator => 'IS' - } - - # Create custom criteria set. - custom_criteria_set = { - :children => [content_custom_criteria] - } - - # Create inventory targeting. - inventory_targeting = { - :targeted_ad_units => [ - {:ad_unit_id => targeted_video_ad_unit_id} - ] - } - - # Create video position targeting. - video_position = {:position_type => 'PREROLL'} - video_position_target = {:video_position => video_position} - video_position_targeting = {:targeted_positions => [video_position_target]} - - # Create targeting. - targeting = { - :custom_targeting => custom_criteria_set, - :inventory_targeting => inventory_targeting, - :video_position_targeting => video_position_targeting - } - - # Create local line item object. - line_item = { - :name => 'Video line item', - :order_id => order_id, - :targeting => targeting, - :line_item_type => 'SPONSORSHIP', - :allow_overbook => true, - # Set the environment type to video. - :environment_type => 'VIDEO_PLAYER', - # Set the creative rotation type to optimized. - :creative_rotation_type => 'OPTIMIZED', - # Set delivery of video companions to optional. - :companion_delivery_option => 'OPTIONAL', - # Set the length of the line item to run. - :start_date_time_type => 'IMMEDIATELY', - line_item[:end_date_time] = {:date => {:year => Time.now.year + 1, - :month => 9, - :day => 30}, - :hour => 0, - :minute => 0, - :second => 0, - :time_zone_id => 'America/Los_Angeles'} - # Set the cost per day to $1. - :cost_type => 'CPD', - :cost_per_unit => {:currency_code => 'USD', :micro_amount => 1000000}, - # Set the percentage to be 100%. - :primary_goal => { - :units => '100', - :unit_type => 'IMPRESSIONS', - :goal_type => 'DAILY' - } - } - - # Create the master creative placeholder and companion creative placeholders. - creative_master_placeholder = { - :size => {:width => 400, :height => 300, :is_aspect_ratio => false}, - :companions => [ - {:size => {:width => 300, :height => 250, :is_aspect_ratio => false}}, - {:size => {:width => 728, :height => 90, :is_aspect_ratio => false}} - ] - } - - # Set the size of creatives that can be associated with this line item. - line_item[:creative_placeholders] = [creative_master_placeholder] - - # Create the line item on the server. - return_line_item = line_item_service.create_line_item(line_item) - - if return_line_item - puts(("Line item with ID: %d, belonging to order ID: %d, " + - "and named: %s was created.") % - [return_line_item[:id], return_line_item[:order_id], - return_line_item[:name]]) - else - raise 'No line items were created.' - end -end - -if __FILE__ == $0 - begin - create_video_line_item() - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end -end diff --git a/dfp_api/examples/v201705/line_item_service/get_all_line_items.rb b/dfp_api/examples/v201705/line_item_service/get_all_line_items.rb deleted file mode 100755 index 146d59906..000000000 --- a/dfp_api/examples/v201705/line_item_service/get_all_line_items.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all line items. -require 'dfp_api' - -class GetAllLineItems - - def self.run_example(dfp) - line_item_service = - dfp.service(:LineItemService, :v201705) - - # Create a statement to select line items. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of line items at a time, paging - # through until all line items have been retrieved. - total_result_set_size = 0; - begin - page = line_item_service.get_line_items_by_statement( - statement.toStatement()) - - # Print out some information for each line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |line_item, index| - puts "%d) Line item with ID %d and name '%s' was found." % [ - index + statement.offset, - line_item[:id], - line_item[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of line items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllLineItems.main() -end diff --git a/dfp_api/examples/v201705/line_item_service/get_line_items_that_need_creatives.rb b/dfp_api/examples/v201705/line_item_service/get_line_items_that_need_creatives.rb deleted file mode 100755 index ed5d4d707..000000000 --- a/dfp_api/examples/v201705/line_item_service/get_line_items_that_need_creatives.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all line items that are missing creatives. -require 'dfp_api' - -class GetLineItemsThatNeedCreatives - - def self.run_example(dfp) - line_item_service = - dfp.service(:LineItemService, :v201705) - - # Create a statement to select line items. - query = 'WHERE isMissingCreatives = :isMissingCreatives' - values = [ - { - :key => 'isMissingCreatives', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of line items at a time, paging - # through until all line items have been retrieved. - total_result_set_size = 0; - begin - page = line_item_service.get_line_items_by_statement( - statement.toStatement()) - - # Print out some information for each line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |line_item, index| - puts "%d) Line item with ID %d and name '%s' was found." % [ - index + statement.offset, - line_item[:id], - line_item[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of line items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetLineItemsThatNeedCreatives.main() -end diff --git a/dfp_api/examples/v201705/native_style_service/get_all_native_styles.rb b/dfp_api/examples/v201705/native_style_service/get_all_native_styles.rb deleted file mode 100755 index 00d3e00e9..000000000 --- a/dfp_api/examples/v201705/native_style_service/get_all_native_styles.rb +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all native styles. - -require 'dfp_api' - - -class GetAllNativeStyles - - def self.run_example(dfp) - # Get the NativeStyleService. - native_style_service = dfp.service(:NativeStyleService, :v201705) - - # Create a statement to select native styles. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of native styles at a time, paging through until - # all of them have been retrieved. - total_result_set_size = 0 - begin - page = native_style_service.get_native_styles_by_statement( - statement.toStatement()) - - # Print out some information for each native style. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |style, index| - puts ("%d) Native style with ID %d, name '%s' and creative " + - "template ID %d was found.") % [index + statement.offset, - style[:id], style[:name], style[:creative_template_id]] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size - - puts 'Total number of native styles: %d' % total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllNativeStyles.main() -end diff --git a/dfp_api/examples/v201705/order_service/get_all_orders.rb b/dfp_api/examples/v201705/order_service/get_all_orders.rb deleted file mode 100755 index 4cf7421aa..000000000 --- a/dfp_api/examples/v201705/order_service/get_all_orders.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all orders. -require 'dfp_api' - -class GetAllOrders - - def self.run_example(dfp) - order_service = - dfp.service(:OrderService, :v201705) - - # Create a statement to select orders. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of orders at a time, paging - # through until all orders have been retrieved. - total_result_set_size = 0; - begin - page = order_service.get_orders_by_statement( - statement.toStatement()) - - # Print out some information for each order. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |order, index| - puts "%d) Order with ID %d and name '%s' was found." % [ - index + statement.offset, - order[:id], - order[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of orders: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllOrders.main() -end diff --git a/dfp_api/examples/v201705/package_service/get_all_packages.rb b/dfp_api/examples/v201705/package_service/get_all_packages.rb deleted file mode 100755 index c19c53a58..000000000 --- a/dfp_api/examples/v201705/package_service/get_all_packages.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all packages. -require 'dfp_api' - -class GetAllPackages - - def self.run_example(dfp) - package_service = - dfp.service(:PackageService, :v201705) - - # Create a statement to select packages. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of packages at a time, paging - # through until all packages have been retrieved. - total_result_set_size = 0; - begin - page = package_service.get_packages_by_statement( - statement.toStatement()) - - # Print out some information for each package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |pkg, index| - puts "%d) Package with ID %d, name '%s', and proposal id %d was found." % [ - index + statement.offset, - pkg[:id], - pkg[:name], - pkg[:proposal_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of packages: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllPackages.main() -end diff --git a/dfp_api/examples/v201705/package_service/get_in_progress_packages.rb b/dfp_api/examples/v201705/package_service/get_in_progress_packages.rb deleted file mode 100755 index 7e3d67813..000000000 --- a/dfp_api/examples/v201705/package_service/get_in_progress_packages.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all packages in progress. -require 'dfp_api' - -class GetInProgressPackages - - def self.run_example(dfp) - package_service = - dfp.service(:PackageService, :v201705) - - # Create a statement to select packages. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'IN_PROGRESS' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of packages at a time, paging - # through until all packages have been retrieved. - total_result_set_size = 0; - begin - page = package_service.get_packages_by_statement( - statement.toStatement()) - - # Print out some information for each package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |pkg, index| - puts "%d) Package with ID %d, name '%s', and proposal ID %d was found." % [ - index + statement.offset, - pkg[:id], - pkg[:name], - pkg[:proposal_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of packages: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetInProgressPackages.main() -end diff --git a/dfp_api/examples/v201705/placement_service/get_active_placements.rb b/dfp_api/examples/v201705/placement_service/get_active_placements.rb deleted file mode 100755 index fa07fe8fd..000000000 --- a/dfp_api/examples/v201705/placement_service/get_active_placements.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active placements. -require 'dfp_api' - -class GetActivePlacements - - def self.run_example(dfp) - placement_service = - dfp.service(:PlacementService, :v201705) - - # Create a statement to select placements. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of placements at a time, paging - # through until all placements have been retrieved. - total_result_set_size = 0; - begin - page = placement_service.get_placements_by_statement( - statement.toStatement()) - - # Print out some information for each placement. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |placement, index| - puts "%d) Placement with ID %d and name '%s' was found." % [ - index + statement.offset, - placement[:id], - placement[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of placements: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActivePlacements.main() -end diff --git a/dfp_api/examples/v201705/placement_service/get_all_placements.rb b/dfp_api/examples/v201705/placement_service/get_all_placements.rb deleted file mode 100755 index 58de591fe..000000000 --- a/dfp_api/examples/v201705/placement_service/get_all_placements.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all placements. -require 'dfp_api' - -class GetAllPlacements - - def self.run_example(dfp) - placement_service = - dfp.service(:PlacementService, :v201705) - - # Create a statement to select placements. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of placements at a time, paging - # through until all placements have been retrieved. - total_result_set_size = 0; - begin - page = placement_service.get_placements_by_statement( - statement.toStatement()) - - # Print out some information for each placement. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |placement, index| - puts "%d) Placement with ID %d and name '%s' was found." % [ - index + statement.offset, - placement[:id], - placement[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of placements: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllPlacements.main() -end diff --git a/dfp_api/examples/v201705/premium_rate_service/get_all_premium_rates.rb b/dfp_api/examples/v201705/premium_rate_service/get_all_premium_rates.rb deleted file mode 100755 index efa48500f..000000000 --- a/dfp_api/examples/v201705/premium_rate_service/get_all_premium_rates.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all premium rates. -require 'dfp_api' - -class GetAllPremiumRates - - def self.run_example(dfp) - premium_rate_service = - dfp.service(:PremiumRateService, :v201705) - - # Create a statement to select premium rates. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of premium rates at a time, paging - # through until all premium rates have been retrieved. - total_result_set_size = 0; - begin - page = premium_rate_service.get_premium_rates_by_statement( - statement.toStatement()) - - # Print out some information for each premium rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |premium_rate, index| - puts "%d) Premium rate with ID %d, premium feature '%s', and rate card id %d was found." % [ - index + statement.offset, - premium_rate[:id], - premium_rate[:xsi_type], - premium_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of premium rates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllPremiumRates.main() -end diff --git a/dfp_api/examples/v201705/premium_rate_service/get_premium_rates_for_rate_card.rb b/dfp_api/examples/v201705/premium_rate_service/get_premium_rates_for_rate_card.rb deleted file mode 100755 index 0d2266575..000000000 --- a/dfp_api/examples/v201705/premium_rate_service/get_premium_rates_for_rate_card.rb +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all premium rates on a specific rate card. -require 'dfp_api' - -class GetPremiumRatesForRateCard - - RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE'; - - def self.run_example(dfp, rate_card_id) - premium_rate_service = - dfp.service(:PremiumRateService, :v201705) - - # Create a statement to select premium rates. - query = 'WHERE rateCardId = :rateCardId' - values = [ - { - :key => 'rateCardId', - :value => { - :xsi_type => 'NumberValue', - :value => rate_card_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of premium rates at a time, paging - # through until all premium rates have been retrieved. - total_result_set_size = 0; - begin - page = premium_rate_service.get_premium_rates_by_statement( - statement.toStatement()) - - # Print out some information for each premium rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |premium_rate, index| - puts "%d) Premium rate with ID %d, premium feature '%s', and rate card ID %d was found." % [ - index + statement.offset, - premium_rate[:id], - premium_rate[:xsi_type], - premium_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of premium rates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, RATE_CARD_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetPremiumRatesForRateCard.main() -end diff --git a/dfp_api/examples/v201705/product_package_item_service/get_all_product_package_items.rb b/dfp_api/examples/v201705/product_package_item_service/get_all_product_package_items.rb deleted file mode 100755 index 87cdb85c2..000000000 --- a/dfp_api/examples/v201705/product_package_item_service/get_all_product_package_items.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all product package items. -require 'dfp_api' - -class GetAllProductPackageItems - - def self.run_example(dfp) - product_package_item_service = - dfp.service(:ProductPackageItemService, :v201705) - - # Create a statement to select product package items. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of product package items at a time, paging - # through until all product package items have been retrieved. - total_result_set_size = 0; - begin - page = product_package_item_service.get_product_package_items_by_statement( - statement.toStatement()) - - # Print out some information for each product package item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package_item, index| - puts "%d) Product package item with ID %d, product id %d, and product package id %d was found." % [ - index + statement.offset, - product_package_item[:id], - product_package_item[:product_id], - product_package_item[:product_package_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product package items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProductPackageItems.main() -end diff --git a/dfp_api/examples/v201705/product_package_item_service/get_product_package_items_for_product_package.rb b/dfp_api/examples/v201705/product_package_item_service/get_product_package_items_for_product_package.rb deleted file mode 100755 index a20894a60..000000000 --- a/dfp_api/examples/v201705/product_package_item_service/get_product_package_items_for_product_package.rb +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all product package items belonging to a product package. -require 'dfp_api' - -class GetProductPackageItemsForProductPackage - - PRODUCT_PACKAGE_ID = 'INSERT_PRODUCT_PACKAGE_ID_HERE'; - - def self.run_example(dfp, product_package_id) - product_package_item_service = - dfp.service(:ProductPackageItemService, :v201705) - - # Create a statement to select product package items. - query = 'WHERE productPackageId = :productPackageId' - values = [ - { - :key => 'productPackageId', - :value => { - :xsi_type => 'NumberValue', - :value => product_package_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of product package items at a time, paging - # through until all product package items have been retrieved. - total_result_set_size = 0; - begin - page = product_package_item_service.get_product_package_items_by_statement( - statement.toStatement()) - - # Print out some information for each product package item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package_item, index| - puts "%d) Product package item with ID %d, product ID %d, and product package ID %d was found." % [ - index + statement.offset, - product_package_item[:id], - product_package_item[:product_id], - product_package_item[:product_package_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product package items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, PRODUCT_PACKAGE_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetProductPackageItemsForProductPackage.main() -end diff --git a/dfp_api/examples/v201705/product_package_service/get_active_product_packages.rb b/dfp_api/examples/v201705/product_package_service/get_active_product_packages.rb deleted file mode 100755 index 5d01fe6ec..000000000 --- a/dfp_api/examples/v201705/product_package_service/get_active_product_packages.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all active product packages. -require 'dfp_api' - -class GetActiveProductPackages - - def self.run_example(dfp) - product_package_service = - dfp.service(:ProductPackageService, :v201705) - - # Create a statement to select product packages. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of product packages at a time, paging - # through until all product packages have been retrieved. - total_result_set_size = 0; - begin - page = product_package_service.get_product_packages_by_statement( - statement.toStatement()) - - # Print out some information for each product package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package, index| - puts "%d) Product package with ID %d and name '%s' was found." % [ - index + statement.offset, - product_package[:id], - product_package[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product packages: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetActiveProductPackages.main() -end diff --git a/dfp_api/examples/v201705/product_package_service/get_all_product_packages.rb b/dfp_api/examples/v201705/product_package_service/get_all_product_packages.rb deleted file mode 100755 index 5ac941e6c..000000000 --- a/dfp_api/examples/v201705/product_package_service/get_all_product_packages.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all product packages. -require 'dfp_api' - -class GetAllProductPackages - - def self.run_example(dfp) - product_package_service = - dfp.service(:ProductPackageService, :v201705) - - # Create a statement to select product packages. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of product packages at a time, paging - # through until all product packages have been retrieved. - total_result_set_size = 0; - begin - page = product_package_service.get_product_packages_by_statement( - statement.toStatement()) - - # Print out some information for each product package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package, index| - puts "%d) Product package with ID %d and name '%s' was found." % [ - index + statement.offset, - product_package[:id], - product_package[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product packages: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProductPackages.main() -end diff --git a/dfp_api/examples/v201705/product_service/get_all_products.rb b/dfp_api/examples/v201705/product_service/get_all_products.rb deleted file mode 100755 index 2048a27bc..000000000 --- a/dfp_api/examples/v201705/product_service/get_all_products.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all products. -require 'dfp_api' - -class GetAllProducts - - def self.run_example(dfp) - product_service = - dfp.service(:ProductService, :v201705) - - # Create a statement to select products. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of products at a time, paging - # through until all products have been retrieved. - total_result_set_size = 0; - begin - page = product_service.get_products_by_statement( - statement.toStatement()) - - # Print out some information for each product. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product, index| - puts "%d) Product with ID %d and name '%s' was found." % [ - index + statement.offset, - product[:id], - product[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of products: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProducts.main() -end diff --git a/dfp_api/examples/v201705/product_template_service/get_all_product_templates.rb b/dfp_api/examples/v201705/product_template_service/get_all_product_templates.rb deleted file mode 100755 index 773b49292..000000000 --- a/dfp_api/examples/v201705/product_template_service/get_all_product_templates.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all product templates. -require 'dfp_api' - -class GetAllProductTemplates - - def self.run_example(dfp) - product_template_service = - dfp.service(:ProductTemplateService, :v201705) - - # Create a statement to select product templates. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of product templates at a time, paging - # through until all product templates have been retrieved. - total_result_set_size = 0; - begin - page = product_template_service.get_product_templates_by_statement( - statement.toStatement()) - - # Print out some information for each product template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_template, index| - puts "%d) Product template with ID %d and name '%s' was found." % [ - index + statement.offset, - product_template[:id], - product_template[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product templates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProductTemplates.main() -end diff --git a/dfp_api/examples/v201705/product_template_service/get_sponsorship_product_templates.rb b/dfp_api/examples/v201705/product_template_service/get_sponsorship_product_templates.rb deleted file mode 100755 index 30bb9d8fe..000000000 --- a/dfp_api/examples/v201705/product_template_service/get_sponsorship_product_templates.rb +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all sponsorship product templates. -require 'dfp_api' - -class GetSponsorshipProductTemplates - - def self.run_example(dfp) - product_template_service = - dfp.service(:ProductTemplateService, :v201705) - - # Create a statement to select product templates. - query = 'WHERE lineItemType = :lineItemType' - values = [ - { - :key => 'lineItemType', - :value => { - :xsi_type => 'TextValue', - :value => 'SPONSORSHIP' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of product templates at a time, paging - # through until all product templates have been retrieved. - total_result_set_size = 0; - begin - page = product_template_service.get_product_templates_by_statement( - statement.toStatement()) - - # Print out some information for each product template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_template, index| - puts "%d) Product template with ID %d and name '%s' was found." % [ - index + statement.offset, - product_template[:id], - product_template[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of product templates: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetSponsorshipProductTemplates.main() -end diff --git a/dfp_api/examples/v201705/proposal_line_item_service/get_all_proposal_line_items.rb b/dfp_api/examples/v201705/proposal_line_item_service/get_all_proposal_line_items.rb deleted file mode 100755 index 1914dbfe3..000000000 --- a/dfp_api/examples/v201705/proposal_line_item_service/get_all_proposal_line_items.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all proposal line items. -require 'dfp_api' - -class GetAllProposalLineItems - - def self.run_example(dfp) - proposal_line_item_service = - dfp.service(:ProposalLineItemService, :v201705) - - # Create a statement to select proposal line items. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of proposal line items at a time, paging - # through until all proposal line items have been retrieved. - total_result_set_size = 0; - begin - page = proposal_line_item_service.get_proposal_line_items_by_statement( - statement.toStatement()) - - # Print out some information for each proposal line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal_line_item, index| - puts "%d) Proposal line item with ID %d and name '%s' was found." % [ - index + statement.offset, - proposal_line_item[:id], - proposal_line_item[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of proposal line items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProposalLineItems.main() -end diff --git a/dfp_api/examples/v201705/proposal_line_item_service/get_proposal_line_items_for_proposal.rb b/dfp_api/examples/v201705/proposal_line_item_service/get_proposal_line_items_for_proposal.rb deleted file mode 100755 index 2fdf2c143..000000000 --- a/dfp_api/examples/v201705/proposal_line_item_service/get_proposal_line_items_for_proposal.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all proposal line items belonging to a specific proposal. -require 'dfp_api' - -class GetProposalLineItemsForProposal - - PROPOSAL_ID = 'INSERT_PROPOSAL_ID_HERE'; - - def self.run_example(dfp, proposal_id) - proposal_line_item_service = - dfp.service(:ProposalLineItemService, :v201705) - - # Create a statement to select proposal line items. - query = 'WHERE proposalId = :proposalId' - values = [ - { - :key => 'proposalId', - :value => { - :xsi_type => 'NumberValue', - :value => proposal_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of proposal line items at a time, paging - # through until all proposal line items have been retrieved. - total_result_set_size = 0; - begin - page = proposal_line_item_service.get_proposal_line_items_by_statement( - statement.toStatement()) - - # Print out some information for each proposal line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal_line_item, index| - puts "%d) Proposal line item with ID %d and name '%s' was found." % [ - index + statement.offset, - proposal_line_item[:id], - proposal_line_item[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of proposal line items: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, PROPOSAL_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetProposalLineItemsForProposal.main() -end diff --git a/dfp_api/examples/v201705/proposal_service/get_all_proposals.rb b/dfp_api/examples/v201705/proposal_service/get_all_proposals.rb deleted file mode 100755 index 7a22d4d02..000000000 --- a/dfp_api/examples/v201705/proposal_service/get_all_proposals.rb +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all proposals. -require 'dfp_api' - -class GetAllProposals - - def self.run_example(dfp) - proposal_service = dfp.service(:ProposalService, :v201705) - - # Create a statement to select proposals. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of proposals at a time, paging through until all - # proposals have been retrieved. - total_result_set_size = 0 - begin - page = - proposal_service.get_proposals_by_statement(statement.toStatement()) - - # Print out some information for each proposal. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal, index| - puts "%d) Proposal with ID %d and name '%s' was found." % - [index + statement.offset, proposal[:id], proposal[:name]] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size - - puts 'Total number of proposals: %d' % total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllProposals.main() -end diff --git a/dfp_api/examples/v201705/proposal_service/get_marketplace_comments.rb b/dfp_api/examples/v201705/proposal_service/get_marketplace_comments.rb deleted file mode 100755 index 4c32e58f6..000000000 --- a/dfp_api/examples/v201705/proposal_service/get_marketplace_comments.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets the Marketplace comments for a programmatic proposal. - -require 'dfp_api' - - -class GetMarketplaceComments - - def self.run_example(dfp, proposal_id) - proposal_service = dfp.service(:ProposalService, :v201705) - - # Create a statement to select marketplace comments. - query = 'WHERE proposalId = :proposalId' - values = [ - { - :key => 'proposalId', - :value => {:xsi_type => 'NumberValue', :value => proposal_id} - } - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve comments. - page = proposal_service.get_marketplace_comments_by_statement( - statement.toStatement()) - - # Print out some information for each comment. - if page[:results] - page[:results].each_with_index do |comment, index| - puts ("%d) Comment Marketplace comment with creation time '%s' and " + - "comment '%s' was found.") % [index + statement.offset, - comment[:proposal_id], comment[:creation_time], comment[:comment]] - end - end - puts 'Total number of comments: %d' % (page[:total_result_set_size] || 0) - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Specify ID of the proposal to get comments for here. - proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i - - begin - run_example(dfp, proposal_id) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetMarketplaceComments.main() -end diff --git a/dfp_api/examples/v201705/proposal_service/get_proposals_pending_approval.rb b/dfp_api/examples/v201705/proposal_service/get_proposals_pending_approval.rb deleted file mode 100755 index 8af610dd7..000000000 --- a/dfp_api/examples/v201705/proposal_service/get_proposals_pending_approval.rb +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all proposals pending approval. -require 'dfp_api' - -class GetProposalsPendingApproval - - def self.run_example(dfp) - proposal_service = - dfp.service(:ProposalService, :v201705) - - # Create a statement to select proposals. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'PENDING_APPROVAL' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of proposals at a time, paging through until all - # proposals have been retrieved. - total_result_set_size = 0 - begin - page = - proposal_service.get_proposals_by_statement(statement.toStatement()) - - # Print out some information for each proposal. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal, index| - puts "%d) Proposal with ID %d and name '%s' was found." % - [index + statement.offset, proposal[:id], proposal[:name]] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size - - puts 'Total number of proposals: %d' % total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetProposalsPendingApproval.main() -end diff --git a/dfp_api/examples/v201705/rate_card_service/get_all_rate_cards.rb b/dfp_api/examples/v201705/rate_card_service/get_all_rate_cards.rb deleted file mode 100755 index ccf10d6ff..000000000 --- a/dfp_api/examples/v201705/rate_card_service/get_all_rate_cards.rb +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all rate cards. -require 'dfp_api' - -class GetAllRateCards - - def self.run_example(dfp) - rate_card_service = - dfp.service(:RateCardService, :v201705) - - # Create a statement to select rate cards. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of rate cards at a time, paging - # through until all rate cards have been retrieved. - total_result_set_size = 0; - begin - page = rate_card_service.get_rate_cards_by_statement( - statement.toStatement()) - - # Print out some information for each rate card. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |rate_card, index| - puts "%d) Rate card with ID %d, name '%s', and currency code '%s' was found." % [ - index + statement.offset, - rate_card[:id], - rate_card[:name], - rate_card[:currency_code] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of rate cards: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllRateCards.main() -end diff --git a/dfp_api/examples/v201705/rate_card_service/get_marketplace_rate_cards.rb b/dfp_api/examples/v201705/rate_card_service/get_marketplace_rate_cards.rb deleted file mode 100755 index 852a7631e..000000000 --- a/dfp_api/examples/v201705/rate_card_service/get_marketplace_rate_cards.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all rate cards that can be used for Marketplace products. -require 'dfp_api' - -class GetMarketplaceRateCards - - def self.run_example(dfp) - rate_card_service = - dfp.service(:RateCardService, :v201705) - - # Create a statement to select rate cards. - query = 'WHERE forMarketplace = :forMarketplace' - values = [ - { - :key => 'forMarketplace', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of rate cards at a time, paging - # through until all rate cards have been retrieved. - total_result_set_size = 0; - begin - page = rate_card_service.get_rate_cards_by_statement( - statement.toStatement()) - - # Print out some information for each rate card. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |rate_card, index| - puts "%d) Rate card with ID %d, name '%s', and currency code '%s' was found." % [ - index + statement.offset, - rate_card[:id], - rate_card[:name], - rate_card[:currency_code] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of rate cards: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetMarketplaceRateCards.main() -end diff --git a/dfp_api/examples/v201705/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb b/dfp_api/examples/v201705/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb deleted file mode 100755 index 3fae26d42..000000000 --- a/dfp_api/examples/v201705/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all reconciliation order reports for a given reconciliation report. -require 'dfp_api' - -class GetReconciliationOrderReportsForReconciliationReport - - RECONCILIATION_REPORT_ID = 'INSERT_RECONCILIATION_REPORT_ID_HERE'; - - def self.run_example(dfp, reconciliation_report_id) - reconciliation_order_report_service = - dfp.service(:ReconciliationOrderReportService, :v201705) - - # Create a statement to select reconciliation order reports. - query = 'WHERE reconciliationReportId = :reconciliationReportId' - values = [ - { - :key => 'reconciliationReportId', - :value => { - :xsi_type => 'NumberValue', - :value => reconciliation_report_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of reconciliation order reports at a time, paging - # through until all reconciliation order reports have been retrieved. - total_result_set_size = 0; - begin - page = reconciliation_order_report_service.get_reconciliation_order_reports_by_statement( - statement.toStatement()) - - # Print out some information for each reconciliation order report. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |reconciliation_order_report, index| - puts "%d) Reconciliation order report with ID %d and status '%s' was found." % [ - index + statement.offset, - reconciliation_order_report[:id], - reconciliation_order_report[:status] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of reconciliation order reports: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, RECONCILIATION_REPORT_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetReconciliationOrderReportsForReconciliationReport.main() -end diff --git a/dfp_api/examples/v201705/reconciliation_report_service/get_all_reconciliation_reports.rb b/dfp_api/examples/v201705/reconciliation_report_service/get_all_reconciliation_reports.rb deleted file mode 100755 index da8453e25..000000000 --- a/dfp_api/examples/v201705/reconciliation_report_service/get_all_reconciliation_reports.rb +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all reconciliation reports. -require 'dfp_api' -require 'date' - -class GetAllReconciliationReports - - def self.run_example(dfp) - reconciliation_report_service = - dfp.service(:ReconciliationReportService, :v201705) - - # Create a statement to select reconciliation reports. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of reconciliation reports at a time, paging - # through until all reconciliation reports have been retrieved. - total_result_set_size = 0; - begin - page = reconciliation_report_service.get_reconciliation_reports_by_statement( - statement.toStatement()) - - # Print out some information for each reconciliation report. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |reconciliation_report, index| - start_date = reconciliation_report[:start_date] - start_date_string = Date.new( - start_date[:year], - start_date[:month], - start_date[:day]).to_s - puts "%d) Reconciliation report with ID %d and start date '%s' was found." % [ - index + statement.offset, - reconciliation_report[:id], - start_date_string - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of reconciliation reports: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllReconciliationReports.main() -end diff --git a/dfp_api/examples/v201705/suggested_ad_unit_service/get_all_suggested_ad_units.rb b/dfp_api/examples/v201705/suggested_ad_unit_service/get_all_suggested_ad_units.rb deleted file mode 100755 index f99b6fcc3..000000000 --- a/dfp_api/examples/v201705/suggested_ad_unit_service/get_all_suggested_ad_units.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all suggested ad units. -require 'dfp_api' - -class GetAllSuggestedAdUnits - - def self.run_example(dfp) - suggested_ad_unit_service = - dfp.service(:SuggestedAdUnitService, :v201705) - - # Create a statement to select suggested ad units. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of suggested ad units at a time, paging - # through until all suggested ad units have been retrieved. - total_result_set_size = 0; - begin - page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) - - # Print out some information for each suggested ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |suggested_ad_unit, index| - puts "%d) Suggested ad unit with ID '%s' and num requests %d was found." % [ - index + statement.offset, - suggested_ad_unit[:id], - suggested_ad_unit[:num_requests] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of suggested ad units: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllSuggestedAdUnits.main() -end diff --git a/dfp_api/examples/v201705/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb b/dfp_api/examples/v201705/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb deleted file mode 100755 index 647234ae7..000000000 --- a/dfp_api/examples/v201705/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all highly requested suggested ad units. -require 'dfp_api' - -class GetHighlyRequestedSuggestedAdUnits - - NUM_REQUESTS = 'INSERT_NUM_REQUESTS_HERE'; - - def self.run_example(dfp, num_requests) - suggested_ad_unit_service = - dfp.service(:SuggestedAdUnitService, :v201705) - - # Create a statement to select suggested ad units. - query = 'WHERE numRequests >= :numRequests' - values = [ - { - :key => 'numRequests', - :value => { - :xsi_type => 'NumberValue', - :value => num_requests - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of suggested ad units at a time, paging - # through until all suggested ad units have been retrieved. - total_result_set_size = 0; - begin - page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) - - # Print out some information for each suggested ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |suggested_ad_unit, index| - puts "%d) Suggested ad unit with ID '%s' and num requests %d was found." % [ - index + statement.offset, - suggested_ad_unit[:id], - suggested_ad_unit[:num_requests] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of suggested ad units: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, NUM_REQUESTS.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetHighlyRequestedSuggestedAdUnits.main() -end diff --git a/dfp_api/examples/v201705/team_service/get_all_teams.rb b/dfp_api/examples/v201705/team_service/get_all_teams.rb deleted file mode 100755 index 602c4b638..000000000 --- a/dfp_api/examples/v201705/team_service/get_all_teams.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all teams. -require 'dfp_api' - -class GetAllTeams - - def self.run_example(dfp) - team_service = - dfp.service(:TeamService, :v201705) - - # Create a statement to select teams. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of teams at a time, paging - # through until all teams have been retrieved. - total_result_set_size = 0; - begin - page = team_service.get_teams_by_statement( - statement.toStatement()) - - # Print out some information for each team. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |team, index| - puts "%d) Team with ID %d and name '%s' was found." % [ - index + statement.offset, - team[:id], - team[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of teams: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllTeams.main() -end diff --git a/dfp_api/examples/v201705/user_service/get_all_users.rb b/dfp_api/examples/v201705/user_service/get_all_users.rb deleted file mode 100755 index 89d47189c..000000000 --- a/dfp_api/examples/v201705/user_service/get_all_users.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all users. -require 'dfp_api' - -class GetAllUsers - - def self.run_example(dfp) - user_service = - dfp.service(:UserService, :v201705) - - # Create a statement to select users. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of users at a time, paging - # through until all users have been retrieved. - total_result_set_size = 0; - begin - page = user_service.get_users_by_statement( - statement.toStatement()) - - # Print out some information for each user. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user, index| - puts "%d) User with ID %d and name '%s' was found." % [ - index + statement.offset, - user[:id], - user[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of users: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllUsers.main() -end diff --git a/dfp_api/examples/v201705/user_service/get_user_by_email_address.rb b/dfp_api/examples/v201705/user_service/get_user_by_email_address.rb deleted file mode 100755 index 0be2a97b6..000000000 --- a/dfp_api/examples/v201705/user_service/get_user_by_email_address.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets users by email. -require 'dfp_api' - -class GetUserByEmailAddress - - EMAIL_ADDRESS = 'INSERT_EMAIL_ADDRESS_HERE'; - - def self.run_example(dfp, email_address) - user_service = - dfp.service(:UserService, :v201705) - - # Create a statement to select users. - query = 'WHERE email = :email' - values = [ - { - :key => 'email', - :value => { - :xsi_type => 'TextValue', - :value => email_address - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of users at a time, paging - # through until all users have been retrieved. - total_result_set_size = 0; - begin - page = user_service.get_users_by_statement( - statement.toStatement()) - - # Print out some information for each user. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user, index| - puts "%d) User with ID %d and name '%s' was found." % [ - index + statement.offset, - user[:id], - user[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of users: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, EMAIL_ADDRESS) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetUserByEmailAddress.main() -end diff --git a/dfp_api/examples/v201705/user_team_association_service/get_all_user_team_associations.rb b/dfp_api/examples/v201705/user_team_association_service/get_all_user_team_associations.rb deleted file mode 100755 index 44364f493..000000000 --- a/dfp_api/examples/v201705/user_team_association_service/get_all_user_team_associations.rb +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all user team associations. -require 'dfp_api' - -class GetAllUserTeamAssociations - - def self.run_example(dfp) - user_team_association_service = - dfp.service(:UserTeamAssociationService, :v201705) - - # Create a statement to select user team associations. - statement = DfpApi::FilterStatement.new() - - # Retrieve a small amount of user team associations at a time, paging - # through until all user team associations have been retrieved. - total_result_set_size = 0; - begin - page = user_team_association_service.get_user_team_associations_by_statement( - statement.toStatement()) - - # Print out some information for each user team association. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user_team_association, index| - puts "%d) User team association with team id %d and user id %d was found." % [ - index + statement.offset, - user_team_association[:team_id], - user_team_association[:user_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of user team associations: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetAllUserTeamAssociations.main() -end diff --git a/dfp_api/examples/v201705/user_team_association_service/get_user_team_associations_for_user.rb b/dfp_api/examples/v201705/user_team_association_service/get_user_team_associations_for_user.rb deleted file mode 100755 index 2f581525d..000000000 --- a/dfp_api/examples/v201705/user_team_association_service/get_user_team_associations_for_user.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets all user team associations (i.e. teams) for a given user. -require 'dfp_api' - -class GetUserTeamAssociationsForUser - - USER_ID = 'INSERT_USER_ID_HERE'; - - def self.run_example(dfp, user_id) - user_team_association_service = - dfp.service(:UserTeamAssociationService, :v201705) - - # Create a statement to select user team associations. - query = 'WHERE userId = :userId' - values = [ - { - :key => 'userId', - :value => { - :xsi_type => 'NumberValue', - :value => user_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of user team associations at a time, paging - # through until all user team associations have been retrieved. - total_result_set_size = 0; - begin - page = user_team_association_service.get_user_team_associations_by_statement( - statement.toStatement()) - - # Print out some information for each user team association. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user_team_association, index| - puts "%d) User team association with user ID %d and team ID %d was found." % [ - index + statement.offset, - user_team_association[:user_id], - user_team_association[:team_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of user team associations: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp, USER_ID.to_i) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetUserTeamAssociationsForUser.main() -end diff --git a/dfp_api/examples/v201705/workflow_request_service/get_workflow_approval_requests.rb b/dfp_api/examples/v201705/workflow_request_service/get_workflow_approval_requests.rb deleted file mode 100755 index 966c664d6..000000000 --- a/dfp_api/examples/v201705/workflow_request_service/get_workflow_approval_requests.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets workflow approval requests. Workflow approval requests must be approved or rejected for a workflow to finish. -require 'dfp_api' - -class GetWorkflowApprovalRequests - - def self.run_example(dfp) - workflow_request_service = - dfp.service(:WorkflowRequestService, :v201705) - - # Create a statement to select workflow requests. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'WORKFLOW_APPROVAL_REQUEST' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of workflow requests at a time, paging - # through until all workflow requests have been retrieved. - total_result_set_size = 0; - begin - page = workflow_request_service.get_workflow_requests_by_statement( - statement.toStatement()) - - # Print out some information for each workflow request. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |workflow_request, index| - puts "%d) Workflow request with ID %d, entity type '%s', and entity ID %d was found." % [ - index + statement.offset, - workflow_request[:id], - workflow_request[:entity_type], - workflow_request[:entity_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of workflow requests: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetWorkflowApprovalRequests.main() -end diff --git a/dfp_api/examples/v201705/workflow_request_service/get_workflow_external_condition_requests.rb b/dfp_api/examples/v201705/workflow_request_service/get_workflow_external_condition_requests.rb deleted file mode 100755 index 23f5449f3..000000000 --- a/dfp_api/examples/v201705/workflow_request_service/get_workflow_external_condition_requests.rb +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.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. -# -# This example gets workflow external condition requests. Workflow external condition requests must be triggered or skipped for a workflow to finish. -require 'dfp_api' - -class GetWorkflowExternalConditionRequests - - def self.run_example(dfp) - workflow_request_service = - dfp.service(:WorkflowRequestService, :v201705) - - # Create a statement to select workflow requests. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'WORKFLOW_EXTERNAL_CONDITION_REQUEST' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) - - # Retrieve a small amount of workflow requests at a time, paging - # through until all workflow requests have been retrieved. - total_result_set_size = 0; - begin - page = workflow_request_service.get_workflow_requests_by_statement( - statement.toStatement()) - - # Print out some information for each workflow request. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |workflow_request, index| - puts "%d) Workflow request with ID %d, entity type '%s', and entity ID %d was found." % [ - index + statement.offset, - workflow_request[:id], - workflow_request[:entity_type], - workflow_request[:entity_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] - - puts 'Total number of workflow requests: %d' % - total_result_set_size - end - - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - begin - run_example(dfp) - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end - end -end - -if __FILE__ == $0 - GetWorkflowExternalConditionRequests.main() -end diff --git a/dfp_api/examples/v201711/activity_group_service/create_activity_groups.rb b/dfp_api/examples/v201711/activity_group_service/create_activity_groups.rb index a33144000..47591fcbf 100755 --- a/dfp_api/examples/v201711/activity_group_service/create_activity_groups.rb +++ b/dfp_api/examples/v201711/activity_group_service/create_activity_groups.rb @@ -21,23 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_activity_groups() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_activity_groups(dfp, advertiser_company_id) # Get the ActivityGroupService. activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - # Set the ID of the advertiser company this activity group is associated - # with. - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'; - # Create a short-term activity group. short_term_activity_group = { :name => 'Short-term activity group', @@ -56,11 +43,12 @@ def create_activity_groups() # Create the activity groups on the server. return_activity_groups = activity_group_service.create_activity_groups([ - short_term_activity_group, long_term_activity_group]) + short_term_activity_group, long_term_activity_group + ]) - if return_activity_groups + if return_activity_groups.to_a.size > 0 return_activity_groups.each do |activity_group| - puts "An activity group with ID: %d and name: %s was created." % + puts 'An activity group with ID %d and name "%s" was created.' % [activity_group[:id], activity_group[:name]] end else @@ -69,8 +57,18 @@ def create_activity_groups() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_activity_groups() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + create_activity_groups(dfp, advertiser_company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/activity_group_service/get_active_activity_groups.rb b/dfp_api/examples/v201711/activity_group_service/get_active_activity_groups.rb index c33b10066..d2151dd9b 100755 --- a/dfp_api/examples/v201711/activity_group_service/get_active_activity_groups.rb +++ b/dfp_api/examples/v201711/activity_group_service/get_active_activity_groups.rb @@ -17,81 +17,71 @@ # limitations under the License. # # This example gets all active activity groups. -require 'dfp_api' -class GetActiveActivityGroups +require 'dfp_api' - def self.run_example(dfp) - activity_group_service = - dfp.service(:ActivityGroupService, :v201711) +def get_active_activity_groups(dfp) + activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - # Create a statement to select activity groups. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select activity groups. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end - # Retrieve a small amount of activity groups at a time, paging - # through until all activity groups have been retrieved. - total_result_set_size = 0; - begin - page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) + # Retrieve a small amount of activity groups at a time, paging + # through until all activity groups have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get activity groups by statement. + page = activity_group_service.get_activity_groups_by_statement( + statement.to_statement() + ) - # Print out some information for each activity group. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity_group, index| - puts "%d) Activity group with ID %d and name '%s' was found." % [ - index + statement.offset, - activity_group[:id], - activity_group[:name] - ] - end + # Print out some information for each activity group. + unless page[:results].nil? + page[:results].each_with_index do |activity_group, index| + puts '%d) Activity group with ID %d and name "%s" was found.' % [ + index + statement.offset, + activity_group[:id], + activity_group[:name] + ] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of activity groups: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activity groups: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_active_activity_groups(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActiveActivityGroups.main() -end diff --git a/dfp_api/examples/v201711/activity_group_service/get_all_activity_groups.rb b/dfp_api/examples/v201711/activity_group_service/get_all_activity_groups.rb index f4cbfd5c2..fa584b4bc 100755 --- a/dfp_api/examples/v201711/activity_group_service/get_all_activity_groups.rb +++ b/dfp_api/examples/v201711/activity_group_service/get_all_activity_groups.rb @@ -19,69 +19,64 @@ # This example gets all activity groups. require 'dfp_api' -class GetAllActivityGroups +def get_all_activity_groups(dfp) + activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - def self.run_example(dfp) - activity_group_service = - dfp.service(:ActivityGroupService, :v201711) + # Create a statement to select activity groups. + statement = dfp.new_statement_builder() - # Create a statement to select activity groups. - statement = DfpApi::FilterStatement.new() + # Retrieve a small amount of activity groups at a time, paging + # through until all activity groups have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_group_service.get_activity_groups_by_statement( + statement.to_statement() + ) - # Retrieve a small amount of activity groups at a time, paging - # through until all activity groups have been retrieved. - total_result_set_size = 0; - begin - page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) - - # Print out some information for each activity group. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity_group, index| - puts "%d) Activity group with ID %d and name '%s' was found." % [ - index + statement.offset, - activity_group[:id], - activity_group[:name] - ] - end + # Print out some information for each activity group. + unless page[:results].nil? + page[:results].each_with_index do |activity_group, index| + puts '%d) Activity group with ID %d and name "%s" was found.' % [ + index + statement.offset, + activity_group[:id], + activity_group[:name] + ] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of activity groups: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activity groups: %d' % page[:total_result_set_size] +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_activity_groups(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllActivityGroups.main() -end diff --git a/dfp_api/examples/v201711/activity_group_service/update_activity_groups.rb b/dfp_api/examples/v201711/activity_group_service/update_activity_groups.rb index 954b77c3d..8971ee112 100755 --- a/dfp_api/examples/v201711/activity_group_service/update_activity_groups.rb +++ b/dfp_api/examples/v201711/activity_group_service/update_activity_groups.rb @@ -21,38 +21,21 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_activity_groups() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_activity_groups(dfp, advertiser_company_id, activity_group_id) # Get the ActivityGroupService. activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - # Set the ID of the activity group and the company to update it with. - activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' - # Create statement to select a single activity group. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => activity_group_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', activity_group_id) + end page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? # Get the activity groups. activity_groups = page[:results] @@ -66,15 +49,26 @@ def update_activity_groups() activity_groups) return_activity_groups.each do |updates_activity_group| - puts "Activity group with ID: %d and name: %s was updated." % + puts 'Activity group with ID %d and name "%s" was updated.' % [updates_activity_group[:id], updates_activity_group[:name]] end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_activity_groups() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' + update_activity_groups(dfp, advertiser_company_id, activity_group_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/activity_service/create_activities.rb b/dfp_api/examples/v201711/activity_service/create_activities.rb index 6ea0a800d..66d6b1788 100755 --- a/dfp_api/examples/v201711/activity_service/create_activities.rb +++ b/dfp_api/examples/v201711/activity_service/create_activities.rb @@ -21,22 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_activities() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_activities(dfp, activity_group_id) # Get the ActivityService. activity_service = dfp.service(:ActivityService, API_VERSION) - # Set the ID of the activity group this activity is associated with. - activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE'; - # Create a daily visits activity. daily_visits_activity = { :name => 'Activity', @@ -53,21 +41,32 @@ def create_activities() # Create the activities on the server. return_activities = activity_service.create_activities([ - daily_visits_activity, custom_activity]) + daily_visits_activity, custom_activity + ]) - if return_activities + if return_activities.to_a.size > 0 return_activities.each do |activity| - puts "An activity with ID: %d, name: %s and type: %s was created." % + puts 'An activity with ID %d, name "%s", and type "%s" was created.' % [activity[:id], activity[:name], activity[:type]] end else - raise 'No activities were created.' + puts 'No activities were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_activities() + activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' + create_activities(dfp, activity_group_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/activity_service/get_active_activities.rb b/dfp_api/examples/v201711/activity_service/get_active_activities.rb index 8e581e7af..a090c3105 100755 --- a/dfp_api/examples/v201711/activity_service/get_active_activities.rb +++ b/dfp_api/examples/v201711/activity_service/get_active_activities.rb @@ -19,80 +19,66 @@ # This example gets all active activities. require 'dfp_api' -class GetActiveActivities +def get_active_activities(dfp) + # Get the ActivityService. + activity_service = dfp.service(:ActivityService, API_VERSION) - def self.run_example(dfp) - activity_service = - dfp.service(:ActivityService, :v201711) - - # Create a statement to select activities. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select activities. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end - # Retrieve a small amount of activities at a time, paging - # through until all activities have been retrieved. - total_result_set_size = 0; - begin - page = activity_service.get_activities_by_statement( - statement.toStatement()) + # Retrieve a small amount of activities at a time, paging + # through until all activities have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_service.get_activities_by_statement( + statement.to_statement() + ) - # Print out some information for each activity. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity, index| - puts "%d) Activity with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - activity[:id], - activity[:name], - activity[:type] - ] - end + # Print out some information for each activity. + unless page[:results].nil? + page[:results].each_with_index do |activity, index| + puts '%d) Activity with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, activity[:id], activity[:name], + activity[:type]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of activities: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of activities: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_active_activities(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActiveActivities.main() -end diff --git a/dfp_api/examples/v201711/activity_service/get_all_activities.rb b/dfp_api/examples/v201711/activity_service/get_all_activities.rb index ce6d7d29e..f752535ee 100755 --- a/dfp_api/examples/v201711/activity_service/get_all_activities.rb +++ b/dfp_api/examples/v201711/activity_service/get_all_activities.rb @@ -19,69 +19,62 @@ # This example gets all activities. require 'dfp_api' -class GetAllActivities +def get_all_activities(dfp) + # Get the ActivityService. + activity_service = dfp.service(:ActivityService, API_VERSION) - def self.run_example(dfp) - activity_service = - dfp.service(:ActivityService, :v201711) + # Create a statement to select activities. + statement = dfp.new_statement_builder() - # Create a statement to select activities. - statement = DfpApi::FilterStatement.new() + # Retrieve a small amount of activities at a time, paging + # through until all activities have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_service.get_activities_by_statement( + statement.to_statement() + ) - # Retrieve a small amount of activities at a time, paging - # through until all activities have been retrieved. - total_result_set_size = 0; - begin - page = activity_service.get_activities_by_statement( - statement.toStatement()) - - # Print out some information for each activity. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |activity, index| - puts "%d) Activity with ID %d and name '%s' was found." % [ - index + statement.offset, - activity[:id], - activity[:name] - ] - end + # Print out some information for each activity. + unless page[:results].nil? + page[:results].each_with_index do |activity, index| + puts '%d) Activity with ID %d and name "%s" was found.' % + [index + statement.offset, activity[:id], activity[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of activities: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activities: %d' % page[:total_result_set_size] +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_activities(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllActivities.main() -end diff --git a/dfp_api/examples/v201711/activity_service/update_activities.rb b/dfp_api/examples/v201711/activity_service/update_activities.rb index 4412333e0..eec7090b9 100755 --- a/dfp_api/examples/v201711/activity_service/update_activities.rb +++ b/dfp_api/examples/v201711/activity_service/update_activities.rb @@ -21,36 +21,20 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_activities() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_activities(dfp, activity_id) # Get the ActivityService. activity_service = dfp.service(:ActivityService, API_VERSION) - # Set the ID of the activity to update. - activity_id = 'INSERT_ACTIVITY_ID_HERE' - # Create statement to select a single activity. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => activity_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', activity_id) + end - page = activity_service.get_activities_by_statement(statement.toStatement()) + # Get the activities by statement. + page = activity_service.get_activities_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? # Get the activities. activities = page[:results] @@ -63,20 +47,30 @@ def update_activities() return_activities = activity_service.update_activities(activities) # Display results. - if return_activities + if return_activities.to_a.size > 0 return_activities.each do |updated_activity| - puts "Activity with ID: %d and name: %s was updated." % + puts 'Activity with ID %d and name "%s" was updated.' % [updated_activity[:id], updated_activity[:name]] end else - raise 'No activities were updated.' + puts 'No activities were updated.' end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_activities() + activity_id = 'INSERT_ACTIVITY_ID_HERE' + update_activities(dfp, activity_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/audience_segment_service/create_audience_segments.rb b/dfp_api/examples/v201711/audience_segment_service/create_audience_segments.rb index 110ff4868..a17a2846f 100755 --- a/dfp_api/examples/v201711/audience_segment_service/create_audience_segments.rb +++ b/dfp_api/examples/v201711/audience_segment_service/create_audience_segments.rb @@ -21,20 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the AudienceSegmentService. +def create_audience_segments(dfp, custom_targeting_key_id, + custom_targeting_value_id) + # Get the AudienceSegmentService and the NetworkService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the root ad unit ID used to target the whole site. @@ -78,23 +68,33 @@ def create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) # Create the audience segment on the server. return_segments = audience_segment_service.create_audience_segments([segment]) - if return_segments + if return_segments.to_a.size > 0 return_segments.each do |segment| - puts ("An audience segment with ID: %d, name: '%s' and type: '%s' was " + - "created.") % [segment[:id], segment[:name], segment[:type]] + puts ('An audience segment with ID %d, name "%s", and type "%s" was ' + + 'created.') % [segment[:id], segment[:name], segment[:type]] end else - raise 'No audience segments were created.' + puts 'No audience segments were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # Set the IDs of the custom criteria to target. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE' - custom_targeting_value_id = 'INSERT_CUSTOM_TARGETING_VALUE_ID_HERE' - - create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + custom_targeting_value_id = 'INSERT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i + create_audience_segments( + dfp, custom_targeting_key_id, custom_targeting_value_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/audience_segment_service/get_all_audience_segments.rb b/dfp_api/examples/v201711/audience_segment_service/get_all_audience_segments.rb index 7b8f3a25f..9f9096d24 100755 --- a/dfp_api/examples/v201711/audience_segment_service/get_all_audience_segments.rb +++ b/dfp_api/examples/v201711/audience_segment_service/get_all_audience_segments.rb @@ -17,72 +17,66 @@ # limitations under the License. # # This example gets all audience segments. -require 'dfp_api' -class GetAllAudienceSegments +require 'dfp_api' - def self.run_example(dfp) - audience_segment_service = - dfp.service(:AudienceSegmentService, :v201711) +def get_all_audience_segments(dfp) + audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - # Create a statement to select audience segments. - statement = DfpApi::FilterStatement.new() + # Create a statement to select audience segments. + statement = dfp.new_statement_builder() - # Retrieve a small amount of audience segments at a time, paging - # through until all audience segments have been retrieved. - total_result_set_size = 0; - begin - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get audience segments by statement. + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) - # Print out some information for each audience segment. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |audience_segment, index| - puts "%d) Audience segment with ID %d, name '%s', and size %d was found." % [ - index + statement.offset, - audience_segment[:id], - audience_segment[:name], - audience_segment[:size] - ] - end + # Print out some information for each audience segment. + unless page[:results].nil? + page[:results].each_with_index do |audience_segment, index| + puts ('%d) Audience segment with ID %d, name "%s", and size %d was ' + + 'found.') % [index + statement.offset, audience_segment[:id], + audience_segment[:name], audience_segment[:size]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of audience segments: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of audience segments: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_audience_segments(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllAudienceSegments.main() -end diff --git a/dfp_api/examples/v201711/audience_segment_service/get_first_party_audience_segments.rb b/dfp_api/examples/v201711/audience_segment_service/get_first_party_audience_segments.rb index 2cf0d56e0..3e444203e 100755 --- a/dfp_api/examples/v201711/audience_segment_service/get_first_party_audience_segments.rb +++ b/dfp_api/examples/v201711/audience_segment_service/get_first_party_audience_segments.rb @@ -17,82 +17,68 @@ # limitations under the License. # # This example gets all first party audience segments. -require 'dfp_api' -class GetFirstPartyAudienceSegments +require 'dfp_api' - def self.run_example(dfp) - audience_segment_service = - dfp.service(:AudienceSegmentService, :v201711) +def get_first_party_audience_segments(dfp) + audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - # Create a statement to select audience segments. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'FIRST_PARTY' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select audience segments. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'FIRST_PARTY') + end - # Retrieve a small amount of audience segments at a time, paging - # through until all audience segments have been retrieved. - total_result_set_size = 0; - begin - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) - # Print out some information for each audience segment. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |audience_segment, index| - puts "%d) Audience segment with ID %d, name '%s', and size %d was found." % [ - index + statement.offset, - audience_segment[:id], - audience_segment[:name], - audience_segment[:size] - ] - end + # Print out some information for each audience segment. + if page[:results] + page[:results].each_with_index do |audience_segment, index| + puts ('%d) Audience segment with ID %d, name "%s", and size %d was ' + + 'found.') % [index + statement.offset, audience_segment[:id], + audience_segment[:name], audience_segment[:size]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of audience segments: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of audience segments: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_first_party_audience_segments(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetFirstPartyAudienceSegments.main() -end diff --git a/dfp_api/examples/v201711/audience_segment_service/populate_first_party_audience_segments.rb b/dfp_api/examples/v201711/audience_segment_service/populate_first_party_audience_segments.rb index b6c9b5015..abcfc9426 100755 --- a/dfp_api/examples/v201711/audience_segment_service/populate_first_party_audience_segments.rb +++ b/dfp_api/examples/v201711/audience_segment_service/populate_first_party_audience_segments.rb @@ -21,65 +21,65 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def populate_first_party_audience_segments(audience_segment_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def populate_first_party_audience_segments(dfp, audience_segment_id) # Get the AudienceSegmentService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - # Statement parts to help build a statement to select first party audience - # segment for an ID. - statement = DfpApi::FilterStatement.new( - 'WHERE type = :type AND id = :audience_segment_id ORDER BY id ASC', - [ - {:key => 'type', - :value => {:value => 'FIRST_PARTY', :xsi_type => 'TextValue'}}, - {:key => 'audience_segment_id', - :value => {:value => audience_segment_id, :xsi_type => 'TextValue'}}, - ], - 1 - ) + # Create a statement to select first party audience segment for an ID. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type AND id = :audience_segment_id' + sb.with_bind_variable('type', 'FIRST_PARTY') + sb.with_bind_variable('audience_segment_id', audience_segment_id) + end - # Get audience segments by statement. - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get audience segments by statement. + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) - if page[:results] - page[:results].each do |segment| - puts "First party audience segment ID: %d, name: '%s' will be populated" % - [segment[:id], segment[:name]] + unless page[:results].nil? + page[:results].each do |segment| + puts ('First party audience segment with ID %d and name "%s" will be ' + + 'populated.') % [segment[:id], segment[:name]] + end - # Perform action. - result = audience_segment_service.perform_audience_segment_action( - {:xsi_type => 'PopulateAudienceSegments'}, - {:query => statement.toStatement()}) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Display results. - if result and result[:num_changes] > 0 - puts 'Number of audience segments populated: %d.' % result[:num_changes] - else - puts 'No audience segments were populated.' - end - end + # Perform action. + result = audience_segment_service.perform_audience_segment_action( + {:xsi_type => 'PopulateAudienceSegments'}, + {:query => statement.to_statement()} + ) + + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of audience segments populated: %d.' % result[:num_changes] else - puts 'No first party audience segments found to populate.' + puts 'No audience segments were populated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # Audience segment ID to populate. audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE' - populate_first_party_audience_segments(audience_segment_id) + populate_first_party_audience_segments(dfp, audience_segment_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/audience_segment_service/update_audience_segments.rb b/dfp_api/examples/v201711/audience_segment_service/update_audience_segments.rb index cca4ef7ad..cad306393 100755 --- a/dfp_api/examples/v201711/audience_segment_service/update_audience_segments.rb +++ b/dfp_api/examples/v201711/audience_segment_service/update_audience_segments.rb @@ -22,59 +22,49 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_audience_segments() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the ID of the first party audience segment to update. - audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE' - +def update_audience_segments(dfp, audience_segment_id) # Get the AudienceSegmentService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) # Create statement text to select the audience segment to update. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :segment_id ORDER BY id ASC', - [ - {:key => 'segment_id', - :value => {:value => audience_segment_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) - - # Get audience segments by statement. - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :audience_segment_id' + sb.with_bind_variable('audience_segment_id', audience_segment_id) + sb.limit = 1 + end - if page[:results] - audience_segments = page[:results] + # Get the audience segment. + response = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) + raise 'No audience segments to update.' if response[:results].to_a.empty? + audience_segment = page[:results].first - # Create a local set of audience segments than need to be updated. - audience_segments.each do |audience_segment| - audience_segment[:membership_expiration_days] = 180 - end + # Change the membership expiration days after which a user's cookie will be + # removed from the audience segment due to inactivity. + audience_segment[:membership_expiration_days] = 180 - # Update the audience segments on the server. - return_audience_segments = - audience_segment_service.update_audience_segments(audience_segments) - return_audience_segments.each do |audience_segment| - puts 'Audience segment ID: %d was updated' % audience_segment[:id] - end - else - puts 'No audience segments found to update.' + # Update the audience segment on the server. + updated_audience_segments = + audience_segment_service.update_audience_segments([audience_segment]) + updated_audience_segments.each do |audience_segment| + puts 'Audience segment with ID %d was updated' % audience_segment[:id] end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_audience_segments() + audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE'.to_i + update_audience_segments(dfp, audience_segment_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/base_rate_service/get_all_base_rates.rb b/dfp_api/examples/v201711/base_rate_service/get_all_base_rates.rb index 98a12c5e1..4145ef632 100755 --- a/dfp_api/examples/v201711/base_rate_service/get_all_base_rates.rb +++ b/dfp_api/examples/v201711/base_rate_service/get_all_base_rates.rb @@ -19,70 +19,62 @@ # This example gets all base rates. require 'dfp_api' -class GetAllBaseRates +def get_all_base_rates(dfp) + base_rate_service = dfp.service(:BaseRateService, API_VERSION) - def self.run_example(dfp) - base_rate_service = - dfp.service(:BaseRateService, :v201711) + # Create a statement to select base rates. + statement = dfp.new_statement_builder() - # Create a statement to select base rates. - statement = DfpApi::FilterStatement.new() + # Retrieve a small amount of base rates at a time, paging + # through until all base rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = base_rate_service.get_base_rates_by_statement( + statement.to_statement() + ) - # Retrieve a small amount of base rates at a time, paging - # through until all base rates have been retrieved. - total_result_set_size = 0; - begin - page = base_rate_service.get_base_rates_by_statement( - statement.toStatement()) - - # Print out some information for each base rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |base_rate, index| - puts "%d) Base rate with ID %d, type '%s', and rate card ID %d was found." % [ - index + statement.offset, - base_rate[:id], - base_rate[:xsi_type], - base_rate[:rate_card_id] - ] - end + # Print out some information for each base rate. + unless page[:results].nil? + page[:results].each_with_index do |base_rate, index| + puts ('%d) Base rate with ID %d, type "%s" and rate card ID %d was ' + + 'found.') % [index + statement.offset, base_rate[:id], + base_rate[:xsi_type], base_rate[:rate_card_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of base rates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of base rates: %d' % page[:total_result_set_size] +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_base_rates(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllBaseRates.main() -end diff --git a/dfp_api/examples/v201711/base_rate_service/get_base_rates_for_rate_card.rb b/dfp_api/examples/v201711/base_rate_service/get_base_rates_for_rate_card.rb index 951f5864d..666b6d1c3 100755 --- a/dfp_api/examples/v201711/base_rate_service/get_base_rates_for_rate_card.rb +++ b/dfp_api/examples/v201711/base_rate_service/get_base_rates_for_rate_card.rb @@ -19,82 +19,67 @@ # This example gets all base rates belonging to a rate card. require 'dfp_api' -class GetBaseRatesForRateCard +def get_base_rates_for_rate_card(dfp, rate_card_id) + base_rate_service = dfp.service(:BaseRateService, API_VERSION) - RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE'; + # Create a statement to select base rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'rateCardId = :rate_card_id' + sb.with_bind_variable('rate_card_id', rate_card_id) + end - def self.run_example(dfp, rate_card_id) - base_rate_service = - dfp.service(:BaseRateService, :v201711) + # Retrieve a small amount of base rates at a time, paging + # through until all base rates have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the base rates by statement. + page = base_rate_service.get_base_rates_by_statement( + statement.to_statement() + ) - # Create a statement to select base rates. - query = 'WHERE rateCardId = :rateCardId' - values = [ - { - :key => 'rateCardId', - :value => { - :xsi_type => 'NumberValue', - :value => rate_card_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each base rate. + unless page[:results].nil? + page[:results].each_with_index do |base_rate, index| + puts ('%d) Base rate with ID %d, type "%s", and rate card ID %d was ' + + 'found.' % [index + statement.offset, base_rate[:id], + base_rate[:xsi_type], base_rate[:rate_card_id]] + end + end - # Retrieve a small amount of base rates at a time, paging - # through until all base rates have been retrieved. - total_result_set_size = 0; - begin - page = base_rate_service.get_base_rates_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each base rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |base_rate, index| - puts "%d) Base rate with ID %d, type '%s', and rate card ID %d was found." % [ - index + statement.offset, - base_rate[:id], - base_rate[:xsi_type], - base_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of base rates: %d' % page[:total_result_set_size] +end - puts 'Total number of base rates: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, RATE_CARD_ID.to_i) + begin + rate_card_id = 'INSERT_RATE_CARD_ID_HERE'.to_i + get_base_rates_for_rate_card(dfp, rate_card_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetBaseRatesForRateCard.main() -end diff --git a/dfp_api/examples/v201711/cdn_configuration_service/create_cdn_configurations.rb b/dfp_api/examples/v201711/cdn_configuration_service/create_cdn_configurations.rb index 3222abc3e..55e2b4563 100755 --- a/dfp_api/examples/v201711/cdn_configuration_service/create_cdn_configurations.rb +++ b/dfp_api/examples/v201711/cdn_configuration_service/create_cdn_configurations.rb @@ -21,16 +21,7 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_cdn_configurations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_cdn_configurations(dfp) # Get the CdnConfigurationService. cdn_configuration_service = dfp.service(:CdnConfigurationService, API_VERSION) @@ -82,21 +73,31 @@ def create_cdn_configurations() # Create the CDN configurations on the server. cdn_configurations = cdn_configuration_service.create_cdn_configurations([ - cdn_config_without_security_policy, cdn_config_with_security_policy]) + cdn_config_without_security_policy, cdn_config_with_security_policy + ]) - if cdn_configurations + if cdn_configurations.to_a.size > 0 cdn_configurations.each do |cdn_configuration| - puts "A CDN configuration with ID: %d and name: %s was created." % + puts 'A CDN configuration with ID %d and name "%s" was created.' % [cdn_configuration[:id], cdn_configuration[:name]] end else - raise 'No CDN configurations were created.' + puts 'No CDN configurations were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_cdn_configurations() + create_cdn_configurations(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/cdn_configuration_service/get_all_cdn_configurations.rb b/dfp_api/examples/v201711/cdn_configuration_service/get_all_cdn_configurations.rb index 61a219aaf..b7c42cf1b 100755 --- a/dfp_api/examples/v201711/cdn_configuration_service/get_all_cdn_configurations.rb +++ b/dfp_api/examples/v201711/cdn_configuration_service/get_all_cdn_configurations.rb @@ -20,49 +20,50 @@ require 'dfp_api' -API_VERSION = :v201711 - -def get_all_cdn_configurations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_all_cdn_configurations(dfp) # Get the CdnConfigurationService. cdn_configuration_service = dfp.service(:CdnConfigurationService, API_VERSION) # Create a statement to select CDN configurations. - statement = DfpApi::FilterStatement.new() + statement = dfp.new_statement_builder() # Retrieve a small number of CDN configurations at a time, paging # through until all CDN configuration objects have been retrieved. - total_result_set_size = 0; + page = {:total_result_set_size => 0} begin + # Get the CDN configurations by statement. page = cdn_configuration_service.get_cdn_configurations_by_statement( - statement.toStatement()) + statement.to_statement() + ) # Print out some information for each CDN configuration. - if page[:results] - total_result_set_size = page[:total_result_set_size] + unless page[:results].nil? page[:results].each_with_index do |cdn_configuration, index| - puts "%d) CDN configuration with ID %d and name '%s' was found." % [ - index + statement.offset, - cdn_configuration[:id], - cdn_configuration[:name] - ] + puts '%d) CDN configuration with ID %d and name "%s" was found.' % + [index + statement.offset, cdn_configuration[:id], + cdn_configuration[:name]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts 'Total number of CDN configurations: %d' % total_result_set_size + puts 'Total number of CDN configurations: %d' % page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_all_cdn_configurations() + get_all_cdn_configurations(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/common/error_handling.rb b/dfp_api/examples/v201711/common/error_handling.rb index 7b54707e0..3a828a5fd 100755 --- a/dfp_api/examples/v201711/common/error_handling.rb +++ b/dfp_api/examples/v201711/common/error_handling.rb @@ -20,16 +20,7 @@ require 'dfp_api' -API_VERSION = :v201711 - -def produce_api_error() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def produce_api_error(dfp) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) @@ -39,15 +30,25 @@ def produce_api_error() # Execute request and get the response, this should raise an exception. user = user_service.update_user(user) - # Output retrieved data. - puts "User ID: %d, name: %s, email: %s" % + # Output retrieved data. (This code will not actually be executed, since the + # call to update_user raises an exception.) + puts 'User ID: %d, name: %s, email: %s' % [user[:id], user[:name], user[:email]] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # This function should produce an exception for demo. - produce_api_error() + produce_api_error(dfp) # One of two kinds of exception might occur, general HTTP error like 403 or # 404 and DFP API error defined in WSDL and described in documentation. diff --git a/dfp_api/examples/v201711/common/oauth2_jwt_handling.rb b/dfp_api/examples/v201711/common/oauth2_jwt_handling.rb index c432205a7..d79c0c0d9 100755 --- a/dfp_api/examples/v201711/common/oauth2_jwt_handling.rb +++ b/dfp_api/examples/v201711/common/oauth2_jwt_handling.rb @@ -25,17 +25,7 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def oauth2_jwt_handling() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def oauth2_jwt_handling(dfp) # Option 1: provide key filename as authentication -> oauth2_keyfile in the # configuration file. No additional code is necessary. # To provide a file name at runtime, use authorize: @@ -54,32 +44,43 @@ def oauth2_jwt_handling() user_service = dfp.service(:UserService, API_VERSION) # Create a statement to select all users. - statement = DfpApi::FilterStatement.new('ORDER BY id ASC') + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end # Define initial values. + page = {:total_result_set_size => 0} begin # Get users by statement. - page = user_service.get_users_by_statement( - statement.toStatement()) + page = user_service.get_users_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |user, index| - puts "%d) User ID: %d, name: %s, email: %s" % + puts '%d) User ID: %d, name: %s, email: %s' % [index + statement.offset, user[:id], user[:name], user[:email]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer - if page.include?(:total_result_set_size) - puts "Total number of users: %d" % page[:total_result_set_size] - end + puts 'Total number of users: %d' % page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - oauth2_jwt_handling() + oauth2_jwt_handling(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/common/setup_oauth2.rb b/dfp_api/examples/v201711/common/setup_oauth2.rb index e3aa4e6ae..d9d11425e 100755 --- a/dfp_api/examples/v201711/common/setup_oauth2.rb +++ b/dfp_api/examples/v201711/common/setup_oauth2.rb @@ -21,31 +21,21 @@ require 'dfp_api' -API_VERSION = :v201711 - -def setup_oauth2() - # DfpApi::Api will read a config file from ENV['HOME']/dfp_api.yml - # when called without parameters. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def setup_oauth2(dfp) # You can call authorize explicitly to obtain the access token. Otherwise, it # will be invoked automatically on the first API call. # There are two ways to provide verification code, first one is via the block: token = dfp.authorize() do |auth_url| - puts "Hit Auth error, please navigate to URL:\n\t%s" % auth_url + puts 'Hit Auth error, please navigate to URL:\n\t%s' % auth_url print 'log in and type the verification code: ' verification_code = gets.chomp verification_code end - if token - print "\nWould you like to update your dfp_api.yml to save " + - "OAuth2 credentials? (y/N): " + unless token.nil? + print '\nWould you like to update your dfp_api.yml to save ' + + 'OAuth2 credentials? (y/N): ' response = gets.chomp - if ('y'.casecmp(response) == 0) or ('yes'.casecmp(response) == 0) + if ('y'.casecmp(response) == 0) || ('yes'.casecmp(response) == 0) dfp.save_oauth2_token(token) puts 'OAuth2 token is now saved to ~/dfp_api.yml and will be ' + 'automatically used by the library.' @@ -64,8 +54,16 @@ def setup_oauth2() end if __FILE__ == $0 + # DfpApi::Api will read a config file from ENV['HOME']/dfp_api.yml + # when called without parameters. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - setup_oauth2() + setup_oauth2(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/company_service/create_companies.rb b/dfp_api/examples/v201711/company_service/create_companies.rb index 461d5d0df..9d29ccdb5 100755 --- a/dfp_api/examples/v201711/company_service/create_companies.rb +++ b/dfp_api/examples/v201711/company_service/create_companies.rb @@ -19,46 +19,45 @@ # This example creates new companies. To determine which companies exist, run # get_all_companies.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of companies to create. -ITEM_COUNT = 5 - -def create_companies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_companies(dfp, number_of_companies_to_create) # Get the CompanyService. company_service = dfp.service(:CompanyService, API_VERSION) # Create an array to store local company objects. - companies = (1..ITEM_COUNT).map do |index| - {:name => "Advertiser #%d-%d" % [Time.new.to_f * 1000, index], - :type => 'ADVERTISER'} + companies = (1..number_of_companies_to_create).map do + {:name => 'Advertiser %d' % SecureRandom.uuid(), :type => 'ADVERTISER'} end # Create the companies on the server. - return_companies = company_service.create_companies(companies) + created_companies = company_service.create_companies(companies) - if return_companies - return_companies.each do |company| - puts "Company with ID: %d, name: %s and type: %s was created." % + if created_companies.to_a.size > 0 + created_companies.each do |company| + puts 'Company with ID %d, name "%s", and type "%s" was created.' % [company[:id], company[:name], company[:type]] end else - raise 'No companies were created.' + puts 'No companies were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_companies() + number_of_companies_to_create = 5 + create_companies(dfp, number_of_companies_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/company_service/get_advertisers.rb b/dfp_api/examples/v201711/company_service/get_advertisers.rb index 1cdac3623..2e95a2aa9 100755 --- a/dfp_api/examples/v201711/company_service/get_advertisers.rb +++ b/dfp_api/examples/v201711/company_service/get_advertisers.rb @@ -19,80 +19,66 @@ # This example gets all companies that are advertisers. require 'dfp_api' -class GetAdvertisers +def get_advertisers(dfp) + company_service = dfp.service(:CompanyService, API_VERSION) - def self.run_example(dfp) - company_service = - dfp.service(:CompanyService, :v201711) - - # Create a statement to select companies. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'ADVERTISER' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select companies. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'ADVERTISER') + end - # Retrieve a small amount of companies at a time, paging - # through until all companies have been retrieved. - total_result_set_size = 0; - begin - page = company_service.get_companies_by_statement( - statement.toStatement()) + # Retrieve a small amount of companies at a time, paging + # through until all companies have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the companies by statement. + page = company_service.get_companies_by_statement( + statement.to_statement() + ) - # Print out some information for each company. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |company, index| - puts "%d) Company with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - company[:id], - company[:name], - company[:type] - ] - end + # Print out some information for each company. + unless page[:results].nil? + page[:results].each_with_index do |company, index| + puts '%d) Company with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, company[:id], company[:name], + company[:type]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of companies: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of companies: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_advertisers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAdvertisers.main() -end diff --git a/dfp_api/examples/v201711/company_service/get_all_companies.rb b/dfp_api/examples/v201711/company_service/get_all_companies.rb index 4022ee536..7cccff32a 100755 --- a/dfp_api/examples/v201711/company_service/get_all_companies.rb +++ b/dfp_api/examples/v201711/company_service/get_all_companies.rb @@ -19,70 +19,62 @@ # This example gets all companies. require 'dfp_api' -class GetAllCompanies +def get_all_companies(dfp) + company_service = dfp.service(:CompanyService, API_VERSION) - def self.run_example(dfp) - company_service = - dfp.service(:CompanyService, :v201711) + # Create a statement to select companies. + statement = dfp.new_statement_builder() - # Create a statement to select companies. - statement = DfpApi::FilterStatement.new() + # Retrieve a small amount of companies at a time, paging + # through until all companies have been retrieved. + page = {:total_result_set_size => 0} + begin + page = company_service.get_companies_by_statement( + statement.to_statement() + ) - # Retrieve a small amount of companies at a time, paging - # through until all companies have been retrieved. - total_result_set_size = 0; - begin - page = company_service.get_companies_by_statement( - statement.toStatement()) - - # Print out some information for each company. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |company, index| - puts "%d) Company with ID %d, name '%s', and type '%s' was found." % [ - index + statement.offset, - company[:id], - company[:name], - company[:type] - ] - end + # Print out some information for each company. + unless page[:results].nil? + page[:results].each_with_index do |company, index| + puts '%d) Company with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, company[:id], company[:name], + company[:type]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of companies: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of companies: %d' % page[:total_result_set_size] +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_companies(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCompanies.main() -end diff --git a/dfp_api/examples/v201711/company_service/update_companies.rb b/dfp_api/examples/v201711/company_service/update_companies.rb index 2492546e6..e57c0090c 100755 --- a/dfp_api/examples/v201711/company_service/update_companies.rb +++ b/dfp_api/examples/v201711/company_service/update_companies.rb @@ -16,75 +16,58 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates the names of all companies that are advertisers by -# appending "LLC." up to the first 500. To determine which companies exist, run +# This example updates a company's name. To determine which companies exist, run # get_all_companies.rb. require 'dfp_api' - -API_VERSION = :v201711 - -def update_companies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_companies(dfp, company_id) # Get the CompanyService. company_service = dfp.service(:CompanyService, API_VERSION) - # Specify a single company to fetch. - company_id = 'INSERT_COMPANY_ID_HERE' - # Create a statement to only select a single company. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :company_id ORDER BY id ASC', - [ - {:key => 'company_id', - :value => {:value => company_id, :xsi_type => 'NumberValue'} - } - ], - 1 - ) - - # Get companies by statement. - page = company_service.get_companies_by_statement(statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :company_id' + sb.with_bind_variable('company_id', company_id) + sb.limit = 1 + end - if page[:results] - companies = page[:results] + # Get the company by statement. + response = company_service.get_companies_by_statement( + statement.to_statement() + ) + raise 'No companies found to update.' if response[:results].to_a.empty? + company = response[:results].first - # Update each local company object by appending ' LLC.' to its name. - companies.each do |company| - company[:name] += ' LLC.' - # Workaround for issue #94. - [:address, :email, :fax_phone, :primary_phone, - :external_id, :comment].each do |item| - company[item] = "" if company[item].nil? - end - end + # Update company object by appending ' LLC.' to its name. + company[:name] += ' LLC.' - # Update the companies on the server. - return_companies = company_service.update_companies(companies) + # Update the companies on the server. + updated_companies = company_service.update_companies([company]) - if return_companies - return_companies.each do |company| - puts "A company with ID [%d], name: %s and type %s was updated." % - [company[:id], company[:name], company[:type]] - end - else - raise 'No companies were updated.' + if updated_companies.to_a.size > 0 + updated_companies.each do |company| + puts 'A company with ID %d, name "%s", and type "%s" was updated.' % + [company[:id], company[:name], company[:type]] end else - puts 'No companies found to update.' + puts 'No companies were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_companies() + company_id = 'INSERT_COMPANY_ID_HERE'.to_i + update_companies(dfp, company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/contact_service/create_contacts.rb b/dfp_api/examples/v201711/contact_service/create_contacts.rb index c8a956eb4..ed7ea11f2 100755 --- a/dfp_api/examples/v201711/contact_service/create_contacts.rb +++ b/dfp_api/examples/v201711/contact_service/create_contacts.rb @@ -21,25 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_contacts() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_contacts(dfp, advertiser_company_id, agency_company_id) # Get the ContactService. contact_service = dfp.service(:ContactService, API_VERSION) - # Set the ID of the advertiser company this contact is associated with. - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' - - # Set the ID of the agency company this contact is associated with. - agency_company_id = 'INSERT_AGENCY_COMPANY_ID_HERE' - # Create an advertiser contact. advertiser_contact = { :name => 'Mr. Advertiser', @@ -55,23 +40,34 @@ def create_contacts() } # Create the contacts on the server. - return_contacts = contact_service.create_contacts([advertiser_contact, + created_contacts = contact_service.create_contacts([advertiser_contact, agency_contact]) # Display results. - if return_contacts - return_contacts.each do |contact| - puts 'A contact with ID %d and name %s was created.' % [contact[:id], + if created_contacts.to_a.size > 0 + created_contacts.each do |contact| + puts 'A contact with ID %d and name "%s" was created.' % [contact[:id], contact[:name]] end else - raise 'No contacts were created.' + puts 'No contacts were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_contacts() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + agency_company_id = 'INSERT_AGENCY_COMPANY_ID_HERE' + create_contacts(dfp, advertiser_company_id, agency_company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/contact_service/get_all_contacts.rb b/dfp_api/examples/v201711/contact_service/get_all_contacts.rb index a91bedbd8..df6b920dd 100755 --- a/dfp_api/examples/v201711/contact_service/get_all_contacts.rb +++ b/dfp_api/examples/v201711/contact_service/get_all_contacts.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all contacts. -require 'dfp_api' -class GetAllContacts +require 'dfp_api' - def self.run_example(dfp) - contact_service = - dfp.service(:ContactService, :v201711) +def get_all_contacts(dfp) + contact_service = dfp.service(:ContactService, API_VERSION) - # Create a statement to select contacts. - statement = DfpApi::FilterStatement.new() + # Create a statement to select contacts. + statement = dfp.new_statement_builder() - # Retrieve a small amount of contacts at a time, paging - # through until all contacts have been retrieved. - total_result_set_size = 0; - begin - page = contact_service.get_contacts_by_statement( - statement.toStatement()) + # Retrieve a small amount of contacts at a time, paging + # through until all contacts have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the contacts by statement. + page = contact_service.get_contacts_by_statement( + statement.to_statement() + ) - # Print out some information for each contact. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |contact, index| - puts "%d) Contact with ID %d and name '%s' was found." % [ - index + statement.offset, - contact[:id], - contact[:name] - ] - end + # Print out some information for each contact. + unless page[:results].nil? + page[:results].each_with_index do |contact, index| + puts '%d) Contact with ID %d and name "%s" was found.' % + [index + statement.offset, contact[:id], contact[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of contacts: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of contacts: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_contacts(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllContacts.main() -end diff --git a/dfp_api/examples/v201711/contact_service/get_uninvited_contacts.rb b/dfp_api/examples/v201711/contact_service/get_uninvited_contacts.rb index bd95d1bb6..8b69f1e5c 100755 --- a/dfp_api/examples/v201711/contact_service/get_uninvited_contacts.rb +++ b/dfp_api/examples/v201711/contact_service/get_uninvited_contacts.rb @@ -17,81 +17,68 @@ # limitations under the License. # # This example gets all contacts that aren't invited yet. -require 'dfp_api' -class GetUninvitedContacts +require 'dfp_api' - def self.run_example(dfp) - contact_service = - dfp.service(:ContactService, :v201711) +def get_uninvited_contacts(dfp) + contact_service = dfp.service(:ContactService, API_VERSION) - # Create a statement to select contacts. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'UNINVITED' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select contacts. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'UNINVITED') + end - # Retrieve a small amount of contacts at a time, paging - # through until all contacts have been retrieved. - total_result_set_size = 0; - begin - page = contact_service.get_contacts_by_statement( - statement.toStatement()) + # Retrieve a small amount of contacts at a time, paging + # through until all contacts have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the contacts by statement. + page = contact_service.get_contacts_by_statement( + statement.to_statement() + ) - # Print out some information for each contact. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |contact, index| - puts "%d) Contact with ID %d and name '%s' was found." % [ - index + statement.offset, - contact[:id], - contact[:name] - ] - end + # Print out some information for each contact. + unless page[:results].nil? + page[:results].each_with_index do |contact, index| + puts '%d) Contact with ID %d and name "%s" was found.' % + [index + statement.offset, contact[:id], contact[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of contacts: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of contacts: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_uninvited_contacts(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetUninvitedContacts.main() -end diff --git a/dfp_api/examples/v201711/contact_service/update_contacts.rb b/dfp_api/examples/v201711/contact_service/update_contacts.rb index d391a2ba2..f8836d981 100755 --- a/dfp_api/examples/v201711/contact_service/update_contacts.rb +++ b/dfp_api/examples/v201711/contact_service/update_contacts.rb @@ -16,67 +16,57 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates contact comments. To determine which contacts exist, +# This example updates a contact's address. To determine which contacts exist, # run get_all_contacts.rb. require 'dfp_api' - -API_VERSION = :v201711 - -def update_contacts() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_contacts(dfp, contact_id) # Get the ContactService. contact_service = dfp.service(:ContactService, API_VERSION) - contact_id = 'INSERT_CONTACT_ID_HERE'.to_i - # Create a statement to only select a single contact. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => contact_id, :xsi_type => 'NumberValue'}} - ], - 1 - } + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :contact_id' + sb.with_bind_variable('contact_id', contact_id) + sb.limit = 1 + end # Get contacts by statement. - page = contact_service.get_contacts_by_statement(statement.toStatement()) + response = contact_service.get_contacts_by_statement(statement.to_statement()) + raise 'No contacts found to update.' if response[:results].to_a.empty? + contact = response[:results].first - if page[:results] - contacts = page[:results] + # Update the address of the contact. + contact[:address] = '123 New Street, New York, NY, 10011' - contacts.each do |contact| - # Update the comment of the contact. - contact[:address] = '123 New Street, New York, NY, 10011' - end - - # Update the contact on the server. - return_contacts = contact_service.update_contacts([contact]) + # Update the contact on the server. + updated_contacts = contact_service.update_contacts([contact]) - # Display results. - if return_contacts - return_contacts.each do |updated_contact| - puts "Contact with ID: %d, name: %s and comment: '%s' was updated." % - [updated_contact[:id], updated_contact[:name], - updated_contact[:comment]] - end - else - raise 'No contacts were updated.' + # Display results. + if updated_contacts.to_a.size > 0 + updated_contacts.each do |contact| + puts 'Contact with ID %d, name: "%s", and address "%s" was updated.' % + [contact[:id], contact[:name], contact[:comment]] end + else + puts 'No contacts were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_contacts() + contact_id = 'INSERT_CONTACT_ID_HERE'.to_i + update_contacts(dfp, contact_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb index dc9f2de69..90d32e6a9 100755 --- a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb @@ -20,25 +20,14 @@ # # This feature is only available to DFP video publishers. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_content_metadata_key_hierarchies(dfp, hierarchy_level_one_key_id, + hierarchy_level_two_key_id) # Get the ContentMetadataKeyHierarchyService. cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Set the IDs of the custom targeting keys for the hierarchy. - hierarchy_level_one_key_id = 'INSERT_LEVEL_ONE_CUSTOM_TARGETING_KEY_ID_HERE' - hierarchy_level_two_key_id = 'INSERT_LEVEL_TWO_CUSTOM_TARGETING_KEY_ID_HERE' - hierarchy_level_1 = { :custom_targeting_key_id => hierarchy_level_own_key_id, :hierarchy_level => 1 @@ -52,27 +41,40 @@ def create_content_metadata_key_hierarchies() hierarchy_levels = [hierarchy_level_1, hierarchy_level_2] content_metadata_key_hierarchy = { - :name => 'Content Metadata Key Hierarchy #%d' % (Time.new.to_f * 1000), + :name => 'Content Metadata Key Hierarchy %d' % SecureRandom.uuid(), :hierarchy_levels => hierarchy_levels } # Create the content metadata key hierarchy on the server. content_metadata_key_hierarchies = cmkh_service.create_content_metadata_key_hierarchies( - [content_metadata_key_hierarchy]) + [content_metadata_key_hierarchy] + ) content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| - puts 'A content metadata key hierarchy with ID %d, name "%s", and %d ' + - 'levels was created.' % [ - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name], - content_metadata_key_hierarchy[:hierarchy_levels].length] + puts ('A content metadata key hierarchy with ID %d, name "%s", and %d ' + + 'levels was created.') % [content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name], + content_metadata_key_hierarchy[:hierarchy_levels].length] end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_content_metadata_key_hierarchies() + hierarchy_level_one_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + hierarchy_level_two_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + create_content_metadata_key_hierarchies( + dfp, hierarchy_level_one_key_id, hierarchy_level_two_key_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb index 934e7fdb0..868552550 100755 --- a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb @@ -22,66 +22,60 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def delete_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_content_metadata_key_hierarchies(dfp, + content_metadata_key_hierarchy_id) # Get the ContentMetadataKeyHierarchyService. cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Set the ID of the content metadata key hierarchy. - content_metadata_key_hierarchy_id = 'CONTENT_METADATA_KEY_HIERARCHY_ID' - # Create a statement to only select a single content metadata key hierarchy. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => content_metadata_key_hierarchy_id, - :xsi_type => 'NumberValue'}}, - ], - 1 - ) - - # Get content metadata key hierarchies by statement. - page = cmkh_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', content_metadata_key_hierarchy_id) + sb.limit = 1 + end - if page[:results] - content_metadata_key_hierarchy = page[:results].first + # Get content metadata key hierarchy to delete. + response = cmkh_service.get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) + if response[:results].to_a.empty? + raise 'No content metadata key hierarchy found to delete.' end + content_metadata_key_hierarchy = response[:results].first - if content_metadata_key_hierarchy - puts 'Content metadata key hierarchy with ID ' + - '"%d" will be deleted.' % content_metadata_key_hierarchy[:id] + puts 'Content metadata key hierarchy with ID %d will be deleted.' % + content_metadata_key_hierarchy[:id] - # Perform action. - result = cmkh_service.perform_content_metadata_key_hierarchy_action( - {:xsi_type => 'DeleteContentMetadataKeyHierarchy'}, - statement.toStatement()) + # Perform action. + result = cmkh_service.perform_content_metadata_key_hierarchy_action( + {:xsi_type => 'DeleteContentMetadataKeyHierarchy'}, + statement.to_statement() + ) - # Display results. - if result and result[:num_changes] > 0 - puts 'Number of content metadata key hierarchies deleted: %d' % - result[:num_changes] - else - puts 'No content metadata key hierarchies were deleted.' - end + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of content metadata key hierarchies deleted: %d' % + result[:num_changes] else - puts 'No content metadata key hierarchy found to delete.' + puts 'No content metadata key hierarchies were deleted.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_content_metadata_key_hierarchies() + content_metadata_key_hierarchy_id = 'CONTENT_METADATA_KEY_HIERARCHY_ID'.to_i + delete_content_metadata_key_hierarchies( + dfp, content_metadata_key_hierarchy_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb index 267a09103..45fc620f4 100755 --- a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb @@ -17,71 +17,71 @@ # limitations under the License. # # This example gets all content metadata key hierarchies. -require 'dfp_api' -class GetAllContentMetadataKeyHierarchies +require 'dfp_api' - def self.run_example(dfp) - content_metadata_key_hierarchy_service = - dfp.service(:ContentMetadataKeyHierarchyService, :v201711) +def get_all_content_metadata_key_hierarchies(dfp) + content_metadata_key_hierarchy_service = + dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Create a statement to select content metadata key hierarchies. - statement = DfpApi::FilterStatement.new() + # Create a statement to select content metadata key hierarchies. + statement = dfp.new_statement_builder() - # Retrieve a small amount of content metadata key hierarchies at a time, paging - # through until all content metadata key hierarchies have been retrieved. - total_result_set_size = 0; - begin - page = content_metadata_key_hierarchy_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) + # Retrieve a small amount of content metadata key hierarchies at a time, + # paging through until all content metadata key hierarchies have been + # retrieved. + page = {:total_result_set_size => 0} + begin + # Get the content metadata key hierarchies by statement. + page = content_metadata_key_hierarchy_service. + get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) - # Print out some information for each content metadata key hierarchy. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |content_metadata_key_hierarchy, index| - puts "%d) Content metadata key hierarchy with ID %d and name '%s' was found." % [ - index + statement.offset, - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name] - ] - end + # Print out some information for each content metadata key hierarchy. + unless page[:results].nil? + page[:results].each_with_index do |content_metadata_key_hierarchy, index| + puts ('%d) Content metadata key hierarchy with ID %d and name "%s" ' + + 'was found.') % [index + statement.offset, + content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of content metadata key hierarchies: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of content metadata key hierarchies: %d' % + page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_content_metadata_key_hierarchies(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllContentMetadataKeyHierarchies.main() -end diff --git a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb index 38bf3df85..9ef42c999 100755 --- a/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201711/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb @@ -22,75 +22,68 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_content_metadata_key_hierarchies(dfp, + content_metadata_key_hierarchy_id, custom_targeting_key_id) # Get the ContentMetadataKeyHierarchyService. cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Set the ID of the content metadata key hierarchy. - content_metadata_key_hierarchy_id = - 'INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE' - - # Set the ID of the custom targeting key to be added as a hierarchy level. - custom_targeting_key_id = "INSERT_CUSTOM_TARGETING_KEY_ID_HERE" - # Create a statement to only select a single content metadata key hierarchy. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => content_metadata_key_hierarchy_id, - :xsi_type => 'NumberValue'}}, - ], - 1 - } - - # Get content metadata key hierarchies by statement. - page = cmkh_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', content_metadata_key_hierarchy_id) + sb.limit = 1 + end - if page[:results] - content_metadata_key_hierarchy = page[:results].first + # Get content metadata key hierarchy to update by statement. + response = cmkh_service.get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) + if response[:results].to_a.empty? + raise 'No content metadata key hierarchy found to update.' + end + content_metadata_key_hierarchy = response[:results].first - # Update the content metadata key hierarchy by adding a hierarchy level. - hierarchy_levels = content_metadata_key_hierarchy[:hierarchy_levels] + # Update the content metadata key hierarchy by adding a hierarchy level. + hierarchy_levels = content_metadata_key_hierarchy[:hierarchy_levels] - hierarchy_level = { - :custom_targeting_key_id => custom_targeting_key_id, - :hierarchy_level => hierarchy_levels.length + 1 - } + hierarchy_level = { + :custom_targeting_key_id => custom_targeting_key_id, + :hierarchy_level => hierarchy_levels.length + 1 + } - content_metadata_key_hierarchy[:hierarchy_levels] = - hierarchy_levels.concat([hierarchy_level]) + content_metadata_key_hierarchy[:hierarchy_levels] = + hierarchy_levels.concat([hierarchy_level]) - # Update content metadata key hierarchy. - content_metadata_key_hierarchies = - cmkh_service.update_content_metadata_key_hierarchies( - [content_metadata_key_hierarchy]) + # Update the content metadata key hierarchy on the server. + content_metadata_key_hierarchies = + cmkh_service.update_content_metadata_key_hierarchies( + [content_metadata_key_hierarchy] + ) - content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| - puts 'Content metadata key hierarchy with ID ' + - '%d, name "%s" was updated.' % [ - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name]] - end - else - puts 'No content metadata key hierarchy found to update.' + content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| + puts 'Content metadata key hierarchy with ID %d, name "%s" was updated.' % + [content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name]] end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_content_metadata_key_hierarchies() + content_metadata_key_hierarchy_id = + 'INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE'.to_i + custom_targeting_key_id = "INSERT_CUSTOM_TARGETING_KEY_ID_HERE".to_i + update_content_metadata_key_hierarchies( + dfp, content_metadata_key_hierarchy_id, custom_targeting_key_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/content_service/get_all_content.rb b/dfp_api/examples/v201711/content_service/get_all_content.rb index 53a03be81..1cbaa951d 100755 --- a/dfp_api/examples/v201711/content_service/get_all_content.rb +++ b/dfp_api/examples/v201711/content_service/get_all_content.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all content. -require 'dfp_api' -class GetAllContent +require 'dfp_api' - def self.run_example(dfp) - content_service = - dfp.service(:ContentService, :v201711) +def get_all_content(dfp) + content_service = + dfp.service(:ContentService, API_VERSION) - # Create a statement to select content. - statement = DfpApi::FilterStatement.new() + # Create a statement to select content. + statement = dfp.new_statement_builder() - # Retrieve a small amount of content at a time, paging - # through until all content have been retrieved. - total_result_set_size = 0; - begin - page = content_service.get_content_by_statement( - statement.toStatement()) + # Retrieve a small amount of content at a time, paging + # through until all content have been retrieved. + page = {:total_result_set_size => 0} + begin + page = content_service.get_content_by_statement( + statement.to_statement() + ) - # Print out some information for each content. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |content, index| - puts "%d) Content with ID %d and name '%s' was found." % [ - index + statement.offset, - content[:id], - content[:name] - ] - end + # Print out some information for each content. + unless page[:results].nil? + page[:results].each_with_index do |content, index| + puts '%d) Content with ID %d and name "%s" was found.' % + [index + statement.offset, content[:id], content[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of content: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of content: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_content(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllContent.main() -end diff --git a/dfp_api/examples/v201711/creative_service/copy_image_creatives.rb b/dfp_api/examples/v201711/creative_service/copy_image_creatives.rb index dc117b87a..30b3df8fa 100755 --- a/dfp_api/examples/v201711/creative_service/copy_image_creatives.rb +++ b/dfp_api/examples/v201711/creative_service/copy_image_creatives.rb @@ -21,51 +21,30 @@ # creatives exist, run get_all_creatives.rb. require 'dfp_api' - require 'base64' -API_VERSION = :v201711 - -def copy_image_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def copy_image_creatives(dfp, image_creative_ids) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Create a list of creative ids to copy. - image_creative_ids = [ - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i - ] - # Create the statement to filter image creatives by ID. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s) AND creativeType = :creative_type" % - image_creative_ids.join(', '), - [ - {:key => 'creative_type', - :value => {:value => 'ImageCreative', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s) AND creativeType = :creative_type' % + image_creative_ids.join(', ') + sb.with_bind_variable('creative_type', 'ImageCreative') + end # Get creatives by statement. - page = creative_service.get_creatives_by_statement(statement.toStatement()) + page = creative_service.get_creatives_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 creatives = page[:results] # Copy each local creative object and change its name. new_creatives = creatives.map do |creative| new_creative = creative.dup() old_id = new_creative.delete(:id) - new_creative[:name] += " (Copy of %d)" % old_id + new_creative[:name] += ' (Copy of %d)' % old_id image_url = new_creative.delete(:image_url) new_creative[:image_byte_array] = Base64.encode64(AdsCommon::Http.get(image_url, dfp.config)) @@ -73,16 +52,16 @@ def copy_image_creatives() end # Create the creatives on the server. - return_creatives = creative_service.create_creatives(new_creatives) + created_creatives = creative_service.create_creatives(new_creatives) # Display copied creatives. - if return_creatives - return_creatives.each_with_index do |creative, index| - puts "A creative with ID [%d] was copied to ID [%d], name: %s" % + if created_creatives.to_a.size > 0 + created_creatives.each_with_index do |creative, index| + puts 'A creative with ID %d was copied to ID %d, named "%s".' % [creatives[index][:id], creative[:id], creative[:name]] end else - raise 'No creatives were copied.' + puts 'No creatives were copied.' end else puts 'No creatives found to copy.' @@ -90,8 +69,23 @@ def copy_image_creatives() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - copy_image_creatives() + image_creative_ids = [ + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i + ] + copy_image_creatives(dfp, image_creative_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_service/create_creative_from_template.rb b/dfp_api/examples/v201711/creative_service/create_creative_from_template.rb index 72c263a6a..f21ad0698 100755 --- a/dfp_api/examples/v201711/creative_service/create_creative_from_template.rb +++ b/dfp_api/examples/v201711/creative_service/create_creative_from_template.rb @@ -19,31 +19,16 @@ # This example creates a new template creative for a given advertiser. To # determine which companies are advertisers, run get_companies_by_statement.rb. # To determine which creatives already exist, run get_all_creatives.rb. To -# determine which creative templates run get_all_creative_templates.rb. +# determine which creative templates exist, run get_all_creative_templates.rb. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_creative_from_template() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creative_from_template(dfp, advertiser_id, creative_template_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - - # Use the image banner with optional third party tracking template. - creative_template_id = 10000680 - # Create the local custom creative object. creative = { :xsi_type => 'TemplateCreative', @@ -66,7 +51,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => image_data_base64, # Filenames must be unique. - :file_name => "image%d.jpg" % Time.new.to_i + :file_name => 'image_%d.jpg' % SecureRandom.uuid() } } @@ -95,7 +80,7 @@ def create_creative_from_template() target_window_variable_value = { :xsi_type => 'StringCreativeTemplateVariableValue', :unique_name => 'Targetwindow', - :value => '__blank' + :value => '_blank' } creative[:creative_template_variable_values] = [asset_variable_value, @@ -103,21 +88,34 @@ def create_creative_from_template() url_variable_value, target_window_variable_value] # Create the creatives on the server. - return_creative = creative_service.create_creatives([creative])[0] + created_creatives = creative_service.create_creatives([creative]) - if return_creative - puts(("Template creative with ID: %d, name: %s and type '%s' was " + - "created and can be previewed at: '%s'") % - [return_creative[:id], return_creative[:name], - return_creative[:creative_type], return_creative[:preview_url]]) + if created_creatives.to_a_size > 0 + created_creatives.each do |creative| + puts ('Template creative with ID %d, name "%s" and type "%s" was ' + + 'created and can be previewed at "%s"') % [creative[:id], + creative[:name], creative[:creative_type], creative[:preview_url]] + end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_from_template() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + # Use the image banner with optional third party tracking template. + creative_template_id = 10000680 + create_creative_from_template(dfp, advertiser_id, creative_template_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_service/create_creatives.rb b/dfp_api/examples/v201711/creative_service/create_creatives.rb index 76d0c9fc6..14bb6d94a 100755 --- a/dfp_api/examples/v201711/creative_service/create_creatives.rb +++ b/dfp_api/examples/v201711/creative_service/create_creatives.rb @@ -21,27 +21,13 @@ # determine which creatives already exist, run get_all_creatives.rb. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of creatives to create. -ITEM_COUNT = 5 - -def create_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creatives(dfp, advertiser_id, number_of_creatives_to_create) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Prepare image data for creative. image_url = 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' @@ -50,45 +36,55 @@ def create_creatives() size = {:width => 300, :height => 250} # Create an array to store local creative objects. - creatives = (1..ITEM_COUNT).map do |index| + creatives = (1..number_of_creatives_to_create).map do |index| { - :xsi_type => 'ImageCreative', - :name => "Image creative #%d-%d" % [index, (Time.new.to_f * 1000).to_i], - :advertiser_id => advertiser_id, - :destination_url => 'http://www.google.com', - :size => size, - :primary_image_asset => { - :file_name => 'image.jpg', - :asset_byte_array => image_data_base64, - :size => size - } + :xsi_type => 'ImageCreative', + :name => 'Image creative #%d - %d' % [index, SecureRandom.uuid()], + :advertiser_id => advertiser_id, + :destination_url => 'http://www.google.com', + :size => size, + :primary_image_asset => { + :file_name => 'image.jpg', + :asset_byte_array => image_data_base64, + :size => size + } } end # Create the creatives on the server. - return_creatives = creative_service.create_creatives(creatives) + created_creatives = creative_service.create_creatives(creatives) - if return_creatives - return_creatives.each do |creative| + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| if creative[:creative_type] == 'ImageCreative' - puts ("Image creative with ID: %d, name: %s, size: %dx%d was " + - "created and can be previewed at: [%s]") % - [creative[:id], creative[:name], - creative[:size][:width], creative[:size][:height], - creative[:preview_url]] + puts ('Image creative with ID %d, name "%s", and size %dx%d was ' + + 'created and can be previewed at "%s".') % [creative[:id], + creative[:name], creative[:size][:width], creative[:size][:height], + creative[:preview_url]] else - puts "Creative with ID: %d, name: %s and type: %s was created." % + puts 'Creative with ID: %d, name: %s and type: %s was created.' % [creative[:id], creative[:name], creative[:creative_type]] end end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creatives() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + number_of_creatives_to_create = 5 + create_creatives(dfp, advertiser_id, number_of_creatives_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_service/create_custom_creative.rb b/dfp_api/examples/v201711/creative_service/create_custom_creative.rb index 29e898568..6f4a7f171 100755 --- a/dfp_api/examples/v201711/creative_service/create_custom_creative.rb +++ b/dfp_api/examples/v201711/creative_service/create_custom_creative.rb @@ -23,25 +23,13 @@ # This feature is only available to DFP premium solution networks. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_custom_creative() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_creative(dfp, advertiser_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Prepare image data for creative. image_url = 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' @@ -50,40 +38,51 @@ def create_custom_creative() # Create an array to store local creative objects. custom_creative = { - :xsi_type => 'CustomCreative', - :name => 'Custom creative', - :advertiser_id => advertiser_id, - :destination_url => 'http://www.google.com', - :custom_creative_assets => [{ - :macro_name => 'IMAGE_ASSET', - :asset => { - :file_name => "image%d.jpg" % Time.new.to_i, - :asset_byte_array => image_data_base64 - } - }], - - # Set the HTML snippet using the custom creative asset macro. - :html_snippet => "" + - "
Click above for great deals!", - # Set the creative size. - :size => {:width => 300, :height => 250, :is_aspect_ratio => false} + :xsi_type => 'CustomCreative', + :name => 'Custom creative', + :advertiser_id => advertiser_id, + :destination_url => 'http://www.google.com', + :custom_creative_assets => [{ + :macro_name => 'IMAGE_ASSET', + :asset => { + :file_name => 'image_%d.jpg' % SecureRandom.uuid(), + :asset_byte_array => image_data_base64 + } + }], + # Set the HTML snippet using the custom creative asset macro. + :html_snippet => '' + + '
Click above for great ' + + 'deals!', + # Set the creative size. + :size => {:width => 300, :height => 250, :is_aspect_ratio => false} } # Create the creatives on the server. - return_creative = creative_service.create_creative(custom_creative) + created_creatives = creative_service.create_creative(custom_creative) - if return_creative - puts "Custom creative with ID: %d, name: '%s' and type: '%s' was created." % - [return_creative[:id], return_creative[:name], - return_creative[:creative_type]] + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| + puts ('Custom creative with ID %d, name "%s", and type "%s" was ' + + 'created.') % [creative[:id], creative[:name], + creative[:creative_type]] else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_creative() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + create_custom_creative(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_service/create_native_creative.rb b/dfp_api/examples/v201711/creative_service/create_native_creative.rb index 15994801a..5664733da 100755 --- a/dfp_api/examples/v201711/creative_service/create_native_creative.rb +++ b/dfp_api/examples/v201711/creative_service/create_native_creative.rb @@ -26,34 +26,22 @@ # https://play.google.com/store/apps/details?id=com.google.fpl.pie_noon&hl=en require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_creative_from_template() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_native_creative(dfp, advertiser_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Set the URLs of the application screenshot and the small application icon to # use and convert them to byte array strings. screenshot_url = 'https://lh4.ggpht.com/GIGNKdGHMEHFDw6TM2bgAUDKPQQRIReKZPq' + - 'EpMeEhZOPYnTdOQGaSpGSEZflIFs0iw=h300' + 'EpMeEhZOPYnTdOQGaSpGSEZflIFs0iw=h300' screenshot_data = AdsCommon::Http.get(screenshot_url, dfp.config) screenshot_data_base64 = Base64.encode64(screenshot_data) app_icon = 'https://lh6.ggpht.com/Jzvjne5CLs6fJ1MHF-XeuUfpABzl0YNMlp4' + - 'RpHnvPRCIj4--eTDwtyouwUDzVVekXw=w300') + 'RpHnvPRCIj4--eTDwtyouwUDzVVekXw=w300') app_icon_data = AdsCommon::Http.get(app_icon, dfp.config) app_icon_data_base64 = Base64.encode64(app_icon_data) @@ -63,12 +51,12 @@ def create_creative_from_template() # Create the local custom creative object. creative = { :xsi_type => 'TemplateCreative', - :name => "Native creative %d" % Time.new.to_i, + :name => 'Native creative - %d' % SecureRandom.uuid(), :advertiser_id => advertiser_id, :creative_template_id => creative_template_id, :size => {:width => 1, :height => 1, :is_aspect_ratio => false}, :destination_url => 'https://play.google.com/store/apps/details?id=' + - 'com.google.fpl.pie_noon' + 'com.google.fpl.pie_noon' } # Create the Image asset variable value. @@ -78,7 +66,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => screenshot_data_base64, # Filenames must be unique. - :file_name => "image%d.png" % Time.new.to_i + :file_name => 'image_%d.png' % SecureRandom.uuid() } } @@ -89,7 +77,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => app_icon_data_base64, # Filenames must be unique. - :file_name => "image%d.png" % Time.new.to_i + :file_name => 'image_%d.png' % SecureRandom.uuid() } } @@ -155,21 +143,32 @@ def create_creative_from_template() ] # Create the creatives on the server. - return_creative = creative_service.create_creatives([creative])[0] + created_creatives = creative_service.create_creatives([creative]) - if return_creative - puts(("Native creative with ID: %d and name: %s was " + - "created and can be previewed at: '%s'") % - [return_creative[:id], return_creative[:name], - return_creative[:preview_url]]) + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| + puts ('Native creative with ID %d and name "%s" was created and can be ' + + 'previewed at "%s".') % [creative[:id], creative[:name], + creative[:preview_url]] + end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_from_template() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + create_native_creative(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_service/get_all_creatives.rb b/dfp_api/examples/v201711/creative_service/get_all_creatives.rb index 882a823ac..9f5b21c52 100755 --- a/dfp_api/examples/v201711/creative_service/get_all_creatives.rb +++ b/dfp_api/examples/v201711/creative_service/get_all_creatives.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all creatives. -require 'dfp_api' -class GetAllCreatives +require 'dfp_api' - def self.run_example(dfp) - creative_service = - dfp.service(:CreativeService, :v201711) +def get_all_creatives(dfp) + # Get the CreativeService. + creative_service = dfp.service(:CreativeService, API_VERSION) - # Create a statement to select creatives. - statement = DfpApi::FilterStatement.new() + # Create a statement to select creatives. + statement = dfp.new_statement_builder() - # Retrieve a small amount of creatives at a time, paging - # through until all creatives have been retrieved. - total_result_set_size = 0; - begin - page = creative_service.get_creatives_by_statement( - statement.toStatement()) + # Retrieve a small amount of creatives at a time, paging + # through until all creatives have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_service.get_creatives_by_statement( + statement.to_statement() + ) - # Print out some information for each creative. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative, index| - puts "%d) Creative with ID %d and name '%s' was found." % [ - index + statement.offset, - creative[:id], - creative[:name] - ] - end + # Print out some information for each creative. + unless page[:results].nil? + page[:results].each_with_index do |creative, index| + puts '%d) Creative with ID %d and name "%s" was found.' % + [index + statement.offset, creative[:id], creative[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creatives: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of creatives: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_creatives(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCreatives.main() -end diff --git a/dfp_api/examples/v201711/creative_service/get_image_creatives.rb b/dfp_api/examples/v201711/creative_service/get_image_creatives.rb index 30b63ca01..79f9fc61f 100755 --- a/dfp_api/examples/v201711/creative_service/get_image_creatives.rb +++ b/dfp_api/examples/v201711/creative_service/get_image_creatives.rb @@ -17,81 +17,68 @@ # limitations under the License. # # This example gets all image creatives. -require 'dfp_api' -class GetImageCreatives +require 'dfp_api' - def self.run_example(dfp) - creative_service = - dfp.service(:CreativeService, :v201711) +def get_image_creatives(dfp) + # Get the CreativeService. + creative_service = dfp.service(:CreativeService, API_VERSION) - # Create a statement to select creatives. - query = 'WHERE creativeType = :creativeType' - values = [ - { - :key => 'creativeType', - :value => { - :xsi_type => 'TextValue', - :value => 'ImageCreative' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select creatives. + statement = dfp.new_statement_builder do |sb| + sb.where = 'creativeType = :creativeType' + sb.with_bind_variable('creativeType', 'ImageCreative') + end - # Retrieve a small amount of creatives at a time, paging - # through until all creatives have been retrieved. - total_result_set_size = 0; - begin - page = creative_service.get_creatives_by_statement( - statement.toStatement()) + # Retrieve a small amount of creatives at a time, paging + # through until all creatives have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_service.get_creatives_by_statement( + statement.to_statement() + ) - # Print out some information for each creative. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative, index| - puts "%d) Creative with ID %d and name '%s' was found." % [ - index + statement.offset, - creative[:id], - creative[:name] - ] - end + # Print out some information for each creative. + unless page[:results].nil? + page[:results].each_with_index do |creative, index| + puts '%d) Creative with ID %d and name "%s" was found.' % + [index + statement.offset, creative[:id], creative[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creatives: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creatives: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_image_creatives(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetImageCreatives.main() -end diff --git a/dfp_api/examples/v201711/creative_service/update_creatives.rb b/dfp_api/examples/v201711/creative_service/update_creatives.rb index 3f8bc03af..caa06f57d 100755 --- a/dfp_api/examples/v201711/creative_service/update_creatives.rb +++ b/dfp_api/examples/v201711/creative_service/update_creatives.rb @@ -21,63 +21,54 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_creatives(dfp, creative_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Specify creative ID to update. - creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i - # Create a statement to get first 500 image creatives. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => creative_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', creative_id) + sb.limit = 1 + end # Get creatives by statement. - page = creative_service.get_creatives_by_statement(statement.toStatement()) - - if page[:results] - creatives = page[:results] + response = creative_service.get_creatives_by_statement( + statement.to_statement() + ) + raise 'No creatives found to update.' if response[:results].to_a.empty? + creative = response[:results].first - # Update each local creative object by changing its destination URL. - creatives.each do |creative| - creative[:destination_url] = 'http://news.google.com' - end + # Update creative object by changing its destination URL. + creative[:destination_url] = 'http://news.google.com' - # Update the creatives on the server. - return_creatives = creative_service.update_creatives(creatives) + # Update the creative on the server. + updated_creatives = creative_service.update_creatives([creative]) - if return_creatives - return_creatives.each do |creative| - puts "Creative with ID: %d, name: %s and url: [%s] was updated." % - [creative[:id], creative[:name], creative[:destination_url]] - end - else - raise 'No creatives were updated.' + # Display the results. + if updated_creatives.to_a.size > 0 + updated_creatives.each do |creative| + puts 'Creative with ID %d, name "%s", and url "%s" was updated.' % + [creative[:id], creative[:name], creative[:destination_url]] end else - puts 'No creatives found to update.' + puts 'No creatives were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creatives() + creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i + update_creatives(dfp, creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_set_service/associate_creative_set_to_line_item.rb b/dfp_api/examples/v201711/creative_set_service/associate_creative_set_to_line_item.rb index 49b510957..58be7a39d 100755 --- a/dfp_api/examples/v201711/creative_set_service/associate_creative_set_to_line_item.rb +++ b/dfp_api/examples/v201711/creative_set_service/associate_creative_set_to_line_item.rb @@ -16,26 +16,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This code example creates a line item creative association for a creative -# set. To create creative sets, run create_creative_set.rb. To create creatives, -# run create_creatives.rb. To determine which LICAs exist, run get_all_licas.rb. +# This code example creates a line item creative association (LICA) for a +# creative set. To create creative sets, run create_creative_set.rb. To create +# creatives, run create_creatives.rb. To determine which LICAs exist, run +# get_all_licas.rb. require 'dfp_api' -API_VERSION = :v201711 - -def associate_creative_set_to_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the line item ID and creative set ID to associate. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i - +def associate_creative_set_to_line_item(dfp, line_item_id, creative_set_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) @@ -45,15 +33,32 @@ def associate_creative_set_to_line_item() } # Create the LICAs on the server. - return_lica = lica_service.create_line_item_creative_associations([lica]) + created_licas = lica_service.create_line_item_creative_associations([lica]) - puts 'A LICA with line item ID %d and creative set ID %d was created.' % - [return_lica[:line_item_id], return_lica[:creative_set_id]] + # Display the results. + if created_licas.to_a.size > 0 + created_licas.each do |lica| + puts 'A LICA with line item ID %d and creative set ID %d was created.' % + [lica[:line_item_id], lica[:creative_set_id]] + end + else + puts 'No LICAs were updated.' end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - associate_creative_set_to_line_item() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i + associate_creative_set_to_line_item(dfp, line_item_id, creative_set_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_set_service/create_creative_set.rb b/dfp_api/examples/v201711/creative_set_service/create_creative_set.rb index f201ca2a8..8d9ea2ab3 100755 --- a/dfp_api/examples/v201711/creative_set_service/create_creative_set.rb +++ b/dfp_api/examples/v201711/creative_set_service/create_creative_set.rb @@ -18,48 +18,48 @@ # # This code example creates a new creative set. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_creative_set() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i - companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i - +def create_creative_set(dfp, master_creative_id, companion_creative_id) # Get the CreativeSetService. creative_set_service = dfp.service(:CreativeSetService, API_VERSION) # Create an array to store local creative set object. creative_set = { - :name => 'Creative set #%d' % (Time.new.to_f * 1000), - :master_creative_id => master_creative_id, - :companion_creative_ids => [companion_creative_id] + :name => 'Creative set #%d' % SecureRandom.uuid(), + :master_creative_id => master_creative_id, + :companion_creative_ids => [companion_creative_id] } # Create the creative set on the server. - return_set = creative_set_service.create_creative_set(creative_set) + created_creative_set = creative_set_service.create_creative_set(creative_set) - if return_set - puts ('Creative set with ID: %d, master creative ID: %d and companion ' + - 'creative IDs: [%s] was created') % - [return_set[:id], return_set[:master_creative_id], - return_set[:companion_creative_ids].join(', ')] - else + if created_creative_set.nil? raise 'No creative set was created.' + else + puts ('Creative set with ID %d, master creative ID %d and companion ' + + 'creative IDs [%s] was created') % [created_creative_set[:id], + created_creative_set[:master_creative_id], + created_creative_set[:companion_creative_ids].join(', ')] end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_set() + master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i + companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i + create_creative_set(dfp, master_creative_id, companion_creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_set_service/get_all_creative_sets.rb b/dfp_api/examples/v201711/creative_set_service/get_all_creative_sets.rb index 4076bda71..a43934ad9 100755 --- a/dfp_api/examples/v201711/creative_set_service/get_all_creative_sets.rb +++ b/dfp_api/examples/v201711/creative_set_service/get_all_creative_sets.rb @@ -17,71 +17,64 @@ # limitations under the License. # # This example gets all creative sets. -require 'dfp_api' -class GetAllCreativeSets +require 'dfp_api' - def self.run_example(dfp) - creative_set_service = - dfp.service(:CreativeSetService, :v201711) +def get_all_creative_sets(dfp) + creative_set_service = dfp.service(:CreativeSetService, API_VERSION) - # Create a statement to select creative sets. - statement = DfpApi::FilterStatement.new() + # Create a statement to select creative sets. + statement = dfp.new_statement_builder() - # Retrieve a small amount of creative sets at a time, paging - # through until all creative sets have been retrieved. - total_result_set_size = 0; - begin - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) + # Retrieve a small amount of creative sets at a time, paging + # through until all creative sets have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) - # Print out some information for each creative set. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_set, index| - puts "%d) Creative set with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_set[:id], - creative_set[:name] - ] - end + # Print out some information for each creative set. + unless page[:results].nil? + page[:results].each_with_index do |creative_set, index| + puts '%d) Creative set with ID %d and name "%s" was found.' % + [index + statement.offset, creative_set[:id], creative_set[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creative sets: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of creative sets: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_creative_sets(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCreativeSets.main() -end diff --git a/dfp_api/examples/v201711/creative_set_service/get_creative_sets_for_master_creative.rb b/dfp_api/examples/v201711/creative_set_service/get_creative_sets_for_master_creative.rb index 1e72fcdff..d38f6d8f4 100755 --- a/dfp_api/examples/v201711/creative_set_service/get_creative_sets_for_master_creative.rb +++ b/dfp_api/examples/v201711/creative_set_service/get_creative_sets_for_master_creative.rb @@ -17,83 +17,68 @@ # limitations under the License. # # This example gets all creative sets for a master creative. + require 'dfp_api' -class GetCreativeSetsForMasterCreative +def get_creative_sets_for_master_creative(dfp, master_creative_id) + creative_set_service = dfp.service(:CreativeSetService, API_VERSION) - MASTER_CREATIVE_ID = 'INSERT_MASTER_CREATIVE_ID_HERE'; + # Create a statement to select creative sets. + statement = dfp.new_statement_builder do |sb| + sb.where = 'masterCreativeId = :mater_creative_id' + sb.with_bind_variable('master_creative_id', master_creative_id) + end - def self.run_example(dfp, master_creative_id) - creative_set_service = - dfp.service(:CreativeSetService, :v201711) + # Retrieve a small amount of creative sets at a time, paging + # through until all creative sets have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) - # Create a statement to select creative sets. - query = 'WHERE masterCreativeId = :masterCreativeId' - values = [ - { - :key => 'masterCreativeId', - :value => { - :xsi_type => 'NumberValue', - :value => master_creative_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each creative set. + unless page[:results].nil? + page[:results].each_with_index do |creative_set, index| + puts '%d) Creative set with ID %d and name "%s" was found.' % + [index + statement.offset, creative_set[:id], creative_set[:name]] + end + end - # Retrieve a small amount of creative sets at a time, paging - # through until all creative sets have been retrieved. - total_result_set_size = 0; - begin - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each creative set. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_set, index| - puts "%d) Creative set with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_set[:id], - creative_set[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of creative sets: %d' % page[:total_result_set_size] +end - puts 'Total number of creative sets: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, MASTER_CREATIVE_ID.to_i) + begin + master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i + get_creative_sets_for_master_creative(dfp, master_creative_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetCreativeSetsForMasterCreative.main() -end diff --git a/dfp_api/examples/v201711/creative_set_service/update_creative_sets.rb b/dfp_api/examples/v201711/creative_set_service/update_creative_sets.rb index 4978147c7..d9c0e818c 100755 --- a/dfp_api/examples/v201711/creative_set_service/update_creative_sets.rb +++ b/dfp_api/examples/v201711/creative_set_service/update_creative_sets.rb @@ -21,64 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_creative_sets() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the IDs of the creative set to get and companion creative ID to add. - creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i - companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i - +def update_creative_sets(dfp, creative_set_id, companion_creative_id) # Get the CreativeSetService. creative_set_service = dfp.service(:CreativeSetService, API_VERSION) # Create a statement to only select a single creative set. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id' - [ - {:key => 'id', - :value => {:value => creative_set_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :creative_set_id' + sb.with_bind_variable('creative_set_id', creative_set_id) + end # Get creative sets by statement. - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) - - if page[:results] - creative_sets = page[:results] + response = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) + raise 'No creative sets found to update.' if response[:results].to_a.empty? + creative_set = response[:results].first - creative_sets.each do |creative_set| - # Update the creative set locally. - creative_set[:companion_creative_ids] << companion_creative_id - end + # Update the creative set locally. + creative_set[:companion_creative_ids] << companion_creative_id - # Update the creative set on the server. - return_creative_set = creative_set_service.update_creative_set(creative_set) + # Update the creative set on the server. + updated_creative_sets = creative_set_service.update_creative_set(creative_set) - if return_creative_set - puts ('Creative set ID: %d, master creative ID: %d was updated with ' + - 'companion creative IDs: [%s]') % - [creative_set[:id], - creative_set[:master_creative_id], - creative_set[:companion_creative_ids].join(', ')] - else - raise 'No creative sets were updated.' + if updated_creative_sets.to_a.size > 0 + updated_creative_sets.each do |creative_set| + puts ('Creative set with ID %d and master creative ID: %d was updated ' + + 'with companion creative IDs [%s].') % [creative_set[:id], + creative_set[:master_creative_id], + creative_set[:companion_creative_ids].join(', ')] end + else + puts 'No creative sets were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creative_sets() + creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i + companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i + update_creative_sets(dfp, creative_set_id, companion_creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_template_service/get_all_creative_templates.rb b/dfp_api/examples/v201711/creative_template_service/get_all_creative_templates.rb index 40db462ad..39def44a7 100755 --- a/dfp_api/examples/v201711/creative_template_service/get_all_creative_templates.rb +++ b/dfp_api/examples/v201711/creative_template_service/get_all_creative_templates.rb @@ -19,69 +19,62 @@ # This example gets all creative templates. require 'dfp_api' -class GetAllCreativeTemplates +def get_all_creative_templates(dfp) + creative_template_service = dfp.service(:CreativeTemplateService, API_VERSION) - def self.run_example(dfp) - creative_template_service = - dfp.service(:CreativeTemplateService, :v201711) + # Create a statement to select creative templates. + statement = dfp.new_statement_builder() - # Create a statement to select creative templates. - statement = DfpApi::FilterStatement.new() + # Retrieve a small amount of creative templates at a time, paging + # through until all creative templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_template_service.get_creative_templates_by_statement( + statement.to_statement() + ) - # Retrieve a small amount of creative templates at a time, paging - # through until all creative templates have been retrieved. - total_result_set_size = 0; - begin - page = creative_template_service.get_creative_templates_by_statement( - statement.toStatement()) - - # Print out some information for each creative template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_template, index| - puts "%d) Creative template with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_template[:id], - creative_template[:name] - ] - end + # Print out some information for each creative template. + unless page[:results].nil? + page[:results].each_with_index do |creative_template, index| + puts '%d) Creative template with ID %d and name "%s" was found.' % + [index + statement.offset, creative_template[:id], + creative_template[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creative templates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative templates: %d' % page[:total_result_set_size] +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_creative_templates(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCreativeTemplates.main() -end diff --git a/dfp_api/examples/v201711/creative_template_service/get_system_defined_creative_templates.rb b/dfp_api/examples/v201711/creative_template_service/get_system_defined_creative_templates.rb index 80f5e1c62..dfeb52135 100755 --- a/dfp_api/examples/v201711/creative_template_service/get_system_defined_creative_templates.rb +++ b/dfp_api/examples/v201711/creative_template_service/get_system_defined_creative_templates.rb @@ -19,79 +19,65 @@ # This example gets all system defined creative templates. require 'dfp_api' -class GetSystemDefinedCreativeTemplates +def get_system_defined_creative_templates(dfp) + creative_template_service = dfp.service(:CreativeTemplateService, API_VERSION) - def self.run_example(dfp) - creative_template_service = - dfp.service(:CreativeTemplateService, :v201711) - - # Create a statement to select creative templates. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'SYSTEM_DEFINED' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select creative templates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'SYSTEM_DEFINED') + end - # Retrieve a small amount of creative templates at a time, paging - # through until all creative templates have been retrieved. - total_result_set_size = 0; - begin - page = creative_template_service.get_creative_templates_by_statement( - statement.toStatement()) + # Retrieve a small amount of creative templates at a time, paging + # through until all creative templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_template_service.get_creative_templates_by_statement( + statement.to_statement() + ) - # Print out some information for each creative template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_template, index| - puts "%d) Creative template with ID %d and name '%s' was found." % [ - index + statement.offset, - creative_template[:id], - creative_template[:name] - ] - end + # Print out some information for each creative template. + unless page[:results].nil? + page[:results].each_with_index do |creative_template, index| + puts '%d) Creative template with ID %d and name "%s" was found.' % + [index + statement.offset, creative_template[:id], + creative_template[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creative templates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of creative templates: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_system_defined_creative_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetSystemDefinedCreativeTemplates.main() -end diff --git a/dfp_api/examples/v201711/creative_wrapper_service/create_creative_wrappers.rb b/dfp_api/examples/v201711/creative_wrapper_service/create_creative_wrappers.rb index 1b3743949..dbcf7abce 100755 --- a/dfp_api/examples/v201711/creative_wrapper_service/create_creative_wrappers.rb +++ b/dfp_api/examples/v201711/creative_wrapper_service/create_creative_wrappers.rb @@ -24,22 +24,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creative_wrappers(dfp, label_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the creative wrapper label ID. - label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i - # Create creative wrapper objects. creative_wrapper = { # A label can only be associated with one creative wrapper. @@ -53,19 +41,29 @@ def create_creative_wrappers() return_creative_wrappers = creative_wrapper_service.create_creative_wrappers([creative_wrapper]) - if return_creative_wrappers + if return_creative_wrappers.to_a.size > 0 return_creative_wrappers.each do |creative_wrapper| - puts "Creative wrapper with ID: %d applying to label: %d was created." % - [creative_wrapper[:id], creative_wrapper[:label_id]] + puts ('Creative wrapper with ID %d applying to the label with ID %d ' + + 'was created.') % [creative_wrapper[:id], creative_wrapper[:label_id]] end else - raise 'No creative wrappers were created.' + puts 'No creative wrappers were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_wrappers() + label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i + create_creative_wrappers(dfp, label_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_wrapper_service/deactivate_creative_wrapper.rb b/dfp_api/examples/v201711/creative_wrapper_service/deactivate_creative_wrapper.rb index 6cf8b74e7..0136bda67 100755 --- a/dfp_api/examples/v201711/creative_wrapper_service/deactivate_creative_wrapper.rb +++ b/dfp_api/examples/v201711/creative_wrapper_service/deactivate_creative_wrapper.rb @@ -20,54 +20,37 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_creative_wrappers(dfp, label_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the ID of the label for the creative wrapper to deactivate. - label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i - # Create statement to select creative wrappers by label id and status. - statement = DfpApi::FilterStatement.new( - 'WHERE labelId = :label_id AND status = :status', - [ - { - :key => 'label_id', - :value => {:value => label_id, :xsi_type => 'NumberValue'} - }, - { - :key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'labelId = :label_id AND status = :status' + sb.with_bind_variable('label_id', label_id) + sb.with_bind_variable('status', 'ACTIVE') + end # Get creative wrappers by statement. page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + if page[:results].to_a.size > 0 page[:results].each do |creative_wrapper| - puts 'Creative wrapper ID: %d, label: %d will be deactivated.' % - [creative_wrapper[:id], creative_wrapper[:label_id]] + puts 'Creative wrapper with ID %d applying to the label with ID %d ' + + 'will be deactivated.' % [creative_wrapper[:id], + creative_wrapper[:label_id]] end # Perform action. result = creative_wrapper_service.perform_creative_wrapper_action( - {:xsi_type => 'DeactivateCreativeWrappers'}, statement.toStatement()) + {:xsi_type => 'DeactivateCreativeWrappers'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts 'Number of creative wrappers deactivated: %d' % result[:num_changes] else puts 'No creative wrappers were deactivated.' @@ -78,8 +61,18 @@ def deactivate_creative_wrappers() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_creative_wrappers() + label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i + deactivate_creative_wrappers(dfp, label_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/creative_wrapper_service/get_active_creative_wrappers.rb b/dfp_api/examples/v201711/creative_wrapper_service/get_active_creative_wrappers.rb index 9ceddf4d8..6f91bbeb4 100755 --- a/dfp_api/examples/v201711/creative_wrapper_service/get_active_creative_wrappers.rb +++ b/dfp_api/examples/v201711/creative_wrapper_service/get_active_creative_wrappers.rb @@ -17,81 +17,68 @@ # limitations under the License. # # This example gets all active creative wrappers. -require 'dfp_api' -class GetActiveCreativeWrappers +require 'dfp_api' - def self.run_example(dfp) - creative_wrapper_service = - dfp.service(:CreativeWrapperService, :v201711) +def get_active_creative_wrappers(dfp) + creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Create a statement to select creative wrappers. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select creative wrappers. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end - # Retrieve a small amount of creative wrappers at a time, paging - # through until all creative wrappers have been retrieved. - total_result_set_size = 0; - begin - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) + # Retrieve a small amount of creative wrappers at a time, paging + # through until all creative wrappers have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) - # Print out some information for each creative wrapper. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_wrapper, index| - puts "%d) Creative wrapper with ID %d and label ID %d was found." % [ - index + statement.offset, - creative_wrapper[:id], - creative_wrapper[:label_id] - ] - end + # Print out some information for each creative wrapper. + unless page[:results].nil? + page[:results].each_with_index do |creative_wrapper, index| + puts '%d) Creative wrapper with ID %d and label ID %d was found.' % + [index + statement.offset, creative_wrapper[:id], + creative_wrapper[:label_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creative wrappers: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative wrappers: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_active_creative_wrappers(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActiveCreativeWrappers.main() -end diff --git a/dfp_api/examples/v201711/creative_wrapper_service/get_all_creative_wrappers.rb b/dfp_api/examples/v201711/creative_wrapper_service/get_all_creative_wrappers.rb index 014a954ec..8c47b8d5a 100755 --- a/dfp_api/examples/v201711/creative_wrapper_service/get_all_creative_wrappers.rb +++ b/dfp_api/examples/v201711/creative_wrapper_service/get_all_creative_wrappers.rb @@ -17,71 +17,66 @@ # limitations under the License. # # This example gets all creative wrappers. -require 'dfp_api' -class GetAllCreativeWrappers +require 'dfp_api' - def self.run_example(dfp) - creative_wrapper_service = - dfp.service(:CreativeWrapperService, :v201711) +def get_all_creative_wrappers(dfp) + # Get the CreativeWrapperService. + creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Create a statement to select creative wrappers. - statement = DfpApi::FilterStatement.new() + # Create a statement to select creative wrappers. + statement = dfp.new_statement_builder() - # Retrieve a small amount of creative wrappers at a time, paging - # through until all creative wrappers have been retrieved. - total_result_set_size = 0; - begin - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) + # Retrieve a small amount of creative wrappers at a time, paging + # through until all creative wrappers have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) - # Print out some information for each creative wrapper. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |creative_wrapper, index| - puts "%d) Creative wrapper with ID %d and label ID %d was found." % [ - index + statement.offset, - creative_wrapper[:id], - creative_wrapper[:label_id] - ] - end + # Print out some information for each creative wrapper. + unless page[:results].nil? + page[:results].each_with_index do |creative_wrapper, index| + puts '%d) Creative wrapper with ID %d and label ID %d was found.' % + [index + statement.offset, creative_wrapper[:id], + creative_wrapper[:label_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of creative wrappers: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of creative wrappers: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_creative_wrappers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCreativeWrappers.main() -end diff --git a/dfp_api/examples/v201711/creative_wrapper_service/update_creative_wrappers.rb b/dfp_api/examples/v201711/creative_wrapper_service/update_creative_wrappers.rb index 351bb8a9d..3c38352fe 100755 --- a/dfp_api/examples/v201711/creative_wrapper_service/update_creative_wrappers.rb +++ b/dfp_api/examples/v201711/creative_wrapper_service/update_creative_wrappers.rb @@ -21,65 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_creative_wrappers(dfp, creative_wrapper_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the ID of the creative wrapper to get. - creative_wrapper_id = 'INSERT_CREATIVE_WRAPPER_ID_HERE'.to_i - # Create a statement to only select a single creative wrapper. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => creative_wrapper_id, :xsi_type => 'NumberValue'} - } - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :creative_wrapper_id' + sb.with_bind_variable('creative_wrapper_id', creative_wrapper_id) + sb.limit = 1 + end # Get creative wrappers by statement. - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) - - if page[:results] - creative_wrappers = page[:results] + response = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) + raise 'No creative wrapper found to update.' if response[:results].to_a.empty? + creative_wrapper = response[:results].first - creative_wrappers.each do |creative_wrapper| - # Update local creative wrapper object by changing its ordering. - creative_wrapper[:ordering] = 'OUTER' - end + # Update creative wrapper object by changing its ordering. + creative_wrapper[:ordering] = 'OUTER' - # Update the creative wrapper on the server. - return_creative_wrappers = - creative_wrapper_service.update_creative_wrappers([creative_wrapper]) + # Update the creative wrapper on the server. + updated_creative_wrappers = + creative_wrapper_service.update_creative_wrappers([creative_wrapper]) - if return_creative_wrappers - return_creative_wrappers.each do |creative_wrapper| - puts ("Creative wrapper ID: %d, label ID: %d was updated with order" + - " '%s'") % [creative_wrapper[:id], creative_wrapper[:label_id], - creative_wrapper[:ordering]] - end - else - puts 'No creative wrappers found to update.' + if updated_creative_wrappers.to_a.size > 0 + updated_creative_wrappers.each do |creative_wrapper| + puts ('Creative wrapper ID %d and label ID %d was updated with ordering' + + ' "%s"') % [creative_wrapper[:id], creative_wrapper[:label_id], + creative_wrapper[:ordering]] end + else + puts 'No creative wrappers found to update.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creative_wrappers() + creative_wrapper_id = 'INSERT_CREATIVE_WRAPPER_ID_HERE'.to_i + update_creative_wrappers(dfp, creative_wrapper_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_field_service/create_custom_field_options.rb b/dfp_api/examples/v201711/custom_field_service/create_custom_field_options.rb index 87a49950e..e23d71b90 100755 --- a/dfp_api/examples/v201711/custom_field_service/create_custom_field_options.rb +++ b/dfp_api/examples/v201711/custom_field_service/create_custom_field_options.rb @@ -23,22 +23,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_custom_field_options() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_field_options(dfp, custom_field_id) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Set the ID of the drop-down custom field to create options for. - custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i - # Create local custom field options. custom_field_options = [ { @@ -52,18 +40,31 @@ def create_custom_field_options() ] # Create the custom field options on the server. - return_custom_field_options = + created_custom_field_options = custom_field_service.create_custom_field_options(custom_field_options) - return_custom_field_options.each do |option| - puts "Custom field option with ID: %d and name: '%s' was created." % - [option[:id], option[:display_name]] - end + if created_custom_field_options.to_a.size > 0 + created_custom_field_options.each do |option| + puts 'Custom field option with ID %d and name "%s" was created.' % + [option[:id], option[:display_name]] + end + else + puts 'No custom field options were created.' end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_field_options() + custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i + create_custom_field_options(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_field_service/create_custom_fields.rb b/dfp_api/examples/v201711/custom_field_service/create_custom_fields.rb index ff277fb67..6a3b0635c 100755 --- a/dfp_api/examples/v201711/custom_field_service/create_custom_fields.rb +++ b/dfp_api/examples/v201711/custom_field_service/create_custom_fields.rb @@ -21,16 +21,7 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_fields(dfp) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) @@ -51,18 +42,31 @@ def create_custom_fields() ] # Create the custom fields on the server. - return_custom_fields = + created_custom_fields = custom_field_service.create_custom_fields(custom_fields) - return_custom_fields.each do |custom_field| - puts "Custom field with ID: %d and name: %s was created." % - [custom_field[:id], custom_field[:name]] + if created_custom_fields.to_a.size > 0 + created_custom_fields.each do |custom_field| + puts 'Custom field with ID %d and name "%s" was created.' % + [custom_field[:id], custom_field[:name]] + end + else + puts 'No custom fields were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_fields() + create_custom_fields(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_field_service/deactivate_all_line_item_custom_fields.rb b/dfp_api/examples/v201711/custom_field_service/deactivate_all_line_item_custom_fields.rb index 66588e9e9..d0b2af482 100755 --- a/dfp_api/examples/v201711/custom_field_service/deactivate_all_line_item_custom_fields.rb +++ b/dfp_api/examples/v201711/custom_field_service/deactivate_all_line_item_custom_fields.rb @@ -21,54 +21,46 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_all_line_item_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_all_line_item_custom_fields(dfp) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) # Create statement text to select active ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE entityType = :entity_type AND isActive = :is_active', - [ - {:key => 'entity_type', - :value => {:value => 'LINE_ITEM', :xsi_type => 'TextValue'}}, - {:key => 'is_active', - :value => {:value => true, :xsi_type => 'BooleanValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'entityType = :entity_type AND isActive = :is_active' + sb.with_bind_variable('entity_type', 'LINE_ITEM') + sb.with_bind_variable('is_active', true) + end begin # Get custom fields by statement. page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID: %d and name: '%s' will be deactivated" % + puts '%d) Custom field with ID %d and name "%s" will be deactivated.' % [index + statement.offset, custom_field[:id], custom_field[:name]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Update statement for action. - statement.toStatementForAction() + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_field_service.perform_custom_field_action( - {:xsi_type => 'DeactivateCustomFields'}, statement.toStatement()) + {:xsi_type => 'DeactivateCustomFields'}, statement.to_statement()) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of custom fields deactivated: %d" % result[:num_changes] else puts 'No custom fields were deactivated.' @@ -76,8 +68,17 @@ def deactivate_all_line_item_custom_fields() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_all_line_item_custom_fields() + deactivate_all_line_item_custom_fields(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_field_service/deactivate_custom_field.rb b/dfp_api/examples/v201711/custom_field_service/deactivate_custom_field.rb new file mode 100755 index 000000000..247fedb1a --- /dev/null +++ b/dfp_api/examples/v201711/custom_field_service/deactivate_custom_field.rb @@ -0,0 +1,76 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example deactivates a custom field. To determine which custom fields +# exist, run get_all_custom_fields.rb. + +require 'dfp_api' + +def deactivate_custom_field(dfp, custom_field_id) + # Get the CustomFieldService. + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) + + # Create statement to select the custom field. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + end + + # Deactivate the custom field on the server. + result = custom_field_service.perform_custom_field_action( + {:xsi_type => 'DeactivateCustomFields'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of custom fields deactivated: %d" % result[:num_changes] + else + puts 'No custom fields were deactivated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + custom_field_id = 'INSERT_custom_field_id'.to_i + deactivate_custom_field(dfp, custom_field_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/custom_field_service/get_all_custom_fields.rb b/dfp_api/examples/v201711/custom_field_service/get_all_custom_fields.rb index 3eebd0319..8bbb830ef 100755 --- a/dfp_api/examples/v201711/custom_field_service/get_all_custom_fields.rb +++ b/dfp_api/examples/v201711/custom_field_service/get_all_custom_fields.rb @@ -17,71 +17,64 @@ # limitations under the License. # # This example gets all custom fields. -require 'dfp_api' -class GetAllCustomFields +require 'dfp_api' - def self.run_example(dfp) - custom_field_service = - dfp.service(:CustomFieldService, :v201711) +def get_all_custom_fields(dfp) + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Create a statement to select custom fields. - statement = DfpApi::FilterStatement.new() + # Create a statement to select custom fields. + statement = dfp.new_statement_builder() - # Retrieve a small amount of custom fields at a time, paging - # through until all custom fields have been retrieved. - total_result_set_size = 0; - begin - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) + # Retrieve a small amount of custom fields at a time, paging + # through until all custom fields have been retrieved. + page = {:total_result_set_size => 0} + begin + page = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) - # Print out some information for each custom field. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID %d and name '%s' was found." % [ - index + statement.offset, - custom_field[:id], - custom_field[:name] - ] - end + # Print out some information for each custom field. + unless page[:results].nil? + page[:results].each_with_index do |custom_field, index| + puts '%d) Custom field with ID %d and name "%s" was found.' % + [index + statement.offset, custom_field[:id], custom_field[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of custom fields: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of custom fields: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_custom_fields(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllCustomFields.main() -end diff --git a/dfp_api/examples/v201711/custom_field_service/get_custom_fields_for_line_items.rb b/dfp_api/examples/v201711/custom_field_service/get_custom_fields_for_line_items.rb index 92948bfa6..cc56d73cb 100755 --- a/dfp_api/examples/v201711/custom_field_service/get_custom_fields_for_line_items.rb +++ b/dfp_api/examples/v201711/custom_field_service/get_custom_fields_for_line_items.rb @@ -17,81 +17,67 @@ # limitations under the License. # # This example gets all custom fields that can be applied to line items. -require 'dfp_api' -class GetCustomFieldsForLineItems +require 'dfp_api' - def self.run_example(dfp) - custom_field_service = - dfp.service(:CustomFieldService, :v201711) +def get_custom_fields_for_line_items(dfp) + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Create a statement to select custom fields. - query = 'WHERE entityType = :entityType' - values = [ - { - :key => 'entityType', - :value => { - :xsi_type => 'TextValue', - :value => 'LINE_ITEM' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select custom fields. + statement = dfp.new_statement_builder do |sb| + sb.where = 'entityType = :entity_type' + sb.with_bind_variable('entity_type', 'LINE_ITEM') + end - # Retrieve a small amount of custom fields at a time, paging - # through until all custom fields have been retrieved. - total_result_set_size = 0; - begin - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) + # Retrieve a small amount of custom fields at a time, paging + # through until all custom fields have been retrieved. + page = {:total_result_set_size => 0} + begin + page = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) - # Print out some information for each custom field. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID %d and name '%s' was found." % [ - index + statement.offset, - custom_field[:id], - custom_field[:name] - ] - end + # Print out some information for each custom field. + unless page[:results].nil? + page[:results].each_with_index do |custom_field, index| + puts '%d) Custom field with ID %d and name "%s" was found.' % + [index + statement.offset, custom_field[:id], custom_field[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of custom fields: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of custom fields: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_custom_fields_for_line_items(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetCustomFieldsForLineItems.main() -end diff --git a/dfp_api/examples/v201711/custom_field_service/set_line_item_custom_field_value.rb b/dfp_api/examples/v201711/custom_field_service/set_line_item_custom_field_value.rb index 0f391a7e6..754fcdd0d 100755 --- a/dfp_api/examples/v201711/custom_field_service/set_line_item_custom_field_value.rb +++ b/dfp_api/examples/v201711/custom_field_service/set_line_item_custom_field_value.rb @@ -23,86 +23,67 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def set_line_item_custom_field_value() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the CustomFieldService. +def set_line_item_custom_field_value(dfp, custom_field_id, + drop_down_custom_field_id, custom_field_option_id, line_item_id) + # Get the CustomFieldService and LineItemService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - - # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the custom fields, custom field option, and line item. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - drop_down_custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i - custom_field_option_id = 'INSERT_CUSTOM_FIELD_OPTION_ID_HERE'.to_i - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create a statement to only select a single custom field. - custom_field_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => custom_field_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + custom_field_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + sb.limit = 1 + end # Create a statement to only select a single drop down custom field. - drop_down_custom_field_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => drop_down_custom_field_id, - :xsi_type => 'NumberValue'}} - ], - 1 - ) + drop_down_custom_field_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :drop_down_custom_field_id' + sb.with_bind_variable( + 'drop_down_custom_field_id', drop_down_custom_field_id + ) + sb.limit = 1 + end # Create a statement to only select a single line item. - line_item_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + line_item_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.limit = 1 + end # Get custom fields by statement. custom_fields_page = custom_field_service.get_custom_fields_by_statement( - custom_field_statement.toStatement()) + custom_field_statement.to_statement() + ) # Get drop down custom fields by statement. - drop_down_custom_fields_page = ( + drop_down_custom_fields_page = custom_field_service.get_custom_fields_by_statement( - drop_down_custom_field_statement.toStatement())) + drop_down_custom_field_statement.to_statement() + ) # Get line items by statement. line_items_page = line_item_service.get_line_items_by_statement( - line_item_statement.toStatement()) + line_item_statement.to_statement() + ) # Get singular custom field. - if custom_field_page[:results] + if custom_field_page[:results].to_a.size > 0 custom_field = custom_fields_page[:results].first + end # Get singular drop down custom field. - if drop_down_custom_field_page[:results] + if drop_down_custom_field_page[:results].to_a.size > 0 drop_down_custom_field = drop_down_custom_fields_page[:results].first + end # Get singular line item. - if line_item_page[:results] + if line_item_page[:results].to_a.size > 0 line_item = line_items_page[:results].first + end - if custom_field and drop_down_custom_field and line_item + if !custom_field.nil? && !drop_down_custom_field.nil? && !line_item.nil? # Create custom field values. custom_field_value = { :custom_field_id => custom_field[:id], @@ -117,48 +98,64 @@ def set_line_item_custom_field_value() } custom_field_values = [custom_field_value, drop_down_custom_field_value] - old_custom_field_values = line_item.include?(:custom_field_values) ? - line_item[:custom_field_values] : [] + old_custom_field_values = line_item[:custom_field_values] || [] # Only add existing custom field values for different custom fields than the # ones you are setting. old_custom_field_values.each do |old_custom_field_value| - unless custom_field_values.map {|value| value[:id]}.include?( - old_custom_field_value[:custom_field_id]) - custom_field_values << old_custom_field_value - end + custom_field_value_ids = custom_field_values.map {|value| value[:id]} + value_already_present = custom_field_value_ids.include?( + old_custom_field_value[:custom_field_id] + ) + custom_field_values << old_custom_field_value unless value_already_present end line_item[:custom_field_values] = custom_field_values # Update the line item on the server. - return_line_items = line_item_service.update_line_items([line_item]) + updated_line_items = line_item_service.update_line_items([line_item]) - return_line_items.each do |return_line_item| + # Display the results. + updated_line_items.each do |line_item| custom_field_value_strings = [] - if return_line_item.include?(:custom_field_values) - return_line_item[:custom_field_values].each do |value| - if value[:base_custom_field_value_type].eql?('CustomFieldValue') - custom_field_value_strings << "{ID: %d, value: '%s'}" % + if line_item.include?(:custom_field_values) + line_item[:custom_field_values].each do |value| + if value[:base_custom_field_value_type] == 'CustomFieldValue' + custom_field_value_strings << '{ID: %d, value: "%s"}' % [value[:custom_field_id], value[:value][:value]] end - if value[:base_custom_field_value_type].eql?( - 'DropDownCustomFieldValue') + if value[:base_custom_field_value_type] == 'DropDownCustomFieldValue' custom_field_value_strings << - "{ID: %d, custom field option ID: %d}" % + '{ID: %d, custom field option ID: %d}' % [value[:custom_field_id], value[:custom_field_option_id]] end end end - puts "Line item ID %d set with custom field values: [%s]" % + puts 'Line item ID %d set with custom field values [%s].' % [return_line_item[:id], custom_field_value_strings.join(', ')] end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - set_line_item_custom_field_value() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + drop_down_custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i + custom_field_option_id = 'INSERT_CUSTOM_FIELD_OPTION_ID_HERE'.to_i + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + set_line_item_custom_field_value( + dfp, custom_field_id, drop_down_custom_field_id, + custom_field_option_id, line_item_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_field_service/update_custom_fields.rb b/dfp_api/examples/v201711/custom_field_service/update_custom_fields.rb index 257ce0231..3b6725b7a 100755 --- a/dfp_api/examples/v201711/custom_field_service/update_custom_fields.rb +++ b/dfp_api/examples/v201711/custom_field_service/update_custom_fields.rb @@ -21,64 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_fields(dfp, custom_field_id) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Set the ID of the custom field to update. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - # Create a statement to only select a single custom field. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => custom_field_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + sb.limit = 1 + end # Get custom fields by statement. - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) - - if page[:results] - custom_fields = page[:results] + response = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) + raise 'No custom fields found to update.' if response[:results].to_a.empty? + custom_field = response[:results].first - custom_fields.each do |custom_field| - # Update local custom field object. - custom_field[:description] = '' if custom_field[:description].nil? - custom_field[:description] +=' Updated.' + # Update custom field object. + custom_field[:description] ||= '' + custom_field[:description] += ' Updated.' - # Update the custom field on the server. - return_custom_fields = - custom_field_service.update_custom_fields([custom_field]) + # Update the custom field on the server. + updated_custom_fields = + custom_field_service.update_custom_fields([custom_field]) - return_custom_fields.each do |custom_field| - puts "Custom field ID: " + - "%d, name: '%s' and description '%s' was updated." % [ - custom_field[:id], custom_field[:name], - custom_field[:description]] - end - else - puts 'No custom fields were found to update.' + if updated_custom_fields.to_a.size > 0 + updated_custom_fields.each do |custom_field| + puts 'Custom field ID %d, name "%s", and description "%s" was updated.' % + [custom_field[:id], custom_field[:name], custom_field[:description]] end + else + puts 'No custom fields were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_fields() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + update_custom_fields(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_targeting_service/create_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201711/custom_targeting_service/create_custom_targeting_keys_and_values.rb index ac6c87a5b..95eb50e03 100755 --- a/dfp_api/examples/v201711/custom_targeting_service/create_custom_targeting_keys_and_values.rb +++ b/dfp_api/examples/v201711/custom_targeting_service/create_custom_targeting_keys_and_values.rb @@ -23,16 +23,7 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_custom_targeting_keys_and_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_targeting_keys_and_values(dfp) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) @@ -40,71 +31,88 @@ def create_custom_targeting_keys_and_values() gender_key = {:display_name => 'gender', :name => 'g', :type => 'PREDEFINED'} # Create free-form key. - car_model_key = {:display_name => 'car model', :name => 'c', - :type => 'FREEFORM'} + car_model_key = { + :display_name => 'car model', + :name => 'c', + :type => 'FREEFORM' + } # Create predefined key that may be used for content targeting. - genre_key = {:display_name => 'genre', :name => 'genre', - :type => 'PREDEFINED'} + genre_key = { + :display_name => 'genre', + :name => 'genre', + :type => 'PREDEFINED' + } # Create the custom targeting keys on the server. - return_keys = custom_targeting_service.create_custom_targeting_keys( - [gender_key, car_model_key, genre_key]) - - if return_keys - return_keys.each do |key| - puts ("Custom targeting key ID: %d, name: %s and display name: %s" + - " was created.") % [key[:id], key[:name], key[:display_name]] + created_keys = custom_targeting_service.create_custom_targeting_keys( + [gender_key, car_model_key, genre_key] + ) + + if created_keys.to_a.size > 0 + created_keys.each do |key| + puts ('Custom targeting key ID %d, name "%s" and display name "%s"' + + ' was created.') % [key[:id], key[:name], key[:display_name]] end else raise 'No keys were created.' end # Create custom targeting value for the predefined gender key. - gender_male_value = {:custom_targeting_key_id => return_keys[0][:id], - :display_name => 'male', :match_type => 'EXACT'} + gender_male_value = { + :custom_targeting_key_id => created_keys[0][:id], + :display_name => 'male', + :match_type => 'EXACT' + } + # Name is set to 1 so that the actual name can be hidden from website users. gender_male_value[:name] = '1' # Create another custom targeting value for the same key. - gender_female_value = {:custom_targeting_key_id => return_keys[0][:id], - :display_name => 'female', :name => '2', :match_type => 'EXACT'} + gender_female_value = { + :custom_targeting_key_id => created_keys[0][:id], + :display_name => 'female', + :name => '2', + :match_type => 'EXACT' + } # Create custom targeting value for the free-form age key. These are values # that would be suggested in the UI or can be used when targeting # with a free-form custom criterion. car_model_honda_civic_value = { - :custom_targeting_key_id => return_keys[1][:id], - :display_name => 'honda civic', - :name => 'honda civic', - # Setting match type to exact will match exactly "honda civic". - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[1][:id], + :display_name => 'honda civic', + :name => 'honda civic', + # Setting match type to exact will match exactly "honda civic". + :match_type => 'EXACT' } # Create custom targeting values for the predefined genre key. genre_comedy_value = { - :custom_targeting_key_id => return_keys[2][:id], - :display_name => 'comedy', - :name => 'comedy', - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[2][:id], + :display_name => 'comedy', + :name => 'comedy', + :match_type => 'EXACT' } genre_drama_value = { - :custom_targeting_key_id => return_keys[2][:id], - :display_name => 'drama', - :name => 'drama', - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[2][:id], + :display_name => 'drama', + :name => 'drama', + :match_type => 'EXACT' } # Create the custom targeting values on the server. - return_values = custom_targeting_service.create_custom_targeting_values( - [gender_male_value, gender_female_value, car_model_honda_civic_value, - genre_comedy_value, genre_drama_value]) - - if return_values - return_values.each do |value| - puts ("A custom targeting value ID: %d, name: %s and display name: %s" + - " was created for key ID: %d.") % [value[:id], value[:name], + custom_targeting_values = [gender_male_value, gender_female_value, + car_model_honda_civic_value, genre_comedy_value, genre_drama_value] + created_values = custom_targeting_service.create_custom_targeting_values( + custom_targeting_values + ) + + if created_values.to_a.size > 0 + created_values.each do |value| + puts ('A custom targeting value ID %d, name "%s" and display name "%s"' + + ' was created for key ID %d.') % [value[:id], value[:name], value[:display_name], value[:custom_targeting_key_id]] end else @@ -114,8 +122,17 @@ def create_custom_targeting_keys_and_values() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_targeting_keys_and_values() + create_custom_targeting_keys_and_values(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_keys.rb b/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_keys.rb index 7bb145be7..8183b9ea2 100755 --- a/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_keys.rb +++ b/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_keys.rb @@ -21,69 +21,57 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def delete_custom_targeting_keys() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_custom_targeting_keys(dfp, custom_targeting_key_name) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set the name of the custom targeting key to delete. - custom_targeting_key_name = 'INSERT_CUSTOM_TARGETING_KEY_NAME_HERE' - - # Define initial values. custom_target_key_ids = [] # Create statement to only select custom targeting key by the given name. - statement = DfpApi::FilterStatement.new( - 'WHERE name = :name', - [ - {:key => 'name', - :value => {:value => custom_targeting_key_name, - :xsi_type => 'TextValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'name = :name' + sb.with_bind_variable('name', custom_targeting_key_name) + end + page = {:total_result_set_size => 0} begin page = custom_targeting_service.get_custom_targeting_keys_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |key| # Add key ID to the list for deletion. custom_target_key_ids << key[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer. - puts "Number of custom targeting keys to be deleted: %d" % + puts 'Number of custom targeting keys to be deleted: %d' % custom_target_key_ids.size if !(custom_target_key_ids.empty?) # Modify statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % - [custom_target_key_ids.join(', ')] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % custom_target_key_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_targeting_service.perform_custom_targeting_key_action( - {:xsi_type => 'DeleteCustomTargetingKeys'}, statement.toStatement()) + {:xsi_type => 'DeleteCustomTargetingKeys'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of custom targeting keys deleted: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of custom targeting keys deleted: %d' % result[:num_changes] else puts 'No custom targeting keys were deleted.' end @@ -91,8 +79,18 @@ def delete_custom_targeting_keys() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_custom_targeting_keys() + custom_targeting_key_name = 'INSERT_CUSTOM_TARGETING_KEY_NAME_HERE' + delete_custom_targeting_keys(dfp, custom_targeting_key_name) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_values.rb b/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_values.rb index 75d664312..4dd04755e 100755 --- a/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_values.rb +++ b/dfp_api/examples/v201711/custom_targeting_service/delete_custom_targeting_values.rb @@ -22,77 +22,61 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def delete_custom_targeting_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_custom_targeting_values(dfp, custom_targeting_key_id) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set ID of the custom targeting key to delete values from. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - # Define initial values. custom_target_value_ids = [] # Create statement to only select custom values by the given custom targeting # key ID. - statement = DfpApi::FilterStatement.new( - 'WHERE customTargetingKeyId = :key_id', - [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'customTargetingKeyId = :key_id' + sb.with_bind_variable('key_id', custom_targeting_key_id) + end + page = {:total_result_set_size => 0} begin # Get custom targeting values by statement. page = custom_targeting_service.get_custom_targeting_values_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? # Increase query offset by page size. page[:results].each do |value| # Add value ID to the list for deletion. custom_target_value_ids << value[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer. - puts "Number of custom targeting value to be deleted: %d" % + puts 'Number of custom targeting value to be deleted: %d' % custom_target_value_ids.size if !(custom_target_value_ids.empty?) # Modify statement for action, note, values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE customTargetingKeyId = :key_id AND id IN (%s)" % - [custom_target_value_ids.join(', ')], - [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement.configure do |sb| + sb.where = 'customTargetingKeyId = :key_id AND id IN (%s)' % + custom_target_value_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_targeting_service.perform_custom_targeting_value_action( - {:xsi_type => 'DeleteCustomTargetingValues'}, statement.toStatement()) + {:xsi_type => 'DeleteCustomTargetingValues'}, + statement.to_statement() + ) - # Display results. - if result and result[:num_changes] > 0 - puts "Number of custom targeting values deleted: %d" % + # Display the results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of custom targeting values deleted: %d' % result[:num_changes] else puts 'No custom targeting values were deleted.' @@ -101,8 +85,18 @@ def delete_custom_targeting_values() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_custom_targeting_values() + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + delete_custom_targeting_values(dfp, custom_targeting_key_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201711/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb new file mode 100755 index 000000000..3d89da12d --- /dev/null +++ b/dfp_api/examples/v201711/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb @@ -0,0 +1,124 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all custom targeting keys and values. To create custom +# targeting keys can values, run create_custom_targeting_keys_and_values.rb. + +require 'dfp_api' + +def get_all_custom_targeting_keys_and_values(dfp) + # Get the CustomTargetingService. + custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) + + # Create a statement to get all custom targeting keys. + key_statement = dfp.new_statement_builder() + + # Retrieve a small number of custom targeting keys at a time, paging through + # until all custom targeting keys have been retrieved, and store their ids. + custom_targeting_key_ids = [] + page = {:total_result_set_size => 0} + begin + # Get custom targeting keys by statement. + page = custom_targeting_service.get_custom_targeting_keys_by_statement( + key_statement.to_statement() + ) + + # Display some information about each custom targeting key. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_key, index| + custom_targeting_key_ids << custom_targeting_key[:id] + puts ("%d) Custom targeting key with ID %d, name '%s', and display " + + "name '%s' was found.") % [key_statement.offset + index, + custom_targeting_key[:id], custom_targeting_key[:name], + custom_targeting_key[:display_name]] + end + end + key_statement.offset += key_statement.limit + end while key_statement.offset < page[:total_result_set_size] + + # Create a statement to get all custom targeting values for each key. + value_statement = dfp.new_statement_builder do |sb| + sb.where = "customTargetingKeyId = :customTargetingKeyId" + end + + # Get all custom targeting values for each custom targeting key. + total_result_count = 0 + custom_targeting_key_ids.each do |key_id| + value_statement.configure do |sb| + sb.with_bind_variable("customTargetingKeyId", key_id) + sb.offset = 0 + end + + # Retrieve a small number of custom targeting values at a time, paging + # through until all custom targeting values have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get custom targeting values by statement. + page = custom_targeting_service.get_custom_targeting_values_by_statement( + value_statement.to_statement() + ) + + # Display some information about each custom targeting value. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_value, index| + puts ("%d) Custom targeting value with ID %d, name '%s', and " + + "display name '%s', belonging to key with ID %d, was found.") % + [value_statement.offset + index, custom_targeting_value[:id], + custom_targeting_value[:name], + custom_targeting_value[:display_name], + custom_targeting_value[:custom_targeting_key_id]] + end + end + value_statement.offset += value_statement.limit + end while value_statement.offset < page[:total_result_set_size] + + total_result_count += page[:total_result_set_size] + end + + puts "Total number of custom targeting values found: %d" % total_result_count +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_custom_targeting_keys_and_values(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201711/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb new file mode 100755 index 000000000..a86a3bfbd --- /dev/null +++ b/dfp_api/examples/v201711/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb @@ -0,0 +1,128 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all predefined custom targeting keys and values. To create +# custom targeting keys can values, run +# create_custom_targeting_keys_and_values.rb. + +require 'dfp_api' + +def get_predefined_custom_targeting_keys_and_values(dfp) + # Get the CustomTargetingService. + custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) + + # Create a statement to get all custom targeting keys. + key_statement = dfp.new_statement_builder do |sb| + sb.where = "type = :type" + sb.with_bind_variable("type", "PREDEFINED") + end + + # Retrieve a small number of custom targeting keys at a time, paging through + # until all custom targeting keys have been retrieved, and store their ids. + custom_targeting_key_ids = [] + page = {:total_result_set_size => 0} + begin + # Get custom targeting keys by statement. + page = custom_targeting_service.get_custom_targeting_keys_by_statement( + key_statement.to_statement() + ) + + # Display some information about each custom targeting key. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_key, index| + custom_targeting_key_ids << custom_targeting_key[:id] + puts ("%d) Custom targeting key with ID %d, name '%s', and display " + + "name '%s' was found.") % [key_statement.offset + index, + custom_targeting_key[:id], custom_targeting_key[:name], + custom_targeting_key[:display_name]] + end + end + key_statement.offset += key_statement.limit + end while key_statement.offset < page[:total_result_set_size] + + # Create a statement to get all custom targeting values for each key. + value_statement = dfp.new_statement_builder do |sb| + sb.where = "customTargetingKeyId = :custom_targeting_key_id" + end + + # Get all custom targeting values for each custom targeting key. + total_result_count = 0 + custom_targeting_key_ids.each do |key_id| + value_statement.configure do |sb| + sb.with_bind_variable("custom_targeting_key_id", key_id) + sb.offset = 0 + end + + # Retrieve a small number of custom targeting values at a time, paging + # through until all custom targeting values have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get custom targeting values by statement. + page = custom_targeting_service.get_custom_targeting_values_by_statement( + value_statement.to_statement() + ) + + # Display some information about each custom targeting value. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_value, index| + puts ("%d) Custom targeting value with ID %d, name '%s', and " + + "display name '%s', belonging to key with ID %d, was found.") % + [value_statement.offset + index, custom_targeting_value[:id], + custom_targeting_value[:name], + custom_targeting_value[:display_name], + custom_targeting_value[:custom_targeting_key_id]] + end + end + value_statement.offset += value_statement.limit + end while value_statement.offset < page[:total_result_set_size] + + total_result_count += page[:total_result_set_size] + end + + puts "Total number of custom targeting values found: %d" % total_result_count +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_predefined_custom_targeting_keys_and_values(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_keys.rb b/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_keys.rb index a4ce46639..83c94d4fc 100755 --- a/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_keys.rb +++ b/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_keys.rb @@ -22,29 +22,22 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_custom_targeting_keys() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_targeting_keys(dfp) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) # Create a statement to get all custom targeting keys. - statement = DfpApi::FilterStatement.new('ORDER BY id ASC') + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end # Get custom targeting keys by statement. page = custom_targeting_service.get_custom_targeting_keys_by_statement( - statement) + statement.to_statement() + ) keys = page[:results] - raise 'No targeting keys found to update' if !keys || keys.empty? + raise 'No targeting keys found to update' if keys.to_a.empty? # Update each local custom targeting key object by changing its display name. keys.each do |key| @@ -53,13 +46,13 @@ def update_custom_targeting_keys() end # Update the custom targeting keys on the server. - result_keys = custom_targeting_service.update_custom_targeting_keys(keys) + updated_keys = custom_targeting_service.update_custom_targeting_keys(keys) - if result_keys + if updated_keys.to_a.size > 0 # Print details about each key in results. - result_keys.each_with_index do |custom_targeting_key, index| - puts ("%d) Custom targeting key with ID [%d], name: %s," + - " displayName: %s type: %s was updated") % [index, + updated_keys.each_with_index do |custom_targeting_key, index| + puts ('%d) Custom targeting key with ID %d, name "%s", ' + + 'displayName "%s", and type "%s" was updated') % [index, custom_targeting_key[:id], custom_targeting_key[:name], custom_targeting_key[:display_name], custom_targeting_key[:type]] end @@ -69,8 +62,17 @@ def update_custom_targeting_keys() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_targeting_keys() + update_custom_targeting_keys(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_values.rb b/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_values.rb index 85fec1237..bbc2d8a86 100755 --- a/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_values.rb +++ b/dfp_api/examples/v201711/custom_targeting_service/update_custom_targeting_values.rb @@ -22,70 +22,66 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_custom_targeting_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_targeting_values(dfp, custom_targeting_key_id) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set the ID of the custom targeting key to get custom targeting values for. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - # Create a statement to get first 500 custom targeting keys. - statement = DfpApi::FilterStatement.new( - :query => 'WHERE customTargetingKeyId = :key_id', - :values => [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'customTargetingKeyId = :key_id' + sb.with_bind_variable('key_id', custom_targeting_key_id) + end + page = {:total_result_set_size => 0} begin # Get custom targeting keys by statement. page = custom_targeting_service.get_custom_targeting_values_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] - # Update each local custom targeting values object by changing its display - # name. - page[:results].each do |value| + unless page[:results].nil? + # Update each custom targeting values object by changing its display name. + values = page[:results] + values.each do |value| display_name = (value[:display_name].nil?) ? value[:name] : value[:display_name] value[:display_name] = display_name + ' (Deprecated)' end # Update the custom targeting keys on the server. - result_values = custom_targeting_service.update_custom_targeting_values( - values) + updated_values = custom_targeting_service.update_custom_targeting_values( + values + ) - if result_values + unless updated_values.nil? # Print details about each value in results. - result_values.each_with_index do |custom_targeting_value, index| - puts ("%d) Custom targeting key with ID [%d], name: %s," + - " displayName: %s was updated") % [ - index + statement.offset, custom_targeting_value[:id], - custom_targeting_value[:name], - custom_targeting_value[:display_name]] + updated_values.each_with_index do |custom_targeting_value, index| + puts ('%d) Custom targeting key with ID %d, name "%s", and display ' + + 'name "%s" was updated.') % [index + statement.offset, + custom_targeting_value[:id], custom_targeting_value[:name], + custom_targeting_value[:display_name]] end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_targeting_values() + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + update_custom_targeting_values(dfp, custom_targeting_key_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/exchange_rate_service/create_exchange_rate.rb b/dfp_api/examples/v201711/exchange_rate_service/create_exchange_rate.rb new file mode 100755 index 000000000..5903223c3 --- /dev/null +++ b/dfp_api/examples/v201711/exchange_rate_service/create_exchange_rate.rb @@ -0,0 +1,78 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates an exchange rate. + +require 'dfp_api' + +def create_exchange_rate(dfp) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a configuration object for a fixed exchange rate with currency code + # 'AUD', with direction FROM_NETWORK and a value of 1.5. + exchange_rate = { + :currency_code => 'AUD', + :direction => 'FROM_NETWORK', + :exchange_rate => 15_000_000_000, + :refresh_rate => 'FIXED' + } + + # Create the exchange rate on the server. + created_exchange_rates = exchange_rate_service.create_exchange_rates([ + exchange_rate + ]) + + # Display the results. + created_exchange_rates.each do |exchange_rate| + puts ('Created an exchange rate with ID %d, currency code %s, direction ' + + '%s, and exchange rate %.2f.') % [exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + (exchange_rate[:exchange_rate] / 10_000_000_000.0)] + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + create_exchange_rate(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/exchange_rate_service/get_all_exchange_rates.rb b/dfp_api/examples/v201711/exchange_rate_service/get_all_exchange_rates.rb index c99d8823a..ac739edb7 100755 --- a/dfp_api/examples/v201711/exchange_rate_service/get_all_exchange_rates.rb +++ b/dfp_api/examples/v201711/exchange_rate_service/get_all_exchange_rates.rb @@ -17,73 +17,67 @@ # limitations under the License. # # This example gets all exchange rates. -require 'dfp_api' -class GetAllExchangeRates +require 'dfp_api' - def self.run_example(dfp) - exchange_rate_service = - dfp.service(:ExchangeRateService, :v201711) +def get_all_exchange_rates(dfp) + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) - # Create a statement to select exchange rates. - statement = DfpApi::FilterStatement.new() + # Create a statement to select exchange rates. + statement = dfp.new_statement_builder() - # Retrieve a small amount of exchange rates at a time, paging - # through until all exchange rates have been retrieved. - total_result_set_size = 0; - begin - page = exchange_rate_service.get_exchange_rates_by_statement( - statement.toStatement()) + # Retrieve a small amount of exchange rates at a time, paging + # through until all exchange rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) - # Print out some information for each exchange rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |exchange_rate, index| - puts "%d) Exchange rate with ID %d, currency code '%s', direction '%s', and exchange rate %d was found." % [ - index + statement.offset, - exchange_rate[:id], - exchange_rate[:currency_code], - exchange_rate[:direction], - exchange_rate[:exchange_rate] - ] - end + # Print out some information for each exchange rate. + unless page[:results].nil? + page[:results].each_with_index do |exchange_rate, index| + puts ('%d) Exchange rate with ID %d, currency code "%s", direction ' + + '"%s", and exchange rate %d was found.') % + [index + statement.offset, exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + exchange_rate[:exchange_rate]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of exchange rates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of exchange rates: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_exchange_rates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllExchangeRates.main() -end diff --git a/dfp_api/examples/v201711/exchange_rate_service/get_exchange_rates_for_currency_code.rb b/dfp_api/examples/v201711/exchange_rate_service/get_exchange_rates_for_currency_code.rb new file mode 100755 index 000000000..bb1005155 --- /dev/null +++ b/dfp_api/examples/v201711/exchange_rate_service/get_exchange_rates_for_currency_code.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets the exchange rate for a specific currency code. + +require 'dfp_api' + +def get_exchange_rates_for_currency_code(dfp, currency_code) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a statement to select exchange rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'currencyCode = :currency_code' + sb.with_bind_variable('currency_code', currency_code) + end + + # Retrieve a small number of exchange rates at a time, paging through until + # all exchange rates have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get exchange rates by statement. + page = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) + + # Display some information about each exchange rate. + unless page[:results].nil? + page[:results].each do |exchange_rate| + puts ('Exchange rate with ID %d, currency code "%s", and exchange ' + + 'rate %.2f was found.') % [exchange_rate[:id], + exchange_rate[:currency_code], + exchange_rate[:exchange_rate] / 10_000_000_000.0] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts "Total number of custom targeting values found: %d" % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + currency_code = 'INSERT_CURRENCY_CODE_HERE' + get_exchange_rates_for_currency_code(dfp, currency_code) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/exchange_rate_service/update_exchange_rate.rb b/dfp_api/examples/v201711/exchange_rate_service/update_exchange_rate.rb new file mode 100755 index 000000000..02eecbbab --- /dev/null +++ b/dfp_api/examples/v201711/exchange_rate_service/update_exchange_rate.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates the value of an exchange rate. Note that updating the +# exchange rate value will only take effect if the exchange rate's refreshRate +# is set to FIXED. + +require 'dfp_api' + +def update_exchange_rate(dfp, exchange_rate_id) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a statement to select the exchange rate. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :exchange_rate_id' + sb.with_bind_variable('exchange_rate_id', exchange_rate_id) + sb.limit = 1 + end + + # Get the exchange rate. + response = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) + raise 'No exchange rates found to update.' if response[:results].to_a.empty? + exchange_rate = response[:results].first + + # Update the exchange rate value to 1.5. + exchange_rate[:exchange_rate] = 15_000_000_000 + + # Send the changes to the server. + updated_exchange_rates = exchange_rate_service.update_exchange_rates([ + exchange_rate + ]) + + # Display the results. + if updated_exchange_rates.to_a.size > 0 + updated_exchange_rates.each do |exchange_rate| + puts ('Exchange rate with ID %d, currency code "%s", direction "%s", ' + + 'and exchange rate %.2f was updated.') % [exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + exchange_rate[:exchange_rate] / 10_000_000_000.0] + end + else + puts 'No exchange rates were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + exchange_rate_id = 'INSERT_EXCHANGE_RATE_ID_HERE'.to_i + update_exchange_rate(dfp, exchange_rate_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/forecast_service/get_availability_forecast.rb b/dfp_api/examples/v201711/forecast_service/get_availability_forecast.rb index 2281475b5..767332e31 100755 --- a/dfp_api/examples/v201711/forecast_service/get_availability_forecast.rb +++ b/dfp_api/examples/v201711/forecast_service/get_availability_forecast.rb @@ -21,37 +21,21 @@ require 'dfp_api' -API_VERSION = :v201711 - -def get_availability_forecast() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the ForecastService. +def get_availability_forecast(dfp, advertiser_id) + # Get the ForecastService and the NetworkService. forecast_service = dfp.service(:ForecastService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) - # Set the advertiser to assign the prospective line item to. - # This allows for forecasting while taking into account - # same advertiser exclusion. - advertiser_id = 'INSERT_ADVERTISER_ID_HERE'.to_i - # Set the root ad unit to target the entire network. - root_ad_unit_id = ( - network_service.get_current_network()[:effective_root_ad_unit_id].to_i) + root_ad_unit_id = + network_service.get_current_network()[:effective_root_ad_unit_id].to_i # Create targeting. targeting = { :inventory_targeting => { :targeted_ad_units => [ { - :include_descendants => True, + :include_descendants => true, :ad_unit_id => root_ad_unit_id } ] @@ -71,12 +55,12 @@ def get_availability_forecast() :creative_placeholders => [creative_placeholder], # Set the line item's time to be now until the projected end date time. :start_date_time_type => 'IMMEDIATELY', - :end_date_time => Time.utc(2014, 01, 01), + :end_date_time => dfp.utc(Date.today.year + 1, 1, 1).to_h, # Set the line item to use 50% of the impressions. - :primary_goal => {:goal => { + :primary_goal => { :units => '50', :unit_type => 'IMPRESSIONS', - :goal_type => 'DAILY'} + :goal_type => 'DAILY' }, # Set the cost type to match the unit type. :cost_type => 'CPM' @@ -89,32 +73,47 @@ def get_availability_forecast() # Set forecasting options. forecast_options = { - :include_contending_line_items => True, - :include_targeting_criteria_breakdown => True, + :include_contending_line_items => true, + :include_targeting_criteria_breakdown => true, } # Get forecast for the line item. forecast = forecast_service.get_availability_forecast( prospective_line_item, forecast_options) - if forecast + unless forecast.nil? # Display results. matched = forecast[:matched_units] available_percent = forecast[:available_units] * 100.0 / matched unit_type = forecast[:unit_type].to_s.downcase - puts "%.2f %s matched." % [matched, unit_type] - puts "%.2f%% %s available." % [available_percent, unit_type] - puts "%d contending line items." % forecast[:contending_line_items].size - if forecast[:possible_units] + puts '%.2f %s matched.' % [matched, unit_type] + puts '%.2f%% of %s available.' % [available_percent, unit_type] + unless forecast[:contending_line_items].nil? + puts '%d contending line items.' % forecast[:contending_line_items].size + end + unless forecast[:possible_units].nil? possible_percent = forecast[:possible_units] * 100.0 / matched - puts "%.2f%% %s possible." % [possible_percent, unit_type] + puts '%.2f%% of %s possible.' % [possible_percent, unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_availability_forecast() + # Set the advertiser to assign the prospective line item to. + # This allows for forecasting while taking into account + # same advertiser exclusion. + advertiser_id = 'INSERT_ADVERTISER_ID_HERE'.to_i + get_availability_forecast(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/forecast_service/get_availability_forecast_for_line_item.rb b/dfp_api/examples/v201711/forecast_service/get_availability_forecast_for_line_item.rb index 8f5f5b016..c2bf28974 100755 --- a/dfp_api/examples/v201711/forecast_service/get_availability_forecast_for_line_item.rb +++ b/dfp_api/examples/v201711/forecast_service/get_availability_forecast_for_line_item.rb @@ -21,22 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def get_availability_forecast_for_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_availability_forecast_for_line_item(dfp, line_item_id) # Get the ForecastService. forecast_service = dfp.service(:ForecastService, API_VERSION) - # Set the line item to get a forecast for. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Set forecasting options. forecast_options = { :include_contending_line_items => True, @@ -45,26 +33,37 @@ def get_availability_forecast_for_line_item() # Get forecast for the line item. forecast = forecast_service.get_availability_forecast_by_id( - line_item_id, forecast_options) + line_item_id, forecast_options + ) - if forecast + unless forecast.nil? # Display results. matched = forecast[:matched_units] available_percent = forecast[:available_units] * 100.0 / matched unit_type = forecast[:unit_type].to_s.downcase - puts "%.2f %s matched." % [matched, unit_type] - puts "%.2f%% %s available." % [available_percent, unit_type] - puts "%d contending line items." % forecast[:contending_line_items].size - if forecast[:possible_units] + puts '%.2f %s matched.' % [matched, unit_type] + puts '%.2f%% of %s available.' % [available_percent, unit_type] + puts '%d contending line items.' % forecast[:contending_line_items].size + unless forecast[:possible_units].nil? possible_percent = forecast[:possible_units] * 100.0 / matched - puts "%.2f%% %s possible." % [possible_percent, unit_type] + puts '%.2f%% of %s possible.' % [possible_percent, unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_availability_forecast_for_line_item() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + get_availability_forecast_for_line_item(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/forecast_service/get_delivery_forecast_for_line_items.rb b/dfp_api/examples/v201711/forecast_service/get_delivery_forecast_for_line_items.rb index b75c899ef..e4065ead4 100755 --- a/dfp_api/examples/v201711/forecast_service/get_delivery_forecast_for_line_items.rb +++ b/dfp_api/examples/v201711/forecast_service/get_delivery_forecast_for_line_items.rb @@ -17,47 +17,45 @@ # limitations under the License. # # This example gets a delivery forecast for multiple line items. To determine -# which placements exist, run get_all_placements.rb. +# which line items exist, run get_all_line_items.rb. require 'dfp_api' -API_VERSION = :v201711 - -def get_delivery_forecast_for_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_delivery_forecast_for_line_items(dfp, line_item_id1, line_item_id2) # Get the ForecastService. forecast_service = dfp.service(:ForecastService, API_VERSION) - # Set the line items to get a forecast for. - line_item_id1 = 'INSERT_LINE_ITEM_ID_1_HERE'.to_i - line_item_id2 = 'INSERT_LINE_ITEM_ID_2_HERE'.to_i - # Get forecast for the line item. forecast = forecast_service.get_delivery_forecast_by_ids( [line_item_id1, line_item_id2], nil) - if forecast + unless forecast.nil? || forecast[:line_item_delivery_forecasts].nil? forecast[:line_item_delivery_forecasts].each do |single_forecast| # Display results. unit_type = single_forecast[:unit_type] puts ('Forecast for line item %d:\n\t%d %s matched\n\t%d %s ' + - 'delivered\n\t%d %s predicted\n') % [ - single_forecast[:line_item_id], single_forecast[:matched_units], - unit_type, single_forecast[:delivered_units], unit_type, - single_forecast[:predicted_delivery_units], unit_type] + 'delivered\n\t%d %s predicted\n') % [single_forecast[:line_item_id], + single_forecast[:matched_units], unit_type, + single_forecast[:delivered_units], unit_type, + single_forecast[:predicted_delivery_units], unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_delivery_forecast_for_line_items() + line_item_id1 = 'INSERT_LINE_ITEM_ID_1_HERE'.to_i + line_item_id2 = 'INSERT_LINE_ITEM_ID_2_HERE'.to_i + get_delivery_forecast_for_line_items(dfp, line_item_id1, line_item_id2) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/inventory_service/archive_ad_units.rb b/dfp_api/examples/v201711/inventory_service/archive_ad_units.rb new file mode 100755 index 000000000..c7f1451af --- /dev/null +++ b/dfp_api/examples/v201711/inventory_service/archive_ad_units.rb @@ -0,0 +1,101 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example archives a parent ad unit and all its children ad units. To +# determine which ad units exist, run get_all_ad_units.rb or +# get_ad_unit_hierarchy.rb. + +require 'dfp_api' + +def archive_ad_units(dfp, parent_ad_unit_id) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Create statement text to select ad units. + statement = dfp.new_statement_builder do |sb| + sb.where = 'parentId = :parent_id OR id = :parent_id' + sb.with_bind_variable('parent_id', parent_ad_unit_id) + end + + archived_ad_unit_count = 0 + + # Retrieve a small number of ad units at a time, paging through until all ad + # units have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get ad units by statement. + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + + unless page[:results].nil? + # Display some information about each ad unit. + page[:results].each do |ad_unit| + puts 'Ad unit with ID %d and name "%s" will be archived.' % + [ad_unit[:id], ad_unit[:name]] + end + + # Perform action. + result = inventory_service.perform_ad_unit_action( + {:xsi_type => 'ArchiveAdUnits'}, statement.to_statement() + ) + unless result.nil? or result[:num_changes].nil? + archived_ad_unit_count += result[:num_changes] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Display number of changes. + if archived_ad_unit_count > 0 + puts 'Number of ad units archived: %d' % archived_ad_unit_count + else + puts 'No ad units were archived.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + parent_ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i + archive_ad_units(dfp, parent_ad_unit_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/inventory_service/create_ad_units.rb b/dfp_api/examples/v201711/inventory_service/create_ad_units.rb index f73850588..326f0c3a0 100755 --- a/dfp_api/examples/v201711/inventory_service/create_ad_units.rb +++ b/dfp_api/examples/v201711/inventory_service/create_ad_units.rb @@ -20,31 +20,19 @@ # determine which ad units exist, run get_inventory_tree.rb or # get_all_ad_units.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of ad units to create. -ITEM_COUNT = 5 - -def create_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the InventoryService. +def create_ad_units(dfp, number_of_ad_units_to_create) + # Get the InventoryService and the NetworkService. inventory_service = dfp.service(:InventoryService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the effective root ad unit ID of the network. effective_root_ad_unit_id = network_service.get_current_network[:effective_root_ad_unit_id] - puts "Using effective root ad unit: %d" % effective_root_ad_unit_id + puts 'Using effective root ad unit: %d' % effective_root_ad_unit_id # Create the creative placeholder. creative_placeholder = { @@ -53,31 +41,43 @@ def create_ad_units() } # Create an array to store local ad unit objects. - ad_units = (1..ITEM_COUNT).map do |index| - {:name => "Ad_Unit_%d" % index, - :parent_id => effective_root_ad_unit_id, - :description => 'Ad unit description.', - :target_window => 'BLANK', - # Set the size of possible creatives that can match this ad unit. - :ad_unit_sizes => [creative_placeholder]} + ad_units = (1..number_of_ad_units_to_create).map do |index| + { + :name => 'Ad_Unit #%d - %d' % [index, SecureRandom.uuid()], + :parent_id => effective_root_ad_unit_id, + :description => 'Ad unit description.', + :target_window => 'BLANK', + # Set the size of possible creatives that can match this ad unit. + :ad_unit_sizes => [creative_placeholder] + } end # Create the ad units on the server. - return_ad_units = inventory_service.create_ad_units(ad_units) + created_ad_units = inventory_service.create_ad_units(ad_units) - if return_ad_units - return_ad_units.each do |ad_unit| - puts "Ad unit with ID: %d, name: %s and status: %s was created." % + if created_ad_units.to_a.size > 0 + created_ad_units.each do |ad_unit| + puts 'Ad unit with ID %d, name "%s", and status "%s" was created.' % [ad_unit[:id], ad_unit[:name], ad_unit[:status]] end else - raise 'No ad units were created.' + puts 'No ad units were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_ad_units() + number_of_ad_units_to_create = 5 + create_ad_units(dfp, number_of_ad_units_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/inventory_service/deactivate_ad_units.rb b/dfp_api/examples/v201711/inventory_service/deactivate_ad_units.rb index e7c763915..f7d853e28 100755 --- a/dfp_api/examples/v201711/inventory_service/deactivate_ad_units.rb +++ b/dfp_api/examples/v201711/inventory_service/deactivate_ad_units.rb @@ -21,65 +21,54 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_ad_units(dfp) # Get the InventoryService. inventory_service = dfp.service(:InventoryService, API_VERSION) # Create statement text to select active ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE status = :status', - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end ad_unit_ids = [] + page = {:total_result_set_size => 0} begin # Get ad units by statement. - page = inventory_service.get_ad_units_by_statement(statement.toStatement()) + page = inventory_service.get_ad_units_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |ad_unit, index| - puts ("%d) Ad unit with ID: %d, status: %s and name: %s will be " + - "deactivated.") % [index + statement.offset, ad_unit[:id], - ad_unit[:status], ad_unit[:name]] + puts ('%d) Ad unit with ID %d, status "%s", and name "%s" will be ' + + 'deactivated.') % [index + statement.offset, ad_unit[:id], + ad_unit[:status], ad_unit[:name]] ad_unit_ids << ad_unit[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of ad units to be deactivated: %d" % ad_unit_ids.size + puts 'Number of ad units to be deactivated: %d' % ad_unit_ids.size if !ad_unit_ids.empty? # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE status = :status AND id in (%s)" % ad_unit_ids.join(', '), - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement.configure do |sb| + sb.where = 'status = :status AND id IN (%s)' % ad_unit_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = inventory_service.perform_ad_unit_action( - {:xsi_type => 'DeactivateAdUnits'}, statement.toStatement()) + {:xsi_type => 'DeactivateAdUnits'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of ad units deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of ad units deactivated: %d' % result[:num_changes] else puts 'No ad units were deactivated.' end @@ -89,8 +78,17 @@ def deactivate_ad_units() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_ad_units() + deactivate_ad_units(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/inventory_service/get_ad_unit_hierarchy.rb b/dfp_api/examples/v201711/inventory_service/get_ad_unit_hierarchy.rb new file mode 100755 index 000000000..21056abf8 --- /dev/null +++ b/dfp_api/examples/v201711/inventory_service/get_ad_unit_hierarchy.rb @@ -0,0 +1,112 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example prints all ad unit names as a tree. + +require 'dfp_api' + +def get_ad_unit_hierarchy(dfp) + # Get the NetworkService and InventoryService. + network_service = dfp.service(:NetworkService, API_VERSION) + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Set the parent ad unit's ID for all children ad units to be fetched from. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Create a statement to select only the root ad unit by ID. + root_ad_unit_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', root_ad_unit_id) + sb.limit = 1 + end + + # Make a request for the root ad unit + response = inventory_service.get_ad_units_by_statement( + root_ad_unit_statement.to_statement() + ) + root_ad_unit = response[:results].first + + # Create a statement to select all ad units. + statement = dfp.new_statement_builder() + + # Get all ad units in order to construct the hierarchy later. + all_ad_units = [] + page = {:total_result_set_size => 0} + begin + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + unless page[:results].nil? + all_ad_units += page[:results] + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Make call to helper functions for displaying ad unit hierarchy. + display_ad_unit_hierarchy(root_ad_unit, all_ad_units) +end + +def display_ad_unit_hierarchy(root_ad_unit, ad_unit_list) + parent_id_to_children_map = {} + ad_unit_list.each do |ad_unit| + unless ad_unit[:parent_id].nil? + (parent_id_to_children_map[ad_unit[:parent_id]] ||= []) << ad_unit + end + end + + display_hierarchy(root_ad_unit, parent_id_to_children_map) +end + +def display_hierarchy(root, parent_id_to_children_map, depth=0) + indent_string = '%s+--' % ([' '] * depth).join('|') + puts '%s%s (%s)' % [indent_string, root[:name], root[:id]] + parent_id_to_children_map.fetch(root[:id], []).each do |child| + display_hierarchy(child, parent_id_to_children_map, depth+1) + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_ad_unit_hierarchy(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/inventory_service/get_all_ad_unit_sizes.rb b/dfp_api/examples/v201711/inventory_service/get_all_ad_unit_sizes.rb new file mode 100755 index 000000000..6537946d1 --- /dev/null +++ b/dfp_api/examples/v201711/inventory_service/get_all_ad_unit_sizes.rb @@ -0,0 +1,70 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all ad unit sizes. + +require 'dfp_api' + +def get_all_ad_unit_sizes(dfp) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Create a statement to select all ad unit sizes. + statement = dfp.new_statement_builder() + + # Get the ad unit sizes. + ad_unit_sizes = inventory_service.get_ad_unit_sizes_by_statement( + statement.to_statement() + ) + + # Display the results. + ad_unit_sizes.each do |ad_unit_size| + puts 'Ad unit size with dimensions "%s" was found.' % + ad_unit_size[:full_display_string] + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_ad_unit_sizes(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/inventory_service/get_all_ad_units.rb b/dfp_api/examples/v201711/inventory_service/get_all_ad_units.rb index cc80b3190..cd3462591 100755 --- a/dfp_api/examples/v201711/inventory_service/get_all_ad_units.rb +++ b/dfp_api/examples/v201711/inventory_service/get_all_ad_units.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all ad units. -require 'dfp_api' -class GetAllAdUnits +require 'dfp_api' - def self.run_example(dfp) - inventory_service = - dfp.service(:InventoryService, :v201711) +def get_all_ad_units(dfp) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) - # Create a statement to select ad units. - statement = DfpApi::FilterStatement.new() + # Create a statement to select ad units. + statement = dfp.new_statement_builder() - # Retrieve a small amount of ad units at a time, paging - # through until all ad units have been retrieved. - total_result_set_size = 0; - begin - page = inventory_service.get_ad_units_by_statement( - statement.toStatement()) + # Retrieve a small amount of ad units at a time, paging + # through until all ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) - # Print out some information for each ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |ad_unit, index| - puts "%d) Ad unit with ID '%s' and name '%s' was found." % [ - index + statement.offset, - ad_unit[:id], - ad_unit[:name] - ] - end + # Print out some information for each ad unit. + unless page[:results].nil? + page[:results].each_with_index do |ad_unit, index| + puts '%d) Ad unit with ID %d and name "%s" was found.' % + [index + statement.offset, ad_unit[:id], ad_unit[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of ad units: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of ad units: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllAdUnits.main() -end diff --git a/dfp_api/examples/v201711/inventory_service/get_top_level_ad_units.rb b/dfp_api/examples/v201711/inventory_service/get_top_level_ad_units.rb new file mode 100755 index 000000000..6b4acec3d --- /dev/null +++ b/dfp_api/examples/v201711/inventory_service/get_top_level_ad_units.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all child ad units of the effective root ad unit. + +require 'dfp_api' + +def get_top_level_ad_units(dfp) + # Get the NetworkService and InventoryService. + network_service = dfp.service(:NetworkService, API_VERSION) + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Set the parent ad unit's ID for all children ad units to be fetched from. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Create a statement to select all ad unit sizes. + statement = dfp.new_statement_builder do |sb| + sb.where = 'parentId = :parent_id' + sb.with_bind_variable('parent_id', root_ad_unit_id) + end + + # Retrieve a small number of ad units at a time, paging through until all ad + # units have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get ad units by statement. + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + + # Display some information about each ad unit. + unless page[:results].nil? + page[:results].each_with_index do |ad_unit, index| + puts '%d) Ad unit with ID %d and name "%s" was found.' % + [statement.offset + index, ad_unit[:id], ad_unit[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Number of results found: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_top_level_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/inventory_service/update_ad_units.rb b/dfp_api/examples/v201711/inventory_service/update_ad_units.rb index a122854d3..6be662570 100755 --- a/dfp_api/examples/v201711/inventory_service/update_ad_units.rb +++ b/dfp_api/examples/v201711/inventory_service/update_ad_units.rb @@ -22,78 +22,57 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_ad_units(dfp, ad_unit_id) # Get the InventoryService. inventory_service = dfp.service(:InventoryService, API_VERSION) - # Specify which ad unit to update. - ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i - # Create a statement to get first 500 ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => { - :value => ad_unit_id, - :xsi_type => 'NumberValue' - } - } - ], - 1 - } + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :ad_unit_id' + sb.with_bind_variable('ad_unit_id', ad_unit_id) + sb.limit = 1 + end # Get ad units by statement. - page = inventory_service.get_ad_units_by_statement(statement.toStatement()) - - if page[:results] - ad_units = page[:results] - - new_ad_unit_size = { - :size => { - :width => 1, - :height => 1, - :is_aspect_ration => false - }, - :environment_type => 'BROWSER' - } + response = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + raise 'No ad unit found to update.' if response[:results].to_a.empty? + ad_unit = response[:results].first + + new_ad_unit_size = { + :size => {:width => 1, :height => 1, :is_aspect_ration => false}, + :environment_type => 'BROWSER' + } - # Update local ad unit by adding a new size of 1x1. - ad_units.each do |ad_unit| - ad_unit[:ad_unit_sizes] <<= new_ad_unit_size - # Workaround for issue #94. - ad_unit[:description] = "" if ad_unit[:description].nil? - end + ad_unit[:ad_unit_sizes] << new_ad_unit_size - # Update the ad units on the server. - return_ad_units = inventory_service.update_ad_units(ad_units) + # Update the ad units on the server. + updated_ad_units = inventory_service.update_ad_units([ad_unit]) - if return_ad_units - return_ad_units.each do |ad_unit| - puts "Ad unit with ID: %d, name: %s and status: %s was updated" % - [ad_unit[:id], ad_unit[:name], ad_unit[:status]] - end - else - raise 'No ad units were updated.' + if updated_ad_units.to_a.size > 0 + updated_ad_units.each do |ad_unit| + puts 'Ad unit with ID %d, name "%s", and status "%s" was updated' % + [ad_unit[:id], ad_unit[:name], ad_unit[:status]] end else - puts 'No ad units found to update.' + puts 'No ad units were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_ad_units() + ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i + update_ad_units(dfp, ad_unit_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/label_service/create_labels.rb b/dfp_api/examples/v201711/label_service/create_labels.rb index bfdb63d99..1165f549c 100755 --- a/dfp_api/examples/v201711/label_service/create_labels.rb +++ b/dfp_api/examples/v201711/label_service/create_labels.rb @@ -21,45 +21,48 @@ # # This feature is only available to DFP premium solution networks. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of labels to create. -ITEM_COUNT = 5 - -def create_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_labels(dfp, number_of_labels_to_create) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create an array to store local label objects. - labels = (1..ITEM_COUNT).map do |index| - {:name => "Label #%d" % index, :types => ['COMPETITIVE_EXCLUSION']} + labels = (1..number_of_labels_to_create).map do |index| + { + :name => "Label #%d - %d" % [index, SecureRandom.uuid()], + :types => ['COMPETITIVE_EXCLUSION'] + } end # Create the labels on the server. - return_labels = label_service.create_labels(labels) + created_labels = label_service.create_labels(labels) - if return_labels - return_labels.each do |label| - puts "Label with ID: %d, name: '%s' and types: '%s' was created." % + if created_labels.to_a.size > 0 + created_labels.each do |label| + puts 'Label with ID %d, name "%s" and types "%s" was created.' % [label[:id], label[:name], label[:types].join(', ')] end else - raise 'No labels were created.' + puts 'No labels were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_labels() + number_of_labels_to_create = 5 + create_labels(dfp, number_of_labels_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/label_service/deactivate_labels.rb b/dfp_api/examples/v201711/label_service/deactivate_labels.rb index 68d667779..25be061cc 100755 --- a/dfp_api/examples/v201711/label_service/deactivate_labels.rb +++ b/dfp_api/examples/v201711/label_service/deactivate_labels.rb @@ -23,60 +23,56 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_labels(dfp) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create statement to select active labels. - statement = DfpApi::FilterStatement.new( - 'WHERE isActive = :is_active', - [ - {:key => 'is_active', - :value => {:value => true, :xsi_type => 'BooleanValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end # Define initial values. label_ids = [] + # Retrieve a small number of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} begin # Get labels by statement. - page = label_service.get_labels_by_statement(statement.toStatement()) + page = label_service.get_labels_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |label, index| - puts ("%d) Label ID: %d, name: %s will be deactivated.") % + puts ('%d) Label ID %d and name "%s" will be deactivated.') % [index + statement.offset, label[:id], label[:name]] label_ids << label[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of labels to be deactivated: %d" % label_ids.size + puts 'Number of labels to be deactivated: %d' % label_ids.size if !label_ids.empty? # Create a statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % label_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % label_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = label_service.perform_label_action( - {:xsi_type => 'DeactivateLabels'}, statement.toStatement()) + {:xsi_type => 'DeactivateLabels'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of labels deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of labels deactivated: %d' % result[:num_changes] else puts 'No labels were deactivated.' end @@ -86,8 +82,17 @@ def deactivate_labels() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_labels() + deactivate_labels(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/label_service/get_active_labels.rb b/dfp_api/examples/v201711/label_service/get_active_labels.rb index 400678e6b..4d3458249 100755 --- a/dfp_api/examples/v201711/label_service/get_active_labels.rb +++ b/dfp_api/examples/v201711/label_service/get_active_labels.rb @@ -17,81 +17,68 @@ # limitations under the License. # # This example gets all active labels. -require 'dfp_api' -class GetActiveLabels +require 'dfp_api' - def self.run_example(dfp) - label_service = - dfp.service(:LabelService, :v201711) +def get_active_labels(dfp) + # Get the LabelService. + label_service = dfp.service(:LabelService, API_VERSION) - # Create a statement to select labels. - query = 'WHERE isActive = :isActive' - values = [ - { - :key => 'isActive', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select labels. + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end - # Retrieve a small amount of labels at a time, paging - # through until all labels have been retrieved. - total_result_set_size = 0; - begin - page = label_service.get_labels_by_statement( - statement.toStatement()) + # Retrieve a small amount of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} + begin + page = label_service.get_labels_by_statement( + statement.to_statement() + ) - # Print out some information for each label. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |label, index| - puts "%d) Label with ID %d and name '%s' was found." % [ - index + statement.offset, - label[:id], - label[:name] - ] - end + # Print out some information for each label. + unless page[:results].nil? + page[:results].each_with_index do |label, index| + puts '%d) Label with ID %d and name "%s" was found.' % + [index + statement.offset, label[:id], label[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of labels: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of labels: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_active_labels(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActiveLabels.main() -end diff --git a/dfp_api/examples/v201711/label_service/get_all_labels.rb b/dfp_api/examples/v201711/label_service/get_all_labels.rb index 38b4932dd..1387c68d1 100755 --- a/dfp_api/examples/v201711/label_service/get_all_labels.rb +++ b/dfp_api/examples/v201711/label_service/get_all_labels.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all labels. -require 'dfp_api' -class GetAllLabels +require 'dfp_api' - def self.run_example(dfp) - label_service = - dfp.service(:LabelService, :v201711) +def get_all_labels(dfp) + # Get the LabelService. + label_service = dfp.service(:LabelService, API_VERSION) - # Create a statement to select labels. - statement = DfpApi::FilterStatement.new() + # Create a statement to select labels. + statement = dfp.new_statement_builder() - # Retrieve a small amount of labels at a time, paging - # through until all labels have been retrieved. - total_result_set_size = 0; - begin - page = label_service.get_labels_by_statement( - statement.toStatement()) + # Retrieve a small amount of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} + begin + page = label_service.get_labels_by_statement( + statement.to_statement() + ) - # Print out some information for each label. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |label, index| - puts "%d) Label with ID %d and name '%s' was found." % [ - index + statement.offset, - label[:id], - label[:name] - ] - end + # Print out some information for each label. + unless page[:results].nil? + page[:results].each_with_index do |label, index| + puts '%d) Label with ID %d and name "%s" was found.' % + [index + statement.offset, label[:id], label[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of labels: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of labels: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_labels(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllLabels.main() -end diff --git a/dfp_api/examples/v201711/label_service/update_labels.rb b/dfp_api/examples/v201711/label_service/update_labels.rb index 8cc5aeef2..c3df85c67 100755 --- a/dfp_api/examples/v201711/label_service/update_labels.rb +++ b/dfp_api/examples/v201711/label_service/update_labels.rb @@ -23,60 +23,59 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_labels(dfp) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create a statement to only select active labels. - statement = DfpApi::FilterStatement.new( - 'WHERE isActive = :is_active', - [ - {:key => 'is_active', - :value => { - :value => 'true', - :xsi_type => 'BooleanValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end + page = {:total_result_set_size => 0} begin # Get labels by statement. - page = label_service.get_labels_by_statement(statement.toStatement()) + page = label_service.get_labels_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 # Update each local label object by changing its description. page[:results].each do |label| label[:description] = 'This label was updated' end # Update the labels on the server. - return_labels = label_service.update_labels(labels) + updated_labels = label_service.update_labels(labels) - if return_labels - return_labels.each do |label| - puts("Label ID: %d, name: %s was updated with description: %s.") % + if updated_labels.to_a.size > 0 + updated_labels.each do |label| + puts('Label ID %d and name "%s" was updated with description "%s".') % [label[:id], label[:name], label[:description]] end else - raise 'No labels were updated.' + puts 'No labels were updated.' end + else + puts 'No labels were found to update.' end - end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_labels() + update_labels(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_creative_association_service/create_licas.rb b/dfp_api/examples/v201711/line_item_creative_association_service/create_licas.rb index bb17547c9..e95960cb8 100755 --- a/dfp_api/examples/v201711/line_item_creative_association_service/create_licas.rb +++ b/dfp_api/examples/v201711/line_item_creative_association_service/create_licas.rb @@ -25,29 +25,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_licas(dfp, line_item_id, creative_ids) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Get the CreativeService. - creative_service = dfp.service(:CreativeService, API_VERSION) - - # Set the line item ID and creative IDs to associate. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - creative_ids = [ - 'INSERT_CREATIVE_ID_HERE'.to_i, - 'INSERT_CREATIVE_ID_HERE'.to_i - ] - # Create an array to store local LICA objects. licas = creative_ids.map do |creative_id| # For each line item, associate it with the given creative. @@ -55,22 +36,35 @@ def create_licas() end # Create the LICAs on the server. - return_licas = lica_service.create_line_item_creative_associations(licas) + created_licas = lica_service.create_line_item_creative_associations(licas) - if return_licas - return_licas.each do |lica| - puts ("LICA with line item ID: %d, creative ID: %d and status: %s was " + - "created.") % [lica[:line_item_id], lica[:creative_id], lica[:status]] + if created_licas.to_a.size > 0 + created_licas.each do |lica| + puts ('LICA with line item ID %d, creative ID %d, and status "%s" was ' + + 'created.') % [lica[:line_item_id], lica[:creative_id], lica[:status]] end else - raise 'No LICAs were created.' + puts 'No LICAs were created.' end - end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + creative_ids = [ + 'INSERT_CREATIVE_ID_HERE'.to_i, + 'INSERT_CREATIVE_ID_HERE'.to_i + ] + create_licas(dfp, line_item_id, creative_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_creative_association_service/deactivate_licas.rb b/dfp_api/examples/v201711/line_item_creative_association_service/deactivate_licas.rb index 99c368771..a775c4657 100755 --- a/dfp_api/examples/v201711/line_item_creative_association_service/deactivate_licas.rb +++ b/dfp_api/examples/v201711/line_item_creative_association_service/deactivate_licas.rb @@ -16,73 +16,66 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example deactivates all LICAs for the line item. To determine which LICAs -# exist, run get_all_licas.rb. To determine which line items exist, run -# get_all_line_items.rb. +# This example deactivates all line item creative associations (LICAs) for the +# line item. To determine which LICAs exist, run get_all_licas.rb. To determine +# which line items exist, run get_all_line_items.rb. require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_licas(dfp, line_item_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Set the line item to get LICAs by. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create statement to select active LICAs for a given line item. - statement = DfpApi::FilterStatement.new( - 'WHERE lineItemId = :line_item_id AND status = :status', - [ - {:key => 'line_item_id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}}, - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id AND status = :status' + sb.with_bind_variable('line_item_id', line_item_id) + sb.with_bind_variable('status', 'ACTIVE') + end creative_ids = [] + # Retrieve a small number of LICAs at a time, paging + # through until all LICAs have been retrieved. + page = {:total_result_set_size => 0} begin # Get LICAs by statement. page = lica_service.get_line_item_creative_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |lica| - puts ("%d) LICA with line item ID: %d, creative ID: %d and status: %s" + - " will be deactivated.") % [creative_ids.size, lica[:line_item_id], + puts ('%d) LICA with line item ID %d, creative ID %d and status "%s"' + + ' will be deactivated.') % [creative_ids.size, lica[:line_item_id], lica[:creative_id], lica[:status]] creative_ids << lica[:creative_id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of LICAs to be deactivated: %d" % creative_ids.size + puts 'Number of LICAs to be deactivated: %d' % creative_ids.size if !creative_ids.empty? - # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE creativeId IN (%s)" % creative_ids.join(', ')) + # Create statement for action. + statement = dfp.new_statement_builder do |sb| + sb.where = 'creativeId IN (%s)' % creative_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = lica_service.perform_line_item_creative_association_action( {:xsi_type => 'DeactivateLineItemCreativeAssociations'}, - statement.toStatement()) + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of LICAs deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of LICAs deactivated: %d' % result[:num_changes] else puts 'No LICAs were deactivated.' end @@ -92,8 +85,18 @@ def deactivate_licas() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + deactivate_licas(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_creative_association_service/get_all_licas.rb b/dfp_api/examples/v201711/line_item_creative_association_service/get_all_licas.rb new file mode 100755 index 000000000..5cb2ce71e --- /dev/null +++ b/dfp_api/examples/v201711/line_item_creative_association_service/get_all_licas.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item creative associations (LICAs). + +require 'dfp_api' + +def get_all_licas(dfp) + # Get the LineItemCreativeAssociationService. + lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) + + # Create a statement to select all LICAs. + statement = dfp.new_statement_builder() + + # Retrieve a small number of LICAs at a time, paging through until all LICAs + # have been retrieved. + begin + # Get LICAs by statement. + page = lica_service.get_line_item_creative_associations_by_statement( + statement.to_statement() + ) + + # Display some information about each LICA. + unless page[:results].nil? + page[:results].each do |lica| + if lica[:creative_set_id].nil? + puts 'LICA with line item ID %d and creative ID %d was found.' % + [lica[:line_item_id], lica[:creative_id]] + else + puts ('LICA with line item ID %d, creative set ID %d, and status ' + + '"%s" was found.') % [lica[:line_item_id], lica[:creative_set_id], + lica[:status]] + end + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_licas(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/line_item_creative_association_service/get_licas_for_line_item.rb b/dfp_api/examples/v201711/line_item_creative_association_service/get_licas_for_line_item.rb new file mode 100755 index 000000000..fe0a044fd --- /dev/null +++ b/dfp_api/examples/v201711/line_item_creative_association_service/get_licas_for_line_item.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item creative associations (LICAs) for a given +# line item. + +require 'dfp_api' + +def get_licas_for_line_item(dfp, line_item_id) + # Get the LineItemCreativeAssociationService. + lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) + + # Create a statement to select all LICAs. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + end + + # Retrieve a small number of LICAs at a time, paging through until all LICAs + # have been retrieved. + begin + # Get LICAs by statement. + page = lica_service.get_line_item_creative_associations_by_statement( + statement.to_statement() + ) + + # Display some information about each LICA. + unless page[:results].nil? + page[:results].each do |lica| + if lica[:creative_set_id].nil? + puts 'LICA with line item ID %d and creative ID %d was found.' % + [lica[:line_item_id], lica[:creative_id]] + else + puts ('LICA with line item ID %d, creative set ID %d, and status ' + + '"%s" was found.') % [lica[:line_item_id], lica[:creative_set_id], + lica[:status]] + end + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + get_licas_for_line_item(dfp, line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/line_item_creative_association_service/update_licas.rb b/dfp_api/examples/v201711/line_item_creative_association_service/update_licas.rb index fb9df5fbc..19305c63a 100755 --- a/dfp_api/examples/v201711/line_item_creative_association_service/update_licas.rb +++ b/dfp_api/examples/v201711/line_item_creative_association_service/update_licas.rb @@ -16,58 +16,44 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates the destination URL of all LICAs belonging to a line item. -# To determine which LICAs exist, run get_all_licas.rb. +# This example updates the destination URL of all LICAs belonging to a line +# item. To determine which LICAs exist, run get_all_licas.rb. require 'dfp_api' - -API_VERSION = :v201711 - -def update_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_licas(dfp, line_item_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Set the line item to get LICAs by. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create a statement to only select LICAs for the given line item ID. - statement = DfpApi::FilterStatement.new( - 'WHERE lineItemId = :line_item_id ORDER BY lineItemId, creativeId ASC', - [ - {:key => 'line_item_id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.order_by = 'creativeId' + end # Get LICAs by statement. page = lica_service.get_line_item_creative_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + if page[:results].to_a.size > 0 licas = page[:results] # Update each local LICA object by changing its destination URL. licas.each {|lica| lica[:destination_url] = 'http://news.google.com'} # Update the LICAs on the server. - return_licas = lica_service.update_line_item_creative_associations(licas) + updated_licas = lica_service.update_line_item_creative_associations(licas) - if return_licas - return_licas.each do |lica| - puts ("LICA with line item ID: %d and creative ID: %d was updated " + - "with destination url [%s]") % - [lica[:line_item_id], lica[:creative_id], lica[:destination_url]] + if updated_licas.to_a.size > 0 + updated_licas.each do |lica| + puts ('LICA with line item ID %d and creative ID %d was updated ' + + 'with destination url "%s".') % [lica[:line_item_id], + lica[:creative_id], lica[:destination_url]] end else - raise 'No LICAs were updated.' + puts 'No LICAs were updated.' end else puts 'No LICAs found to update.' @@ -75,8 +61,18 @@ def update_licas() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + update_licas(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_service/activate_line_items.rb b/dfp_api/examples/v201711/line_item_service/activate_line_items.rb index fc6007b13..d7f3208f9 100755 --- a/dfp_api/examples/v201711/line_item_service/activate_line_items.rb +++ b/dfp_api/examples/v201711/line_item_service/activate_line_items.rb @@ -25,68 +25,61 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def activate_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def activate_line_items(dfp, order_id) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the order to get line items from. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to only select line items from the specified order that # are in the approved (needs creatives) state. - statement = DfpApi::FilterStatement.new( - 'WHERE orderID = :order_id AND status = :status', - [ - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}}, - {:key => 'status', - :value => {:value => 'NEEDS_CREATIVES', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'orderId = :order_id AND status = :status' + sb.with_bind_variable('order_id', order_id) + sb.with_bind_variable('status', 'NEEDS_CREATIVES') + end line_item_ids = [] + # Retrieve a small number of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} begin # Get line items by statement. page = line_item_service.get_line_items_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |line_item| - if !line_item[:is_archived] - puts ("%d) Line item with ID: %d, order ID: %d and name: %s will " + - "be activated.") % [line_item_ids.size, line_item[:id], + unless line_item[:is_archived] + puts ('%d) Line item with ID %d, order ID %d and name "%s" will ' + + 'be activated.') % [line_item_ids.size, line_item[:id], line_item[:order_id], line_item[:name]] line_item_ids << line_item[:id] end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] puts "Number of line items to be activated: %d" % line_item_ids.size if !line_item_ids.empty? - # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % line_item_ids.join(', ')) + # Create statement for action. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % line_item_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = line_item_service.perform_line_item_action( - {:xsi_type => 'ActivateLineItems'}, statement.toStatement()) + {:xsi_type => 'ActivateLineItems'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of line items activated: %d" % result[:num_changes] else puts 'No line items were activated.' @@ -97,8 +90,18 @@ def activate_line_items() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - activate_line_items() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + activate_line_items(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_service/create_line_items.rb b/dfp_api/examples/v201711/line_item_service/create_line_items.rb index 8855401e9..514fdac92 100755 --- a/dfp_api/examples/v201711/line_item_service/create_line_items.rb +++ b/dfp_api/examples/v201711/line_item_service/create_line_items.rb @@ -23,46 +23,30 @@ # get_all_cities.rb, get_all_countries.rb, get_all_metros.rb and # get_all_regions.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of line items to create. -ITEM_COUNT = 5 - -def create_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_line_items(dfp, order_id, targeted_placement_ids, + number_of_line_items_to_create) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the order that all created line items will belong to and the placement - # ID to target. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - targeted_placement_ids = Array.new(ITEM_COUNT) do - 'INSERT_PLACEMENT_ID_HERE'.to_i - end - # Create inventory targeting. inventory_targeting = {:targeted_placement_ids => targeted_placement_ids} # Create geographical targeting. geo_targeting = { - # Include targets. - :targeted_locations => [ - {:id => 2840}, # USA. - {:id => 20123}, # Quebec, Canada. - {:id => 9000093} # Postal code B3P (Canada). - ], - # Exclude targets. - :excluded_locations => [ - {:id => 1016367}, # Chicago. - {:id => 200501} # New York. - ] + # Include targets. + :targeted_locations => [ + {:id => 2840}, # USA. + {:id => 20123}, # Quebec, Canada. + {:id => 9000093} # Postal code B3P (Canada). + ], + # Exclude targets. + :excluded_locations => [ + {:id => 1016367}, # Chicago. + {:id => 200501} # New York. + ] } # Create user domain targeting. Exclude domains that are not under the @@ -71,98 +55,108 @@ def create_line_items() # Create day-part targeting. day_part_targeting = { - # Target only the weekend in the browser's timezone. - :time_zone => 'BROWSER', - :day_parts => [ - {:day_of_week => 'SATURDAY', - :start_time => {:hour => 0, :minute => 'ZERO'}, - :end_time => {:hour => 24, :minute => 'ZERO'}}, - {:day_of_week => 'SUNDAY', - :start_time => {:hour => 0, :minute => 'ZERO'}, - :end_time => {:hour => 24, :minute => 'ZERO'}} - ] + # Target only the weekend in the browser's timezone. + :time_zone => 'BROWSER', + :day_parts => [ + { + :day_of_week => 'SATURDAY', + :start_time => {:hour => 0, :minute => 'ZERO'}, + :end_time => {:hour => 24, :minute => 'ZERO'} + }, + { + :day_of_week => 'SUNDAY', + :start_time => {:hour => 0, :minute => 'ZERO'}, + :end_time => {:hour => 24, :minute => 'ZERO'} + } + ] } # Create technology targeting. technology_targeting = { - # Create browser targeting. - :browser_targeting => { - :is_targeted => true, - # Target just the Chrome browser. - :browsers => [{:id => 500072}] - } + # Create browser targeting. + :browser_targeting => { + :is_targeted => true, + # Target just the Chrome browser. + :browsers => [{:id => 500072}] + } } # Create targeting. - targeting = {:geo_targeting => geo_targeting, - :inventory_targeting => inventory_targeting, - :user_domain_targeting => user_domain_targeting, - :day_part_targeting => day_part_targeting, - :technology_targeting => technology_targeting + targeting = { + :geo_targeting => geo_targeting, + :inventory_targeting => inventory_targeting, + :user_domain_targeting => user_domain_targeting, + :day_part_targeting => day_part_targeting, + :technology_targeting => technology_targeting } # Create an array to store local line item objects. - line_items = (1..ITEM_COUNT).map do |index| - line_item = {:name => "Line item #%d-%d" % [Time.new.to_f * 1000, index], - :order_id => order_id, - :targeting => targeting, - :line_item_type => 'STANDARD', - :allow_overbook => true} - # Set the creative rotation type to even. - line_item[:creative_rotation_type] = 'EVEN' - - # Create the creative placeholder. - creative_placeholder = { + line_items = (1..number_of_line_items_to_create).map do |index| + { + :name => "Line item #%d - %d" % [index, SecureRandom.uuid()], + :order_id => order_id, + :targeting => targeting, + :line_item_type => 'STANDARD', + :allow_overbook => true, + :creative_rotation_type => 'EVEN' + # Set the size of creatives that can be associated with this line item. + :creative_placeholders => [{ :size => {:width => 300, :height => 250, :is_aspect_ratio => false} - } - - # Set the size of creatives that can be associated with this line item. - line_item[:creative_placeholders] = [creative_placeholder] - - # Set the length of the line item to run. - line_item[:start_date_time_type] = 'IMMEDIATELY' - line_item[:end_date_time] = {:date => {:year => Time.now.year + 1, - :month => 9, - :day => 30}, - :hour => 0, - :minute => 0, - :second => 0, - :time_zone_id => 'America/Los_Angeles'} - - # Set the cost per unit to $2. - line_item[:cost_type] = 'CPM' - line_item[:cost_per_unit] = { + }], + # Set the length of the line item to run. + :start_date_time_type => 'IMMEDIATELY' + :end_date_time => dfp.datetime( + Date.today.year + 1, 9, 30, 0, 0, 0, 'America/New_York' + ).to_h, + # Set the cost per unit to $2. + :cost_type => 'CPM', + :cost_per_unit => { :currency_code => 'USD', - :micro_amount => 2000000 - } - - # Set the number of units bought to 500,000 so that the budget is $1,000. - line_item[:primary_goal] = { - :units => '500000', + :micro_amount => 2_000_000 + }, + # Set the number of units bought to 500,000 so that the budget is $1,000. + line_item[:primary_goal] = { + :units => 500_000, :unit_type => 'IMPRESSIONS', :goal_type => 'LIFETIME' + } } - - line_item end # Create the line items on the server. - return_line_items = line_item_service.create_line_items(line_items) + created_line_items = line_item_service.create_line_items(line_items) - if return_line_items - return_line_items.each do |line_item| - puts ("Line item with ID: %d, belonging to order ID: %d, " + - "and named: %s was created.") % - [line_item[:id], line_item[:order_id], line_item[:name]] + if created_line_items.to_a.size > 0 + created_line_items.each do |line_item| + puts ('Line item with ID %d, belonging to order ID %d, and named "%s" ' + + 'was created.') % [line_item[:id], line_item[:order_id], + line_item[:name]] end else - raise 'No line items were created.' + puts 'No line items were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_line_items() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + targeted_placement_ids = [ + 'INSERT_PLACEMENT_ID_HERE'.to_i, + 'INSERT_PLACEMENT_ID_HERE'.to_i + ] + number_of_line_items_to_create = 5 + create_line_items( + dfp, order_id, targeted_placement_ids, number_of_line_items_to_create + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_service/create_video_line_item.rb b/dfp_api/examples/v201711/line_item_service/create_video_line_item.rb index 88577ab58..04d2b4223 100755 --- a/dfp_api/examples/v201711/line_item_service/create_video_line_item.rb +++ b/dfp_api/examples/v201711/line_item_service/create_video_line_item.rb @@ -26,50 +26,27 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_video_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_video_line_item(dfp, order_id, targeted_video_ad_unit_id, + content_custom_targeting_key_id, content_custom_targeting_value_id) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the order that the created line item will belong to and the video ad - # unit ID to target. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - targeted_video_ad_unit_id = 'INSERT_VIDEO_AD_UNIT_ID_HERE'.to_s - - # Set the custom targeting key ID and value ID representing the metadata on - # the content to target. This would typically be a key representing a "genre" - # and a value representing something like "comedy". - content_custom_targeting_key_id = - 'INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - content_custom_targeting_value_id = - 'INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i - # Create custom criteria for the content metadata targeting. content_custom_criteria = { - :xsi_type => 'CustomCriteria', - :key_id => content_custom_targeting_key_id, - :value_ids => [content_custom_targeting_value_id], - :operator => 'IS' + :xsi_type => 'CustomCriteria', + :key_id => content_custom_targeting_key_id, + :value_ids => [content_custom_targeting_value_id], + :operator => 'IS' } # Create custom criteria set. custom_criteria_set = { - :children => [content_custom_criteria] + :children => [content_custom_criteria] } # Create inventory targeting. inventory_targeting = { - :targeted_ad_units => [ - {:ad_unit_id => targeted_video_ad_unit_id} - ] + :targeted_ad_units => [{:ad_unit_id => targeted_video_ad_unit_id}] } # Create video position targeting. @@ -79,72 +56,90 @@ def create_video_line_item() # Create targeting. targeting = { - :custom_targeting => custom_criteria_set, - :inventory_targeting => inventory_targeting, - :video_position_targeting => video_position_targeting + :custom_targeting => custom_criteria_set, + :inventory_targeting => inventory_targeting, + :video_position_targeting => video_position_targeting } # Create local line item object. line_item = { - :name => 'Video line item', - :order_id => order_id, - :targeting => targeting, - :line_item_type => 'SPONSORSHIP', - :allow_overbook => true, - # Set the environment type to video. - :environment_type => 'VIDEO_PLAYER', - # Set the creative rotation type to optimized. - :creative_rotation_type => 'OPTIMIZED', - # Set delivery of video companions to optional. - :companion_delivery_option => 'OPTIONAL', - # Set the length of the line item to run. - :start_date_time_type => 'IMMEDIATELY', - line_item[:end_date_time] = {:date => {:year => Time.now.year + 1, - :month => 9, - :day => 30}, - :hour => 0, - :minute => 0, - :second => 0, - :time_zone_id => 'America/Los_Angeles'} - # Set the cost per day to $1. - :cost_type => 'CPD', - :cost_per_unit => {:currency_code => 'USD', :micro_amount => 1000000}, - # Set the percentage to be 100%. - :primary_goal => { - :units => '100', - :unit_type => 'IMPRESSIONS', - :goal_type => 'DAILY' - } + :name => 'Video line item', + :order_id => order_id, + :targeting => targeting, + :line_item_type => 'SPONSORSHIP', + :allow_overbook => true, + # Set the environment type to video. + :environment_type => 'VIDEO_PLAYER', + # Set the creative rotation type to optimized. + :creative_rotation_type => 'OPTIMIZED', + # Set delivery of video companions to optional. + :companion_delivery_option => 'OPTIONAL', + # Set the length of the line item to run. + :start_date_time_type => 'IMMEDIATELY', + :end_date_time => dfp.datetime( + Date.today.year + 1, 9, 30, 0, 0, 0, 'America/New_York' + ).to_h, + # Set the cost per day to $1. + :cost_type => 'CPD', + :cost_per_unit => {:currency_code => 'USD', :micro_amount => 1_000_000}, + # Set the percentage to be 100%. + :primary_goal => { + :units => 100, + :unit_type => 'IMPRESSIONS', + :goal_type => 'DAILY' + } } # Create the master creative placeholder and companion creative placeholders. creative_master_placeholder = { - :size => {:width => 400, :height => 300, :is_aspect_ratio => false}, - :companions => [ - {:size => {:width => 300, :height => 250, :is_aspect_ratio => false}}, - {:size => {:width => 728, :height => 90, :is_aspect_ratio => false}} - ] + :size => {:width => 400, :height => 300, :is_aspect_ratio => false}, + :companions => [ + {:size => {:width => 300, :height => 250, :is_aspect_ratio => false}}, + {:size => {:width => 728, :height => 90, :is_aspect_ratio => false}} + ] } # Set the size of creatives that can be associated with this line item. line_item[:creative_placeholders] = [creative_master_placeholder] # Create the line item on the server. - return_line_item = line_item_service.create_line_item(line_item) + created_line_item = line_item_service.create_line_item(line_item) - if return_line_item - puts(("Line item with ID: %d, belonging to order ID: %d, " + - "and named: %s was created.") % - [return_line_item[:id], return_line_item[:order_id], - return_line_item[:name]]) + if created_line_item.to_a.size > 0 + puts ('Line item with ID %d, belonging to order ID %d, and named "%s" ' + + 'was created.') % [created_line_item[:id], created_line_item[:order_id], + created_line_item[:name]] else - raise 'No line items were created.' + puts 'No line items were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_video_line_item() + # Set the order that the created line item will belong to and the video ad + # unit ID to target. + order_id = 'INSERT_ORDER_ID_HERE'.to_i + targeted_video_ad_unit_id = 'INSERT_VIDEO_AD_UNIT_ID_HERE'.to_i + # Set the custom targeting key ID and value ID representing the metadata on + # the content to target. This would typically be a key representing a + # "genre" and a value representing something like "comedy". + content_custom_targeting_key_id = + 'INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + content_custom_targeting_value_id = + 'INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i + create_video_line_item( + dfp, order_id, targeted_video_ad_unit_id, + content_custom_targeting_key_id, content_custom_targeting_value_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_service/get_all_line_items.rb b/dfp_api/examples/v201711/line_item_service/get_all_line_items.rb index e3d04ef49..4cc2f1862 100755 --- a/dfp_api/examples/v201711/line_item_service/get_all_line_items.rb +++ b/dfp_api/examples/v201711/line_item_service/get_all_line_items.rb @@ -17,71 +17,64 @@ # limitations under the License. # # This example gets all line items. -require 'dfp_api' -class GetAllLineItems +require 'dfp_api' - def self.run_example(dfp) - line_item_service = - dfp.service(:LineItemService, :v201711) +def get_all_line_items(dfp) + line_item_service = dfp.service(:LineItemService, API_VERSION) - # Create a statement to select line items. - statement = DfpApi::FilterStatement.new() + # Create a statement to select line items. + statement = dfp.new_statement_builder() - # Retrieve a small amount of line items at a time, paging - # through until all line items have been retrieved. - total_result_set_size = 0; - begin - page = line_item_service.get_line_items_by_statement( - statement.toStatement()) + # Retrieve a small amount of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) - # Print out some information for each line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |line_item, index| - puts "%d) Line item with ID %d and name '%s' was found." % [ - index + statement.offset, - line_item[:id], - line_item[:name] - ] - end + # Print out some information for each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts '%d) Line item with ID %d and name "%s" was found.' % + [index + statement.offset, line_item[:id], line_item[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of line items: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of line items: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllLineItems.main() -end diff --git a/dfp_api/examples/v201711/line_item_service/get_line_items_that_need_creatives.rb b/dfp_api/examples/v201711/line_item_service/get_line_items_that_need_creatives.rb index c065af355..9437ddf21 100755 --- a/dfp_api/examples/v201711/line_item_service/get_line_items_that_need_creatives.rb +++ b/dfp_api/examples/v201711/line_item_service/get_line_items_that_need_creatives.rb @@ -17,81 +17,67 @@ # limitations under the License. # # This example gets all line items that are missing creatives. -require 'dfp_api' -class GetLineItemsThatNeedCreatives +require 'dfp_api' - def self.run_example(dfp) - line_item_service = - dfp.service(:LineItemService, :v201711) +def get_line_items_that_need_creatives(dfp) + line_item_service = dfp.service(:LineItemService, API_VERSION) - # Create a statement to select line items. - query = 'WHERE isMissingCreatives = :isMissingCreatives' - values = [ - { - :key => 'isMissingCreatives', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'isMissingCreatives = :is_missing_creatives' + sb.with_bind_variable('is_missing_creatives', true) + end - # Retrieve a small amount of line items at a time, paging - # through until all line items have been retrieved. - total_result_set_size = 0; - begin - page = line_item_service.get_line_items_by_statement( - statement.toStatement()) + # Retrieve a small amount of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) - # Print out some information for each line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |line_item, index| - puts "%d) Line item with ID %d and name '%s' was found." % [ - index + statement.offset, - line_item[:id], - line_item[:name] - ] - end + # Print out some information for each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts '%d) Line item with ID %d and name "%s" was found.' % + [index + statement.offset, line_item[:id], line_item[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of line items: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_line_items_that_need_creatives(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetLineItemsThatNeedCreatives.main() -end diff --git a/dfp_api/examples/v201711/line_item_service/get_recently_updated_line_items.rb b/dfp_api/examples/v201711/line_item_service/get_recently_updated_line_items.rb new file mode 100755 index 000000000..7a03304ea --- /dev/null +++ b/dfp_api/examples/v201711/line_item_service/get_recently_updated_line_items.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets only recently updated line items. + +require 'dfp_api' + +def get_recently_updated_line_items(dfp) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a DfpDateTime representing 24 hours in the past. + yesterday = dfp.now('America/New_York') - 24 * 60 * 60 + + # Create a statement to select line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lastModifiedDateTime >= :last_modified_date_time' + sb.with_bind_variable('last_modified_date_time', yesterday) + end + + # Retrieve a small number of line items at a time, paging through until all + # line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get line items by statement. + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts "%d) Line item with ID %d and name '%s' was found." % + [index + statement.offset, line_item[:id], line_item[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_recently_updated_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/line_item_service/pause_line_item.rb b/dfp_api/examples/v201711/line_item_service/pause_line_item.rb new file mode 100755 index 000000000..119335c3f --- /dev/null +++ b/dfp_api/examples/v201711/line_item_service/pause_line_item.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example pauses a line item. Line items must be paused before they can be +# updated. To determine which line items exist, run get_all_line_items.rb. + +require 'dfp_api' + +def pause_line_item(dfp, line_item_id) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a statement to select the line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + end + + # Retrieve a small number of line items at a time, paging through until all + # line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get line items by statement. + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each line item. + unless page[:results].nil? + page[:results].each do |line_item| + puts ("Line item with ID: %d, order ID: %d and name: %s will " + + "be paused.") % [line_item[:id], line_item[:order_id], + line_item[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts "Number of line items to be paused: %d" % page[:total_result_set_size] + + # Perform action. + result = line_item_service.perform_line_item_action( + {:xsi_type => 'PauseLineItems'}, statement.to_statement() + ) + + # Display results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of line items paused: %d" % result[:num_changes] + else + puts 'No line items were paused.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + line_item_id = 'INSERT_line_item_id_here'.to_i + pause_line_item(dfp, line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/line_item_service/target_custom_criteria.rb b/dfp_api/examples/v201711/line_item_service/target_custom_criteria.rb index 35e21f2d7..813dfa206 100755 --- a/dfp_api/examples/v201711/line_item_service/target_custom_criteria.rb +++ b/dfp_api/examples/v201711/line_item_service/target_custom_criteria.rb @@ -16,111 +16,109 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates a line item to add custom criteria targeting. To -# determine which line items exist, run get_all_line_items.rb. To determine +# This example updates a line item to add custom criteria targeting. The custom +# criteria set will be structured as follows: +# +# (custom_criteria[0].key == custom_criteria[0].values OR +# (custom_criteria[1].key != custom_criteria[1].values AND +# custom_criteria[2].key == custom_criteria[2].values)) +# +# To determine which line items exist, run get_all_line_items.rb. To determine # which custom targeting keys and values exist, run # get_all_custom_targeting_keys_and_values.rb. require 'dfp_api' - - require 'pp' -API_VERSION = :v201711 -PAGE_SIZE = 500 - -def target_custom_criteria() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def target_custom_criteria(dfp, line_item_id, custom_criteria_ids) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the line item to update targeting. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - - # Set the IDs of the custom targeting keys. - custom_criteria_ids = [ - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]} - ] - # Create custom criteria. custom_criteria = [ - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[0][:key], - :value_ids => custom_criteria_ids[0][:values], - :operator => 'IS'}, - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[1][:key], - :value_ids => custom_criteria_ids[1][:values], - :operator => 'IS_NOT'}, - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[2][:key], - :value_ids => custom_criteria_ids[2][:values], - :operator => 'IS'} + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[0][:key], + :value_ids => custom_criteria_ids[0][:values], + :operator => 'IS' + }, + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[1][:key], + :value_ids => custom_criteria_ids[1][:values], + :operator => 'IS_NOT' + }, + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[2][:key], + :value_ids => custom_criteria_ids[2][:values], + :operator => 'IS' + } ] - # Create the custom criteria set that will resemble: - # - # (custom_criteria[0].key == custom_criteria[0].values OR - # (custom_criteria[1].key != custom_criteria[1].values AND - # custom_criteria[2].key == custom_criteria[2].values)) sub_custom_criteria_set = { - :xsi_type => 'CustomCriteriaSet', - :logical_operator => 'AND', - :children => [custom_criteria[1], custom_criteria[2]] + :xsi_type => 'CustomCriteriaSet', + :logical_operator => 'AND', + :children => [custom_criteria[1], custom_criteria[2]] } top_custom_criteria_set = { - :xsi_type => 'CustomCriteriaSet', - :logical_operator => 'OR', - :children => [custom_criteria[0], sub_custom_criteria_set] + :xsi_type => 'CustomCriteriaSet', + :logical_operator => 'OR', + :children => [custom_criteria[0], sub_custom_criteria_set] } - # Create a statement to only select a single line item. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.limit = 1 + end # Get line items by statement. - page = line_item_service.get_line_items_by_statement(statement.toStatement()) - - if page[:results] - line_item = page[:results].first + response = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + raise 'No line item found to update.' if response[:results].to_a.empty? + line_item = response[:results].first - line_item[:targeting][:custom_targeting] = top_custom_criteria_set + line_item[:targeting][:custom_targeting] = top_custom_criteria_set - # Update the line items on the server. - return_line_item = line_item_service.update_line_items([line_item]) + # Update the line items on the server. + updated_line_items = line_item_service.update_line_items([line_item]) - # Display the updated line item. - if return_line_item - puts "Line item ID: %d was updated with custom criteria targeting:" % - return_line_item[:id] - pp return_line_item[:targeting] - else - puts 'Line item update failed.' + # Display the updated line item. + if updated_line_items.to_a.size > 0 + updated_line_items.each do |line_item| + puts 'Line item with ID %d was updated with custom criteria targeting:' % + line_item[:id] + pp line_item[:targeting] end + else + puts 'No line items were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - target_custom_criteria() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + custom_criteria_ids = [ + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]} + ] + target_custom_criteria(dfp, line_item_id, custom_criteria_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/line_item_service/update_line_items.rb b/dfp_api/examples/v201711/line_item_service/update_line_items.rb index abdea0497..85a3afea9 100755 --- a/dfp_api/examples/v201711/line_item_service/update_line_items.rb +++ b/dfp_api/examples/v201711/line_item_service/update_line_items.rb @@ -22,45 +22,27 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_line_items(dfp, order_id) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the order to get line items from. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to get line items with even delivery rates. - statement = DfpApi::FilterStatement.new( - 'WHERE deliveryRateType = :delivery_rate_type AND ' + - 'orderId = :order_id ', - [ - {:key => 'delivery_rate_type', - :value => {:value => 'EVENLY', :xsi_type => 'TextValue'}}, - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'deliveryRateType = :delivery_rate_type AND orderId = :order_id' + sb.with_bind_variable('delivery_rate_type', 'EVENLY') + sb.with_bind_variable('order_id', order_id) + end # Get line items by statement. - page = line_item_service.get_line_items_by_statement(statement.toStatement()) + page = line_item_service.get_line_items_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 line_items = page[:results] # Update each local line item object by changing its delivery rate. new_line_items = line_items.inject([]) do |new_line_items, line_item| # Archived line items can not be updated. - if !line_item[:is_archived] + unless line_item[:is_archived] line_item[:delivery_rate_type] = 'AS_FAST_AS_POSSIBLE' new_line_items << line_item end @@ -68,16 +50,16 @@ def update_line_items() end # Update the line items on the server. - return_line_items = line_item_service.update_line_items(new_line_items) + updated_line_items = line_item_service.update_line_items(new_line_items) - if return_line_items - return_line_items.each do |line_item| - puts ("Line item ID: %d, order ID: %d, name: %s was updated with " + - "delivery rate: %s") % [line_item[:id], line_item[:order_id], - line_item[:name], line_item[:delivery_rate_type]] + if updated_line_items.to_a.size > 0 + updated_line_items.each do |line_item| + puts ('Line item ID %d, order ID %d, name "%s" was updated with ' + + 'delivery rate "%s".') % [line_item[:id], line_item[:order_id], + line_item[:name], line_item[:delivery_rate_type]] end else - raise 'No line items were updated.' + puts 'No line items were updated.' end else puts 'No line items found to update.' @@ -85,8 +67,18 @@ def update_line_items() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_line_items() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + update_line_items(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/native_style_service/create_native_styles.rb b/dfp_api/examples/v201711/native_style_service/create_native_styles.rb index 583071781..7ffb8dd02 100755 --- a/dfp_api/examples/v201711/native_style_service/create_native_styles.rb +++ b/dfp_api/examples/v201711/native_style_service/create_native_styles.rb @@ -18,23 +18,15 @@ # # Creates a native app install ad. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 - -def create_native_styles() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_native_styles(dfp) # Get the NativeStyleService. native_style_service = dfp.service(:NativeStyleService, API_VERSION) native_style = { - :name => 'Native style #%d' % (Time.new.to_f * 1000), + :name => 'Native style - %d' % SecureRandom.uuid(), :html_snippet => get_html(), :css_snippet => get_css(), # This is the creative template ID for the system-defined native app install @@ -49,14 +41,14 @@ def create_native_styles() # Create the native styles on the server. results = native_style_service.create_native_styles([native_style]) - if results + if results.to_a.size > 0 results.each_with_index do |style, index| - puts ("%d) Native style with ID %d, name '%s' and creative " + - "template ID %d was created.") % [index, style[:id], style[:name], + puts ('%d) Native style with ID %d, name "%s" and creative ' + + 'template ID %d was created.') % [index, style[:id], style[:name], style[:creative_template_id]] end else - raise 'No native styles were created.' + puts 'No native styles were created.' end end @@ -179,8 +171,17 @@ def get_css() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_native_styles() + create_native_styles(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/native_style_service/get_all_native_styles.rb b/dfp_api/examples/v201711/native_style_service/get_all_native_styles.rb index 79235947e..cac79263d 100755 --- a/dfp_api/examples/v201711/native_style_service/get_all_native_styles.rb +++ b/dfp_api/examples/v201711/native_style_service/get_all_native_styles.rb @@ -20,67 +20,63 @@ require 'dfp_api' +def get_all_native_styles(dfp) + # Get the NativeStyleService. + native_style_service = dfp.service(:NativeStyleService, API_VERSION) -class GetAllNativeStyles + # Create a statement to select native styles. + statement = dfp.new_statement_builder() - def self.run_example(dfp) - # Get the NativeStyleService. - native_style_service = dfp.service(:NativeStyleService, :v201711) + # Retrieve a small amount of native styles at a time, paging through until + # all of them have been retrieved. + page = {:total_result_set_size => 0} + begin + page = native_style_service.get_native_styles_by_statement( + statement.to_statement() + ) - # Create a statement to select native styles. - statement = DfpApi::FilterStatement.new() + # Print out some information for each native style. + unless page[:results].nil? + page[:results].each_with_index do |style, index| + puts ('%d) Native style with ID %d, name "%s", and creative ' + + 'template ID %d was found.') % [index + statement.offset, + style[:id], style[:name], style[:creative_template_id]] + end + end - # Retrieve a small amount of native styles at a time, paging through until - # all of them have been retrieved. - total_result_set_size = 0 - begin - page = native_style_service.get_native_styles_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size - # Print out some information for each native style. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |style, index| - puts ("%d) Native style with ID %d, name '%s' and creative " + - "template ID %d was found.") % [index + statement.offset, - style[:id], style[:name], style[:creative_template_id]] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size + puts 'Total number of native styles: %d' % page[:total_result_set_size] +end - puts 'Total number of native styles: %d' % total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_all_native_styles(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllNativeStyles.main() -end diff --git a/dfp_api/examples/v201711/network_service/get_all_networks.rb b/dfp_api/examples/v201711/network_service/get_all_networks.rb new file mode 100755 index 000000000..9a5efebe0 --- /dev/null +++ b/dfp_api/examples/v201711/network_service/get_all_networks.rb @@ -0,0 +1,65 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all networks which the current user can access. + +require 'dfp_api' + +def get_all_networks(dfp) + # Get the NetworkService. + network_service = dfp.service(:NetworkService, API_VERSION) + + # Get the current network. + networks = network_service.get_all_networks() + + # Display the results. + networks.each do |network| + puts 'Current network has network code %d and display name "%s".' % + [network[:network_code], network[:display_name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_networks(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/network_service/get_current_network.rb b/dfp_api/examples/v201711/network_service/get_current_network.rb index 2989be837..19f158bda 100755 --- a/dfp_api/examples/v201711/network_service/get_current_network.rb +++ b/dfp_api/examples/v201711/network_service/get_current_network.rb @@ -20,29 +20,29 @@ require 'dfp_api' -API_VERSION = :v201711 - -def get_current_network() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_current_network(dfp) # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the current network. network = network_service.get_current_network() - puts "Current network has network code %d and display name %s." % + puts 'Current network has network code %d and display name "%s".' % [network[:network_code], network[:display_name]] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_current_network() + get_current_network(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/network_service/make_test_network.rb b/dfp_api/examples/v201711/network_service/make_test_network.rb index c04104457..02bc3bca5 100755 --- a/dfp_api/examples/v201711/network_service/make_test_network.rb +++ b/dfp_api/examples/v201711/network_service/make_test_network.rb @@ -31,31 +31,31 @@ require 'dfp_api' -API_VERSION = :v201711 - -def make_test_network() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def make_test_network(dfp) # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Make a test network. network = network_service.make_test_network() - puts "Test network with network code %s and display name '%s' created." % + puts 'Test network with network code %s and display name "%s" created.' % [network[:network_code], network[:display_name]] - puts "You may now sign in at http://www.google.com/dfp/main?networkCode=%s" % + puts 'You may now sign in at http://www.google.com/dfp/main?networkCode=%s' % network[:network_code] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - make_test_network() + make_test_network(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/order_service/approve_orders.rb b/dfp_api/examples/v201711/order_service/approve_orders.rb index 6f0ae968e..21dfe29b5 100755 --- a/dfp_api/examples/v201711/order_service/approve_orders.rb +++ b/dfp_api/examples/v201711/order_service/approve_orders.rb @@ -19,67 +19,64 @@ # This example approves and overbooks all eligible draft or pending orders. To # determine which orders exist, run get_all_orders.rb. -require 'date' require 'dfp_api' - -API_VERSION = :v201711 -PAGE_SIZE = 500 - -def approve_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def approve_orders(dfp) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - # Create a statement text to select all eligible draft or pending orders. - statement = DfpApi::FilterStatement.new( - "WHERE status IN ('DRAFT', 'PENDING_APPROVAL') " + - "AND endDateTime >= :today AND isArchived = FALSE", - [ - {:key => 'today', - :value => {:value => Date.today.strftime('%Y-%m-%dT%H:%M:%S'), - :xsi_type => 'TextValue'}} - ] + # Create a DfpDateTime representing the start of the present day. + today = dfp.today() + start_of_today = dfp.datetime( + today.year, today.month, today.day, 0, 0, 0, 'America/New_York' ) + # Create a statement text to select all eligible draft or pending orders. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status IN (%s) AND endDateTime >= :start_of_today AND ' + + 'isArchived = :is_archived' % + ["'DRAFT'", "'PENDING_APPROVAL'"].join(', ') + sb.with_bind_variable('start_of_today', start_of_today) + sb.with_bind_variable('is_archived', false) + end + order_ids = [] + page = {:total_result_set_size => 0} begin # Get orders by statement. - page = order_service.get_orders_by_statement(statement.toStatement()) + page = order_service.get_orders_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |order, index| - puts ("%d) Order ID: %d, status: %s and name: %s will be " + - "approved.") % [index + statement.offset, - order[:id], order[:status], - order[:name]] + puts ('%d) Order ID %d, status "%s", and name "%s" will be ' + + 'approved.') % [index + statement.offset, order[:id], + order[:status], order[:name]] order_ids << order[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of orders to be approved: %d" % order_ids.size + puts 'Number of orders to be approved: %d' % order_ids.size if !order_ids.empty? # Create statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % order_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % order_ids.join(', ') + end # Perform action. result = order_service.perform_order_action( - {:xsi_type => 'ApproveAndOverbookOrders'}, statement.toStatement()) + {:xsi_type => 'ApproveAndOverbookOrders'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of orders approved: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of orders approved: %d' % result[:num_changes] else puts 'No orders were approved.' end @@ -89,8 +86,17 @@ def approve_orders() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - approve_orders() + approve_orders(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/order_service/create_orders.rb b/dfp_api/examples/v201711/order_service/create_orders.rb index 518f4af14..91a9c2bd8 100755 --- a/dfp_api/examples/v201711/order_service/create_orders.rb +++ b/dfp_api/examples/v201711/order_service/create_orders.rb @@ -21,54 +21,57 @@ # get_companies_by_statement.rb. To get salespeople and traffickers, run # get_all_users.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -# Number of orders to create. -ITEM_COUNT = 5 - -def create_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_orders(dfp, advertiser_id, salesperson_id, trafficker_id, + number_of_orders_to_create) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - # Set the advertiser (company), salesperson, and trafficker to assign to each - # order. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - salesperson_id = 'INSERT_SALESPERSON_ID_HERE'.to_i - trafficker_id = 'INSERT_TRAFFICKER_ID_HERE'.to_i - # Create an array to store local order objects. - orders = (1..ITEM_COUNT).map do |index| - {:name => "Order #%d" % index, - :advertiser_id => advertiser_id, - :salesperson_id => salesperson_id, - :trafficker_id => trafficker_id} + orders = (1..number_of_orders_to_create).map do |index| + { + :name => 'Order #%d - %d' % [index, SecureRandom.uuid()], + :advertiser_id => advertiser_id, + :salesperson_id => salesperson_id, + :trafficker_id => trafficker_id + } end # Create the orders on the server. - return_orders = order_service.create_orders(orders) + created_orders = order_service.create_orders(orders) - if return_orders - return_orders.each do |order| - puts "Order with ID: %d and name: %s was created." % + if created_orders + created_orders.each do |order| + puts 'Order with ID %d and name "%s" was created.' % [order[:id], order[:name]] end else - raise 'No orders were created.' + puts 'No orders were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_orders() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + salesperson_id = 'INSERT_SALESPERSON_ID_HERE'.to_i + trafficker_id = 'INSERT_TRAFFICKER_ID_HERE'.to_i + number_of_orders_to_create = 5 + create_orders( + dfp, advertiser_id, salesperson_id, trafficker_id, + number_of_orders_to_create + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/order_service/get_all_orders.rb b/dfp_api/examples/v201711/order_service/get_all_orders.rb index dc74f71db..b8d0432a5 100755 --- a/dfp_api/examples/v201711/order_service/get_all_orders.rb +++ b/dfp_api/examples/v201711/order_service/get_all_orders.rb @@ -17,71 +17,64 @@ # limitations under the License. # # This example gets all orders. -require 'dfp_api' -class GetAllOrders +require 'dfp_api' - def self.run_example(dfp) - order_service = - dfp.service(:OrderService, :v201711) +def get_all_orders(dfp) + order_service = dfp.service(:OrderService, API_VERSION) - # Create a statement to select orders. - statement = DfpApi::FilterStatement.new() + # Create a statement to select orders. + statement = dfp.new_statement_builder() - # Retrieve a small amount of orders at a time, paging - # through until all orders have been retrieved. - total_result_set_size = 0; - begin - page = order_service.get_orders_by_statement( - statement.toStatement()) + # Retrieve a small amount of orders at a time, paging + # through until all orders have been retrieved. + page = {:total_result_set_size => 0} + begin + page = order_service.get_orders_by_statement( + statement.to_statement() + ) - # Print out some information for each order. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |order, index| - puts "%d) Order with ID %d and name '%s' was found." % [ - index + statement.offset, - order[:id], - order[:name] - ] - end + # Print out some information for each order. + unless page[:results].nil? + page[:results].each_with_index do |order, index| + puts '%d) Order with ID %d and name "%s" was found.' % + [index + statement.offset, order[:id], order[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of orders: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of orders: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_orders(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllOrders.main() -end diff --git a/dfp_api/examples/v201711/order_service/get_orders_starting_soon.rb b/dfp_api/examples/v201711/order_service/get_orders_starting_soon.rb new file mode 100755 index 000000000..8642581d0 --- /dev/null +++ b/dfp_api/examples/v201711/order_service/get_orders_starting_soon.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all orders that are starting soon. + +require 'dfp_api' + +def get_orders_starting_soon(dfp) + # Get the OrderService. + order_service = dfp.service(:OrderService, API_VERSION) + + # Create DfpDateTime objects for now and 5 days from now. + now = dfp.now("America/New_York") + five_days_from_now = now + 5 * 24 * 60 * 60 + + # Create a statement to select orders. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status AND startDateTime >= :start_time AND ' + + 'startDateTime <= :end_time' + sb.with_bind_variable('status', 'APPROVED') + sb.with_bind_variable('start_time', now) + sb.with_bind_variable('end_time', five_days_from_now) + end + + # Retrieve a small number of orders at a time, paging through until all + # orders have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get orders by statement. + page = order_service.get_orders_by_statement(statement.to_statement()) + + # Display some information about each order. + unless page[:results].nil? + page[:results].each_with_index do |order, index| + puts "%d) Order with ID %d and name '%s' was found." % + [index + statement.offset, order[:id], order[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of orders: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_orders_starting_soon(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/order_service/update_orders.rb b/dfp_api/examples/v201711/order_service/update_orders.rb index 833468805..74192012a 100755 --- a/dfp_api/examples/v201711/order_service/update_orders.rb +++ b/dfp_api/examples/v201711/order_service/update_orders.rb @@ -21,67 +21,52 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_orders(dfp, order_id) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to get first 500 orders. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :order_id' + sb.with_bind_variable('order_id', order_id) + sb.limit = 1 + end # Get orders by statement. - page = order_service.get_orders_by_statement(statement.toStatement()) + response = order_service.get_orders_by_statement(statement.to_statement()) + raise 'No orders found to update.' if response[:results].to_a.empty? + order = response[:results].first - if page[:results] - orders = page[:results] + # Archived orders can not be updated. + order[:notes] = 'Spoke to advertiser. All is well.' unless order[:is_archived] - orders.each do |order| - # Archived orders can not be updated. - if !order[:is_archived] - order[:notes] = 'Spoke to advertiser. All is well.' - # Workaround for issue #94. - order[:po_number] = "" if order[:po_number].nil? - end - end - - # Update the orders on the server. - return_orders = order_service.update_orders(orders) + # Update the orders on the server. + updated_orders = order_service.update_orders(orders) - if return_orders - return_orders.each do |order| - puts ("Order ID: %d, advertiser ID: %d, name: %s was updated " + - "with notes %s") % [order[:id], order[:advertiser_id], - order[:name], order[:notes]] - end - else - raise 'No orders were updated.' + if updated_orders.to_a.size > 0 + updated_orders.each do |order| + puts ('Order ID %d, advertiser ID %d, name "%s" was updated with notes ' + + '"%s".') % [order[:id], order[:advertiser_id], order[:name], + order[:notes]] end else - puts 'No orders found to update.' + puts 'No orders were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_orders() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + update_orders(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/package_service/get_all_packages.rb b/dfp_api/examples/v201711/package_service/get_all_packages.rb index 9e385fc7c..9876659c3 100755 --- a/dfp_api/examples/v201711/package_service/get_all_packages.rb +++ b/dfp_api/examples/v201711/package_service/get_all_packages.rb @@ -17,72 +17,65 @@ # limitations under the License. # # This example gets all packages. -require 'dfp_api' -class GetAllPackages +require 'dfp_api' - def self.run_example(dfp) - package_service = - dfp.service(:PackageService, :v201711) +def get_all_packages(dfp) + package_service = dfp.service(:PackageService, API_VERSION) - # Create a statement to select packages. - statement = DfpApi::FilterStatement.new() + # Create a statement to select packages. + statement = dfp.new_statement_builder() - # Retrieve a small amount of packages at a time, paging - # through until all packages have been retrieved. - total_result_set_size = 0; - begin - page = package_service.get_packages_by_statement( - statement.toStatement()) + # Retrieve a small amount of packages at a time, paging + # through until all packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = package_service.get_packages_by_statement( + statement.to_statement() + ) - # Print out some information for each package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |pkg, index| - puts "%d) Package with ID %d, name '%s', and proposal id %d was found." % [ - index + statement.offset, - pkg[:id], - pkg[:name], - pkg[:proposal_id] - ] - end + # Print out some information for each package. + unless page[:results].nil? + page[:results].each_with_index do |package, index| + puts ('%d) Package with ID %d, name "%s", and proposal id %d was ' + + 'found.') % [index + statement.offset, package[:id], + package[:name], package[:proposal_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of packages: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of packages: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllPackages.main() -end diff --git a/dfp_api/examples/v201711/package_service/get_in_progress_packages.rb b/dfp_api/examples/v201711/package_service/get_in_progress_packages.rb index e6ef20adf..6c5bb43eb 100755 --- a/dfp_api/examples/v201711/package_service/get_in_progress_packages.rb +++ b/dfp_api/examples/v201711/package_service/get_in_progress_packages.rb @@ -17,82 +17,68 @@ # limitations under the License. # # This example gets all packages in progress. -require 'dfp_api' -class GetInProgressPackages +require 'dfp_api' - def self.run_example(dfp) - package_service = - dfp.service(:PackageService, :v201711) +def get_in_progress_packages(dfp) + package_service = dfp.service(:PackageService, API_VERSION) - # Create a statement to select packages. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'IN_PROGRESS' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select packages. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'IN_PROGRESS') + end - # Retrieve a small amount of packages at a time, paging - # through until all packages have been retrieved. - total_result_set_size = 0; - begin - page = package_service.get_packages_by_statement( - statement.toStatement()) + # Retrieve a small amount of packages at a time, paging + # through until all packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = package_service.get_packages_by_statement( + statement.to_statement() + ) - # Print out some information for each package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |pkg, index| - puts "%d) Package with ID %d, name '%s', and proposal ID %d was found." % [ - index + statement.offset, - pkg[:id], - pkg[:name], - pkg[:proposal_id] - ] - end + # Print out some information for each package. + unless page[:results].nil? + page[:results].each_with_index do |package, index| + puts ('%d) Package with ID %d, name "%s", and proposal ID %d was ' + + 'found.') % [index + statement.offset, package[:id], + package[:name], package[:proposal_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of packages: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_in_progress_packages(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetInProgressPackages.main() -end diff --git a/dfp_api/examples/v201711/placement_service/create_placements.rb b/dfp_api/examples/v201711/placement_service/create_placements.rb index 119db967d..e8b1f7bc4 100755 --- a/dfp_api/examples/v201711/placement_service/create_placements.rb +++ b/dfp_api/examples/v201711/placement_service/create_placements.rb @@ -19,54 +19,45 @@ # This example creates new placements for various ad unit sizes. To determine # which placements exist, run get_all_placements.rb. +require 'securerandom' require 'dfp_api' - -API_VERSION = :v201711 - -def create_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the InventoryService. +def create_placements(dfp) + # Get the InventoryService and the PlacementService. inventory_service = dfp.service(:InventoryService, API_VERSION) - - # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) # Create local placement object to store skyscraper ad units. skyscraper_ad_unit_placement = { - :name => "Skyscraper AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 120x600', - :targeted_ad_unit_ids => [] + :name => 'Skyscraper AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 120x600', + :targeted_ad_unit_ids => [] } # Create local placement object to store medium square ad units. medium_square_ad_unit_placement = { - :name => "Medium Square AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 300x250', - :targeted_ad_unit_ids => [] + :name => 'Medium Square AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 300x250', + :targeted_ad_unit_ids => [] } # Create local placement object to store banner ad units. banner_ad_unit_placement = { - :name => "Banner AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 468x60', - :targeted_ad_unit_ids => [] + :name => 'Banner AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 468x60', + :targeted_ad_unit_ids => [] } # Get the first 500 ad units. - page = inventory_service.get_ad_units_by_statement( - DfpApi::FilterStatement.new('ORDER BY id ASC').toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end + page = inventory_service.get_ad_units_by_statement(statement.to_statement()) # Separate the ad units by size. - if page and page[:results] + if !page.nil? && page[:results] page[:results].each do |ad_unit| - if ad_unit[:parent_id] and ad_unit[:sizes] + if !ad_unit[:parent_id].nil? && !ad_unit[:ad_unit_sizes].nil? ad_unit[:ad_unit_sizes].each do |ad_unit_size| size = ad_unit_size[:size] receiver = case size[:width] @@ -88,27 +79,37 @@ def create_placements() non_empty_placements = [ medium_square_ad_unit_placement, skyscraper_ad_unit_placement, - banner_ad_unit_placement].delete_if {|plc| plc.empty?} + banner_ad_unit_placement + ].reject {|plc| plc[:targeted_ad_unit_ids].empty?} # Create the placements on the server. - placements = placement_service.create_placements(non_empty_placements) + created_placements = placement_service.create_placements(non_empty_placements) # Display results. - if placements - placements.each do |placement| - puts "Placement with ID: %d and name: %s created with ad units: [%s]" % + if created_placements.to_a.size > 0 + created_placements.each do |placement| + puts 'Placement with ID %d and name "%s" created with ad units [%s].' % [placement[:id], placement[:name], placement[:targeted_ad_unit_ids].join(', ')] end else - raise 'No placements created.' + puts 'No placements created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_placements() + create_placements(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/placement_service/deactivate_placements.rb b/dfp_api/examples/v201711/placement_service/deactivate_placements.rb index 8ca288997..d56296e60 100755 --- a/dfp_api/examples/v201711/placement_service/deactivate_placements.rb +++ b/dfp_api/examples/v201711/placement_service/deactivate_placements.rb @@ -21,41 +21,30 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_placements(dfp) # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) # Create statement to select active placements. - statement = DfpApi::FilterStatement.new( - 'WHERE status = :status', - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end # Define initial values. placement_ids = [] + page = {:total_result_set_size => 0} begin # Get placements by statement. page = placement_service.get_placements_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |placement, index| - puts ("%d) Placement ID: %d, name: %s and status: %s will be " + - "deactivated.") % [index + statement.offset, placement[:id], + puts ('%d) Placement ID %d, name "%s", and status "%s" will be ' + + 'deactivated.') % [index + statement.offset, placement[:id], placement[:name], placement[:status]] placement_ids << placement[:id] end @@ -66,15 +55,18 @@ def deactivate_placements() if !placement_ids.empty? # Create a statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % placement_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % placement_ids.join(', ') + end # Perform action. result = placement_service.perform_placement_action( - {:xsi_type => 'DeactivatePlacements'}, statement.toStatement()) + {:xsi_type => 'DeactivatePlacements'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of placements deactivated: %d" % result[:num_changes] else puts 'No placements were deactivated.' @@ -85,8 +77,17 @@ def deactivate_placements() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_placements() + deactivate_placements(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/placement_service/get_active_placements.rb b/dfp_api/examples/v201711/placement_service/get_active_placements.rb index c7ef2c46d..966b01a58 100755 --- a/dfp_api/examples/v201711/placement_service/get_active_placements.rb +++ b/dfp_api/examples/v201711/placement_service/get_active_placements.rb @@ -17,81 +17,68 @@ # limitations under the License. # # This example gets all active placements. -require 'dfp_api' -class GetActivePlacements +require 'dfp_api' - def self.run_example(dfp) - placement_service = - dfp.service(:PlacementService, :v201711) +def get_active_placements(dfp) + # Get the PlacementService. + placement_service = dfp.service(:PlacementService, API_VERSION) - # Create a statement to select placements. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select placements. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end - # Retrieve a small amount of placements at a time, paging - # through until all placements have been retrieved. - total_result_set_size = 0; - begin - page = placement_service.get_placements_by_statement( - statement.toStatement()) + # Retrieve a small amount of placements at a time, paging + # through until all placements have been retrieved. + page = {:total_result_set_size => 0} + begin + page = placement_service.get_placements_by_statement( + statement.to_statement() + ) - # Print out some information for each placement. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |placement, index| - puts "%d) Placement with ID %d and name '%s' was found." % [ - index + statement.offset, - placement[:id], - placement[:name] - ] - end + # Print out some information for each placement. + unless page[:results].nil? + page[:results].each_with_index do |placement, index| + puts '%d) Placement with ID %d and name "%s" was found.' % + [index + statement.offset, placement[:id], placement[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of placements: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of placements: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_active_placements(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActivePlacements.main() -end diff --git a/dfp_api/examples/v201711/placement_service/get_all_placements.rb b/dfp_api/examples/v201711/placement_service/get_all_placements.rb index 99d37c2ab..171dcbdbe 100755 --- a/dfp_api/examples/v201711/placement_service/get_all_placements.rb +++ b/dfp_api/examples/v201711/placement_service/get_all_placements.rb @@ -17,71 +17,67 @@ # limitations under the License. # # This example gets all placements. -require 'dfp_api' -class GetAllPlacements +require 'dfp_api' - def self.run_example(dfp) - placement_service = - dfp.service(:PlacementService, :v201711) +def get_all_placements(dfp) + # Get the PlacementService. + placement_service = dfp.service(:PlacementService, API_VERSION) - # Create a statement to select placements. - statement = DfpApi::FilterStatement.new() + # Create a statement to select placements. + statement = dfp.new_statement_builder() - # Retrieve a small amount of placements at a time, paging - # through until all placements have been retrieved. - total_result_set_size = 0; - begin - page = placement_service.get_placements_by_statement( - statement.toStatement()) + # Retrieve a small amount of placements at a time, paging + # through until all placements have been retrieved. + total_result_set_size = 0; + begin + # Get placements by statement. + page = placement_service.get_placements_by_statement( + statement.to_statement() + ) - # Print out some information for each placement. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |placement, index| - puts "%d) Placement with ID %d and name '%s' was found." % [ - index + statement.offset, - placement[:id], - placement[:name] - ] - end + # Print out some information for each placement. + unless page[:results].nil? + total_result_set_size = page[:total_result_set_size] + page[:results].each_with_index do |placement, index| + puts '%d) Placement with ID %d and name "%s" was found.' % + [index + statement.offset, placement[:id], placement[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of placements: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of placements: %d' % total_result_set_size +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_placements(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllPlacements.main() -end diff --git a/dfp_api/examples/v201711/placement_service/update_placements.rb b/dfp_api/examples/v201711/placement_service/update_placements.rb index dd74bf279..df9c794b7 100755 --- a/dfp_api/examples/v201711/placement_service/update_placements.rb +++ b/dfp_api/examples/v201711/placement_service/update_placements.rb @@ -21,63 +21,53 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_placements(dfp, placement_id) # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) - placement_id = 'INSERT_PLACEMENT_ID_HERE'.to_i - # Create a statement to get a single placement by ID. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [{ - :key => 'id', - :value => {:value => placement_id, :xsi_type => 'NumberValue'} - }], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :placement_id' + sb.with_bind_variable('placement_id', placement_id) + sb.limit = 1 + end # Get placements by statement. - page = placement_service.get_placements_by_statement(statement.toStatement()) - - if page[:results] - placements = page[:results] + response = placement_service.get_placements_by_statement( + statement.to_statement() + ) + raise 'No placements found to update.' if response[:results].to_a.empty? + placement = response[:results].first - # Change the description of the local placement. The server isn't affected - # yet. - placement = placements.first - placement[:description] = 'This placement contains all leaderboards.' + # Change the description of the placement object. + placement[:description] = 'This placement contains all leaderboards.' - # Update the placements on the server. - return_placements = placement_service.update_placements([placement]) + # Update the placements on the server. + updated_placements = placement_service.update_placements([placement]) - if return_placements - return_placements.each do |placement| - puts ("Placement ID: %d, name: %s was updated with AdSense targeting " + - "enabled: %s.") % [placement[:id], placement[:name], - placement[:is_ad_sense_targeting_enabled]] - end - else - raise 'No placements were updated.' + if updated_placements.to_a.size > 0 + updated_placements.each do |placement| + puts 'Placement with ID %d and name "%s" was updated.' % + [placement[:id], placement[:name]] end else - puts 'No placements found to update.' + puts 'No placements were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_placements() + placement_id = 'INSERT_PLACEMENT_ID_HERE'.to_i + update_placements(dfp, placement_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/premium_rate_service/get_all_premium_rates.rb b/dfp_api/examples/v201711/premium_rate_service/get_all_premium_rates.rb index 05abc18a7..ac47f5194 100755 --- a/dfp_api/examples/v201711/premium_rate_service/get_all_premium_rates.rb +++ b/dfp_api/examples/v201711/premium_rate_service/get_all_premium_rates.rb @@ -17,72 +17,66 @@ # limitations under the License. # # This example gets all premium rates. -require 'dfp_api' -class GetAllPremiumRates +require 'dfp_api' - def self.run_example(dfp) - premium_rate_service = - dfp.service(:PremiumRateService, :v201711) +def get_all_premium_rates(dfp) + premium_rate_service = dfp.service(:PremiumRateService, API_VERSION) - # Create a statement to select premium rates. - statement = DfpApi::FilterStatement.new() + # Create a statement to select premium rates. + statement = dfp.new_statement_builder() - # Retrieve a small amount of premium rates at a time, paging - # through until all premium rates have been retrieved. - total_result_set_size = 0; - begin - page = premium_rate_service.get_premium_rates_by_statement( - statement.toStatement()) + # Retrieve a small amount of premium rates at a time, paging + # through until all premium rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = premium_rate_service.get_premium_rates_by_statement( + statement.to_statement() + ) - # Print out some information for each premium rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |premium_rate, index| - puts "%d) Premium rate with ID %d, premium feature '%s', and rate card id %d was found." % [ - index + statement.offset, - premium_rate[:id], - premium_rate[:xsi_type], - premium_rate[:rate_card_id] - ] - end + # Print out some information for each premium rate. + unless page[:results].nil? + page[:results].each_with_index do |premium_rate, index| + puts ('%d) Premium rate with ID %d, premium feature "%s", and rate ' + + 'card ID %d was found.') % [index + statement.offset, + premium_rate[:id], premium_rate[:xsi_type], + premium_rate[:rate_card_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of premium rates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of premium rates: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_premium_rates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllPremiumRates.main() -end diff --git a/dfp_api/examples/v201711/premium_rate_service/get_premium_rates_for_rate_card.rb b/dfp_api/examples/v201711/premium_rate_service/get_premium_rates_for_rate_card.rb index 24cdc4097..e8e6aab97 100755 --- a/dfp_api/examples/v201711/premium_rate_service/get_premium_rates_for_rate_card.rb +++ b/dfp_api/examples/v201711/premium_rate_service/get_premium_rates_for_rate_card.rb @@ -17,84 +17,71 @@ # limitations under the License. # # This example gets all premium rates on a specific rate card. + require 'dfp_api' -class GetPremiumRatesForRateCard +def get_premium_rates_for_rate_card(dfp, rate_card_id) + # Get the PremiumRateService. + premium_rate_service = dfp.service(:PremiumRateService, API_VERSION) - RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE'; + # Create a statement to select premium rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'rateCardId = :rate_card_id' + sb.with_bind_variable('rate_card_id', rate_card_id) + end - def self.run_example(dfp, rate_card_id) - premium_rate_service = - dfp.service(:PremiumRateService, :v201711) + # Retrieve a small amount of premium rates at a time, paging + # through until all premium rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = premium_rate_service.get_premium_rates_by_statement( + statement.to_statement() + ) - # Create a statement to select premium rates. - query = 'WHERE rateCardId = :rateCardId' - values = [ - { - :key => 'rateCardId', - :value => { - :xsi_type => 'NumberValue', - :value => rate_card_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each premium rate. + unless page[:results].nil? + page[:results].each_with_index do |premium_rate, index| + puts ('%d) Premium rate with ID %d, premium feature "%s", and rate ' + + 'card ID %d was found.') % [index + statement.offset, + premium_rate[:id], premium_rate[:xsi_type], + premium_rate[:rate_card_id]] + end + end - # Retrieve a small amount of premium rates at a time, paging - # through until all premium rates have been retrieved. - total_result_set_size = 0; - begin - page = premium_rate_service.get_premium_rates_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each premium rate. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |premium_rate, index| - puts "%d) Premium rate with ID %d, premium feature '%s', and rate card ID %d was found." % [ - index + statement.offset, - premium_rate[:id], - premium_rate[:xsi_type], - premium_rate[:rate_card_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of premium rates: %d' % page[:total_result_set_size] +end - puts 'Total number of premium rates: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, RATE_CARD_ID.to_i) + begin + rate_card_id = 'INSERT_RATE_CARD_ID_HERE'.to_i + get_premium_rates_for_rate_card(dfp, rate_card_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetPremiumRatesForRateCard.main() -end diff --git a/dfp_api/examples/v201711/product_package_item_service/get_all_product_package_items.rb b/dfp_api/examples/v201711/product_package_item_service/get_all_product_package_items.rb index 699aa66f2..25b0a1f8d 100755 --- a/dfp_api/examples/v201711/product_package_item_service/get_all_product_package_items.rb +++ b/dfp_api/examples/v201711/product_package_item_service/get_all_product_package_items.rb @@ -17,72 +17,69 @@ # limitations under the License. # # This example gets all product package items. -require 'dfp_api' -class GetAllProductPackageItems +require 'dfp_api' - def self.run_example(dfp) - product_package_item_service = - dfp.service(:ProductPackageItemService, :v201711) +def get_all_product_package_items(dfp) + # Get the ProductPackageItemService. + product_package_item_service = + dfp.service(:ProductPackageItemService, API_VERSION) - # Create a statement to select product package items. - statement = DfpApi::FilterStatement.new() + # Create a statement to select product package items. + statement = dfp.new_statement_builder() - # Retrieve a small amount of product package items at a time, paging - # through until all product package items have been retrieved. - total_result_set_size = 0; - begin - page = product_package_item_service.get_product_package_items_by_statement( - statement.toStatement()) + # Retrieve a small amount of product package items at a time, paging + # through until all product package items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_item_service.get_product_package_items_by_statement( + statement.to_statement() + ) - # Print out some information for each product package item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package_item, index| - puts "%d) Product package item with ID %d, product id %d, and product package id %d was found." % [ - index + statement.offset, - product_package_item[:id], - product_package_item[:product_id], - product_package_item[:product_package_id] - ] - end + # Print out some information for each product package item. + unless page[:results].nil? + page[:results].each_with_index do |product_package_item, index| + puts ('%d) Product package item with ID %d, product id %d, and ' + + 'product package id %d was found.') % [index + statement.offset, + product_package_item[:id], product_package_item[:product_id], + product_package_item[:product_package_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of product package items: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of product package items: %d' % + page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_product_package_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProductPackageItems.main() -end diff --git a/dfp_api/examples/v201711/product_package_item_service/get_product_package_items_for_product_package.rb b/dfp_api/examples/v201711/product_package_item_service/get_product_package_items_for_product_package.rb index 2fe35f3bc..7b93abd3e 100755 --- a/dfp_api/examples/v201711/product_package_item_service/get_product_package_items_for_product_package.rb +++ b/dfp_api/examples/v201711/product_package_item_service/get_product_package_items_for_product_package.rb @@ -17,84 +17,73 @@ # limitations under the License. # # This example gets all product package items belonging to a product package. + require 'dfp_api' -class GetProductPackageItemsForProductPackage +def get_product_package_items_for_product_package(dfp, product_package_id) + # Get the ProductPackageItemService. + product_package_item_service = + dfp.service(:ProductPackageItemService, API_VERSION) - PRODUCT_PACKAGE_ID = 'INSERT_PRODUCT_PACKAGE_ID_HERE'; + # Create a statement to select product package items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'productPackageId = :product_package_id' + sb.with_bind_variable('product_package_id', product_package_id) + end - def self.run_example(dfp, product_package_id) - product_package_item_service = - dfp.service(:ProductPackageItemService, :v201711) + # Retrieve a small amount of product package items at a time, paging + # through until all product package items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_item_service.get_product_package_items_by_statement( + statement.to_statement() + ) - # Create a statement to select product package items. - query = 'WHERE productPackageId = :productPackageId' - values = [ - { - :key => 'productPackageId', - :value => { - :xsi_type => 'NumberValue', - :value => product_package_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each product package item. + unless page[:results].nil? + page[:results].each_with_index do |product_package_item, index| + puts ('%d) Product package item with ID %d, product ID %d, and ' + + 'product package ID %d was found.') % [index + statement.offset, + product_package_item[:id], product_package_item[:product_id], + product_package_item[:product_package_id]] + end + end - # Retrieve a small amount of product package items at a time, paging - # through until all product package items have been retrieved. - total_result_set_size = 0; - begin - page = product_package_item_service.get_product_package_items_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each product package item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package_item, index| - puts "%d) Product package item with ID %d, product ID %d, and product package ID %d was found." % [ - index + statement.offset, - product_package_item[:id], - product_package_item[:product_id], - product_package_item[:product_package_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of product package items: %d' % + page[:total_result_set_size] +end - puts 'Total number of product package items: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, PRODUCT_PACKAGE_ID.to_i) + begin + product_package_id = 'INSERT_PRODUCT_PACKAGE_ID_HERE'.to_i + get_product_package_items_for_product_package(dfp, product_package_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetProductPackageItemsForProductPackage.main() -end diff --git a/dfp_api/examples/v201711/product_package_service/get_active_product_packages.rb b/dfp_api/examples/v201711/product_package_service/get_active_product_packages.rb index 3fd620af2..21c22cfb3 100755 --- a/dfp_api/examples/v201711/product_package_service/get_active_product_packages.rb +++ b/dfp_api/examples/v201711/product_package_service/get_active_product_packages.rb @@ -17,81 +17,69 @@ # limitations under the License. # # This example gets all active product packages. -require 'dfp_api' -class GetActiveProductPackages +require 'dfp_api' - def self.run_example(dfp) - product_package_service = - dfp.service(:ProductPackageService, :v201711) +def get_active_product_packages(dfp) + # Get the ProductPackageService. + product_package_service = dfp.service(:ProductPackageService, API_VERSION) - # Create a statement to select product packages. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'ACTIVE' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select product packages. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end - # Retrieve a small amount of product packages at a time, paging - # through until all product packages have been retrieved. - total_result_set_size = 0; - begin - page = product_package_service.get_product_packages_by_statement( - statement.toStatement()) + # Retrieve a small amount of product packages at a time, paging + # through until all product packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_service.get_product_packages_by_statement( + statement.to_statement() + ) - # Print out some information for each product package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package, index| - puts "%d) Product package with ID %d and name '%s' was found." % [ - index + statement.offset, - product_package[:id], - product_package[:name] - ] - end + # Print out some information for each product package. + unless page[:results].nil? + page[:results].each_with_index do |product_package, index| + puts '%d) Product package with ID %d and name "%s" was found.' % + [index + statement.offset, product_package[:id], + product_package[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of product packages: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_active_product_packages(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetActiveProductPackages.main() -end diff --git a/dfp_api/examples/v201711/product_package_service/get_all_product_packages.rb b/dfp_api/examples/v201711/product_package_service/get_all_product_packages.rb index dcaaf5600..a35cdd8fa 100755 --- a/dfp_api/examples/v201711/product_package_service/get_all_product_packages.rb +++ b/dfp_api/examples/v201711/product_package_service/get_all_product_packages.rb @@ -17,71 +17,66 @@ # limitations under the License. # # This example gets all product packages. -require 'dfp_api' -class GetAllProductPackages +require 'dfp_api' - def self.run_example(dfp) - product_package_service = - dfp.service(:ProductPackageService, :v201711) +def get_all_product_packages(dfp) + # Get the ProductPackageService. + product_package_service = dfp.service(:ProductPackageService, API_VERSION) - # Create a statement to select product packages. - statement = DfpApi::FilterStatement.new() + # Create a statement to select product packages. + statement = dfp.new_statement_builder() - # Retrieve a small amount of product packages at a time, paging - # through until all product packages have been retrieved. - total_result_set_size = 0; - begin - page = product_package_service.get_product_packages_by_statement( - statement.toStatement()) + # Retrieve a small amount of product packages at a time, paging + # through until all product packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_service.get_product_packages_by_statement( + statement.to_statement() + ) - # Print out some information for each product package. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_package, index| - puts "%d) Product package with ID %d and name '%s' was found." % [ - index + statement.offset, - product_package[:id], - product_package[:name] - ] - end + # Print out some information for each product package. + unless page[:results].nil? + page[:results].each_with_index do |product_package, index| + puts '%d) Product package with ID %d and name "%s" was found.' % + [index + statement.offset,product_package[:id], + product_package[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of product packages: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of product packages: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_product_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProductPackages.main() -end diff --git a/dfp_api/examples/v201711/product_service/get_all_products.rb b/dfp_api/examples/v201711/product_service/get_all_products.rb index 2ea77733e..704e0d149 100755 --- a/dfp_api/examples/v201711/product_service/get_all_products.rb +++ b/dfp_api/examples/v201711/product_service/get_all_products.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all products. -require 'dfp_api' -class GetAllProducts +require 'dfp_api' - def self.run_example(dfp) - product_service = - dfp.service(:ProductService, :v201711) +def get_all_products(dfp) + # Get the ProductService. + product_service = dfp.service(:ProductService, API_VERSION) - # Create a statement to select products. - statement = DfpApi::FilterStatement.new() + # Create a statement to select products. + statement = dfp.new_statement_builder() - # Retrieve a small amount of products at a time, paging - # through until all products have been retrieved. - total_result_set_size = 0; - begin - page = product_service.get_products_by_statement( - statement.toStatement()) + # Retrieve a small amount of products at a time, paging + # through until all products have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_service.get_products_by_statement( + statement.to_statement() + ) - # Print out some information for each product. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product, index| - puts "%d) Product with ID %d and name '%s' was found." % [ - index + statement.offset, - product[:id], - product[:name] - ] - end + # Print out some information for each product. + unless page[:results].nil? + page[:results].each_with_index do |product, index| + puts '%d) Product with ID %d and name "%s" was found.' % + [index + statement.offset, product[:id], product[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of products: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of products: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_products(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProducts.main() -end diff --git a/dfp_api/examples/v201711/product_service/get_products_for_product_template.rb b/dfp_api/examples/v201711/product_service/get_products_for_product_template.rb new file mode 100755 index 000000000..46dd1925d --- /dev/null +++ b/dfp_api/examples/v201711/product_service/get_products_for_product_template.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all products created from a product template. + +require 'dfp_api' + +def get_products_for_product_template(dfp, product_template_id) + # Get the ProductService. + product_service = dfp.service(:ProductService, API_VERSION) + + # Create a statement to select products. + statement = dfp.new_statement_builder do |sb| + sb.where = 'productTemplateId = :product_template_id' + sb.with_bind_variable('product_template_id', product_template_id) + end + + # Retrieve a small number of products at a time, paging through until all + # products have been retrieved. + page = {:total_result_set_size => 0}; + begin + # Get products by statement. + page = product_service.get_products_by_statement( + statement.to_statement() + ) + + # Display some information about each product. + unless page[:results].nil? + page[:results].each_with_index do |product, index| + puts '%d) Product with ID %d and name "%s" was found.' % + [index + statement.offset, product[:id], product[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of products: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + product_template_id = 'INSERT_PRODUCT_TEMPLATE_ID_HERE'.to_i + get_products_for_product_template(dfp, product_template_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/product_template_service/get_all_product_templates.rb b/dfp_api/examples/v201711/product_template_service/get_all_product_templates.rb index 62be40629..8a450e030 100755 --- a/dfp_api/examples/v201711/product_template_service/get_all_product_templates.rb +++ b/dfp_api/examples/v201711/product_template_service/get_all_product_templates.rb @@ -17,71 +17,66 @@ # limitations under the License. # # This example gets all product templates. -require 'dfp_api' -class GetAllProductTemplates +require 'dfp_api' - def self.run_example(dfp) - product_template_service = - dfp.service(:ProductTemplateService, :v201711) +def get_all_product_templates(dfp) + # Get the ProductTemplateService. + product_template_service = dfp.service(:ProductTemplateService, API_VERSION) - # Create a statement to select product templates. - statement = DfpApi::FilterStatement.new() + # Create a statement to select product templates. + statement = dfp.new_statement_builder() - # Retrieve a small amount of product templates at a time, paging - # through until all product templates have been retrieved. - total_result_set_size = 0; - begin - page = product_template_service.get_product_templates_by_statement( - statement.toStatement()) + # Retrieve a small amount of product templates at a time, paging + # through until all product templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_template_service.get_product_templates_by_statement( + statement.to_statement() + ) - # Print out some information for each product template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_template, index| - puts "%d) Product template with ID %d and name '%s' was found." % [ - index + statement.offset, - product_template[:id], - product_template[:name] - ] - end + # Print out some information for each product template. + unless page[:results].nil? + page[:results].each_with_index do |product_template, index| + puts '%d) Product template with ID %d and name "%s" was found.' % + [index + statement.offset, product_template[:id], + product_template[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of product templates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of product templates: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_product_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProductTemplates.main() -end diff --git a/dfp_api/examples/v201711/product_template_service/get_sponsorship_product_templates.rb b/dfp_api/examples/v201711/product_template_service/get_sponsorship_product_templates.rb index 97fc937e9..e2cb4bbf4 100755 --- a/dfp_api/examples/v201711/product_template_service/get_sponsorship_product_templates.rb +++ b/dfp_api/examples/v201711/product_template_service/get_sponsorship_product_templates.rb @@ -19,79 +19,68 @@ # This example gets all sponsorship product templates. require 'dfp_api' -class GetSponsorshipProductTemplates +def get_sponsorship_product_templates(dfp) + # Get the ProductTemplateService. + product_template_service = dfp.service(:ProductTemplateService, API_VERSION) - def self.run_example(dfp) - product_template_service = - dfp.service(:ProductTemplateService, :v201711) - - # Create a statement to select product templates. - query = 'WHERE lineItemType = :lineItemType' - values = [ - { - :key => 'lineItemType', - :value => { - :xsi_type => 'TextValue', - :value => 'SPONSORSHIP' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select product templates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemType = :line_item_type' + sb.with_bind_variable('line_item_type', 'SPONSORSHIP') + end - # Retrieve a small amount of product templates at a time, paging - # through until all product templates have been retrieved. - total_result_set_size = 0; - begin - page = product_template_service.get_product_templates_by_statement( - statement.toStatement()) + # Retrieve a small amount of product templates at a time, paging + # through until all product templates have been retrieved. + total_result_set_size = 0; + begin + page = product_template_service.get_product_templates_by_statement( + statement.to_statement() + ) - # Print out some information for each product template. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |product_template, index| - puts "%d) Product template with ID %d and name '%s' was found." % [ - index + statement.offset, - product_template[:id], - product_template[:name] - ] - end + # Print out some information for each product template. + if page[:results] + total_result_set_size = page[:total_result_set_size] + page[:results].each_with_index do |product_template, index| + puts '%d) Product template with ID %d and name "%s" was found.' % + [index + statement.offset, product_template[:id], + product_template[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of product templates: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of product templates: %d' % + total_result_set_size +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_sponsorship_product_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetSponsorshipProductTemplates.main() -end diff --git a/dfp_api/examples/v201711/proposal_line_item_service/archive_proposal_line_item.rb b/dfp_api/examples/v201711/proposal_line_item_service/archive_proposal_line_item.rb new file mode 100755 index 000000000..9fbc2499a --- /dev/null +++ b/dfp_api/examples/v201711/proposal_line_item_service/archive_proposal_line_item.rb @@ -0,0 +1,100 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example archives a proposal line item. To determine which proposal +# line items exist, run get_all_proposal_line_items.rb. + +require 'dfp_api' + +def archive_proposal_line_item(dfp, proposal_line_item_id) + # Get the ProposalLineItemService. + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Create a statement to select a single proposal line item. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_line_item_id' + sb.with_bind_variable('proposal_line_item_id', proposal_line_item_id) + sb.limit = 1 + end + + # Retrieve a small number of proposal line items at a time, paging through + # until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get proposal line items by statement. + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each proposal line item. + unless page[:results].nil? + page[:results].each do |proposal_line_item| + puts ('Proposal line item with ID %d and name "%s", belonging to ' + + 'proposal with ID %d, will be archived.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Perform action. + result = proposal_line_item_service.perform_proposal_line_item_action( + {:xsi_type => 'ArchiveProposalLineItems'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of proposal line items archived: %d" % result[:num_changes] + else + puts 'No proposal line items archived.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_line_item_id = 'INSERT_PROPOSAL_LINE_ITEM_ID_HERE'.to_i + archive_proposal_line_item(dfp, proposal_line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/proposal_line_item_service/create_proposal_line_item.rb b/dfp_api/examples/v201711/proposal_line_item_service/create_proposal_line_item.rb new file mode 100755 index 000000000..f36fbf362 --- /dev/null +++ b/dfp_api/examples/v201711/proposal_line_item_service/create_proposal_line_item.rb @@ -0,0 +1,129 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates a programmatic proposal line item. This example does not +# work for networks with DFP sales management enabled. + +require 'securerandom' +require 'dfp_api' + +def create_proposal_line_item(dfp, proposal_id) + # Get the NetworkService and ProposalLineItemService. + network_service = dfp.service(:NetworkService, API_VERSION) + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Get the current network's root ad unit ID. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Specify the start and end times to be set on the proposal line item. + now = dfp.now('America/New_York') + one_year_from_now = now + 365 * 24 * 60 * 60 + + # Create proposal line item configuration object. + proposal_line_item = { + :marketplace_info => { + :ad_exchange_environment => 'DISPLAY' + }, + :name => 'Proposal Line Item %s' % SecureRandom.uuid(), + :proposal_id => proposal_id, + :line_item_type => 'STANDARD', + :targeting => { + :inventory_targeting => { + :targeted_ad_units => [{ + :ad_unit_id => root_ad_unit_id + }] + }, + :technology_targeting => { + :device_capability_targeting => { + # Exclude Mobile Apps (required for Ad Exchange DISPLAY environment). + :excluded_device_capabilities => [{:id => 5005}] + } + } + }, + :start_date_time => now.to_h, + :end_date_time => one_year_from_now.to_h, + :creative_placeholders => [ + {:size => {:width => 300, :height => 250}}, + {:size => {:width => 120, :height => 600}} + ], + :goal => { + :units => 1000, + :unit_type => 'IMPRESSIONS' + }, + :net_cost => { + :currency_code => 'USD', + :micro_amount => 2_000_000 + }, + :net_rate => { + :currency_code => 'USD', + :micro_amount => 2_000_000 + }, + :rate_type => 'CPM', + :delivery_rate_type => 'EVENLY' + } + + # Create the proposal line item on the server. + created_proposal_line_items = proposal_line_item_service. + create_proposal_line_items([proposal_line_item]) + + # Display the results. + if created_proposal_line_items.to_a.size > 0 + created_proposal_line_items.each do |proposal_line_item| + puts ('A programmatic proposal line item with ID %d and name "%s", ' + 'belonging to proposal with ID %d, was created.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + else + puts 'No programmatic proposal line items were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + create_proposal_line_item(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/proposal_line_item_service/get_all_proposal_line_items.rb b/dfp_api/examples/v201711/proposal_line_item_service/get_all_proposal_line_items.rb index cdec6269e..690f9d8fe 100755 --- a/dfp_api/examples/v201711/proposal_line_item_service/get_all_proposal_line_items.rb +++ b/dfp_api/examples/v201711/proposal_line_item_service/get_all_proposal_line_items.rb @@ -17,71 +17,67 @@ # limitations under the License. # # This example gets all proposal line items. -require 'dfp_api' -class GetAllProposalLineItems +require 'dfp_api' - def self.run_example(dfp) - proposal_line_item_service = - dfp.service(:ProposalLineItemService, :v201711) +def get_all_proposal_line_items(dfp) + # Get the ProposalLineItemService. + proposal_line_item_service = + dfp.service(:ProposalLineItemService, API_VERSION) - # Create a statement to select proposal line items. - statement = DfpApi::FilterStatement.new() + # Create a statement to select proposal line items. + statement = dfp.new_statement_builder() - # Retrieve a small amount of proposal line items at a time, paging - # through until all proposal line items have been retrieved. - total_result_set_size = 0; - begin - page = proposal_line_item_service.get_proposal_line_items_by_statement( - statement.toStatement()) + # Retrieve a small amount of proposal line items at a time, paging + # through until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) - # Print out some information for each proposal line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal_line_item, index| - puts "%d) Proposal line item with ID %d and name '%s' was found." % [ - index + statement.offset, - proposal_line_item[:id], - proposal_line_item[:name] - ] - end + # Print out some information for each proposal line item. + unless page[:results].nil? + page[:results].each_with_index do |proposal_line_item, index| + puts '%d) Proposal line item with ID %d and name "%s" was found.' % + [index + statement.offset, proposal_line_item[:id], + proposal_line_item[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of proposal line items: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of proposal line items: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_proposal_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProposalLineItems.main() -end diff --git a/dfp_api/examples/v201711/proposal_line_item_service/get_proposal_line_items_for_proposal.rb b/dfp_api/examples/v201711/proposal_line_item_service/get_proposal_line_items_for_proposal.rb index aed914ba5..78c20cd2f 100755 --- a/dfp_api/examples/v201711/proposal_line_item_service/get_proposal_line_items_for_proposal.rb +++ b/dfp_api/examples/v201711/proposal_line_item_service/get_proposal_line_items_for_proposal.rb @@ -17,83 +17,70 @@ # limitations under the License. # # This example gets all proposal line items belonging to a specific proposal. + require 'dfp_api' -class GetProposalLineItemsForProposal +def get_proposal_line_items_for_proposal(dfp, proposal_id) + proposal_line_item_service = + dfp.service(:ProposalLineItemService, API_VERSION) - PROPOSAL_ID = 'INSERT_PROPOSAL_ID_HERE'; + # Create a statement to select proposal line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'proposalId = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + end - def self.run_example(dfp, proposal_id) - proposal_line_item_service = - dfp.service(:ProposalLineItemService, :v201711) + # Retrieve a small amount of proposal line items at a time, paging + # through until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) - # Create a statement to select proposal line items. - query = 'WHERE proposalId = :proposalId' - values = [ - { - :key => 'proposalId', - :value => { - :xsi_type => 'NumberValue', - :value => proposal_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each proposal line item. + unless page[:results].nil? + page[:results].each_with_index do |proposal_line_item, index| + puts '%d) Proposal line item with ID %d and name "%s" was found.' % + [index + statement.offset, proposal_line_item[:id], + proposal_line_item[:name]] + end + end - # Retrieve a small amount of proposal line items at a time, paging - # through until all proposal line items have been retrieved. - total_result_set_size = 0; - begin - page = proposal_line_item_service.get_proposal_line_items_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each proposal line item. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal_line_item, index| - puts "%d) Proposal line item with ID %d and name '%s' was found." % [ - index + statement.offset, - proposal_line_item[:id], - proposal_line_item[:name] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of proposal line items: %d' % page[:total_result_set_size] +end - puts 'Total number of proposal line items: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, PROPOSAL_ID.to_i) + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + get_proposal_line_items_for_proposal(dfp, proposal_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetProposalLineItemsForProposal.main() -end diff --git a/dfp_api/examples/v201711/proposal_line_item_service/update_proposal_line_item.rb b/dfp_api/examples/v201711/proposal_line_item_service/update_proposal_line_item.rb new file mode 100755 index 000000000..cbbd35bc8 --- /dev/null +++ b/dfp_api/examples/v201711/proposal_line_item_service/update_proposal_line_item.rb @@ -0,0 +1,95 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates a proposal line item. To determine which proposal line +# items exist, run get_all_proposal_line_items.rb. + +require 'dfp_api' + +def update_proposal_line_item(dfp, proposal_line_item_id) + # Get the ProposalLineItemService. + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Create a statement to select a single proposal line item. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_line_item_id' + sb.with_bind_variable('proposal_line_item_id', proposal_line_item_id) + sb.limit = 1 + end + + # Get the proposal line item. + response = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + if response[:results].to_a.size < 1 + raise 'No proposal line items found to update.' + end + proposal_line_item = response[:results].first + + # Update proposal line item's notes field + proposal_line_item[:internal_notes] = 'Proposal line item is ready to submit.' + + # Send updated proposal line item to the server. + updated_proposal_line_items = proposal_line_item_service. + update_proposal_line_items([proposal_line_item]) + + # Display the results. + if updated_proposal_line_items.to_a.size > 0 + updated_proposal_line_items.each do |proposal_line_item| + puts ('Proposal line item with ID %d and name "%s", belonging to ' + + 'proposal with ID %d, was updated.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + else + puts 'No proposal line items were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_line_item_id = 'INSERT_PROPOSAL_LINE_ITEM_ID_HERE'.to_i + update_proposal_line_item(dfp, proposal_line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/proposal_service/create_proposal.rb b/dfp_api/examples/v201711/proposal_service/create_proposal.rb new file mode 100755 index 000000000..e1f8c15c2 --- /dev/null +++ b/dfp_api/examples/v201711/proposal_service/create_proposal.rb @@ -0,0 +1,91 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates a programmatic proposal. This example does not work for +# networks with DFP sales management enabled. + +require 'securerandom' +require 'dfp_api' + +def create_proposal(dfp, primary_salesperson_id, primary_trafficker_id, + buyer_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create proposal configuration object. + proposal = { + :marketplace_info => { + :buyer_account_id => buyer_id + }, + :is_programmatic => true, + :name => 'Proposal %s' % SecureRandom.uuid(), + :primary_salesperson => { + :user_id => primary_salesperson_id, + :split => 100_000 + }, + :primary_trafficker_id => primary_trafficker_id + } + + # Create the proposal on the server. + created_proposals = proposal_service.create_proposals([proposal]) + + # Display the results. + if created_proposals.to_a.size > 0 + created_proposals.each do |proposal| + puts 'A programmatic proposal with ID %d and name "%s" was created.' % + [proposal[:id], proposal[:name]] + end + else + puts 'No programmatic proposals were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + primary_salesperson_id = 'INSERT_PRIMARY_SALESPERSON_ID_HERE'.to_i + primary_trafficker_id = 'INSERT_PRIMARY_TRAFFICKER_ID_HERE'.to_i + buyer_id = 'INSERT_BUYER_ID_FROM_PQL_TABLE_HERE'.to_i + create_proposal( + dfp, primary_salesperson_id, primary_trafficker_id, buyer_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/proposal_service/get_all_proposals.rb b/dfp_api/examples/v201711/proposal_service/get_all_proposals.rb index 655cff7b0..02aee7cca 100755 --- a/dfp_api/examples/v201711/proposal_service/get_all_proposals.rb +++ b/dfp_api/examples/v201711/proposal_service/get_all_proposals.rb @@ -17,66 +17,63 @@ # limitations under the License. # # This example gets all proposals. -require 'dfp_api' -class GetAllProposals +require 'dfp_api' - def self.run_example(dfp) - proposal_service = dfp.service(:ProposalService, :v201711) +def get_all_proposals(dfp) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) - # Create a statement to select proposals. - statement = DfpApi::FilterStatement.new() + # Create a statement to select proposals. + statement = dfp.new_statement_builder() - # Retrieve a small amount of proposals at a time, paging through until all - # proposals have been retrieved. - total_result_set_size = 0 - begin - page = - proposal_service.get_proposals_by_statement(statement.toStatement()) + # Retrieve a small amount of proposals at a time, paging through until all + # proposals have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_service.get_proposals_by_statement(statement.to_statement()) - # Print out some information for each proposal. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal, index| - puts "%d) Proposal with ID %d and name '%s' was found." % - [index + statement.offset, proposal[:id], proposal[:name]] - end + # Print out some information for each proposal. + unless page[:results].nil? + page[:results].each_with_index do |proposal, index| + puts '%d) Proposal with ID %d and name "%s" was found.' % + [index + statement.offset, proposal[:id], proposal[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size + end - puts 'Total number of proposals: %d' % total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of proposals: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_proposals(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllProposals.main() -end diff --git a/dfp_api/examples/v201711/proposal_service/get_marketplace_comments.rb b/dfp_api/examples/v201711/proposal_service/get_marketplace_comments.rb index 4af42a6b2..69d34dab7 100755 --- a/dfp_api/examples/v201711/proposal_service/get_marketplace_comments.rb +++ b/dfp_api/examples/v201711/proposal_service/get_marketplace_comments.rb @@ -20,69 +20,59 @@ require 'dfp_api' +def get_marketplace_comments(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) -class GetMarketplaceComments - - def self.run_example(dfp, proposal_id) - proposal_service = dfp.service(:ProposalService, :v201711) - - # Create a statement to select marketplace comments. - query = 'WHERE proposalId = :proposalId' - values = [ - { - :key => 'proposalId', - :value => {:xsi_type => 'NumberValue', :value => proposal_id} - } - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select marketplace comments. + statement = dfp.new_statement_builder do |sb| + sb.where = 'proposalId = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + end - # Retrieve comments. - page = proposal_service.get_marketplace_comments_by_statement( - statement.toStatement()) + # Retrieve comments. + page = proposal_service.get_marketplace_comments_by_statement( + statement.to_statement() + ) - # Print out some information for each comment. - if page[:results] - page[:results].each_with_index do |comment, index| - puts ("%d) Comment Marketplace comment with creation time '%s' and " + - "comment '%s' was found.") % [index + statement.offset, - comment[:proposal_id], comment[:creation_time], comment[:comment]] - end + # Print out some information for each comment. + unless page[:results].nil? + page[:results].each_with_index do |comment, index| + puts ('%d) Comment Marketplace comment with creation time "%s" and ' + + 'comment "%s" was found.') % [index + statement.offset, + comment[:proposal_id], comment[:creation_time], comment[:comment]] end - puts 'Total number of comments: %d' % (page[:total_result_set_size] || 0) end + puts 'Total number of comments: %d' % (page[:total_result_set_size] || 0) +end - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new +if __FILE__ == $0 + API_VERSION = :v201711 - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # Specify ID of the proposal to get comments for here. - proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, proposal_id) + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + get_marketplace_comments(dfp, proposal_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetMarketplaceComments.main() -end diff --git a/dfp_api/examples/v201711/proposal_service/get_proposals_pending_approval.rb b/dfp_api/examples/v201711/proposal_service/get_proposals_pending_approval.rb index 761be90f0..f5aefaacc 100755 --- a/dfp_api/examples/v201711/proposal_service/get_proposals_pending_approval.rb +++ b/dfp_api/examples/v201711/proposal_service/get_proposals_pending_approval.rb @@ -17,77 +17,66 @@ # limitations under the License. # # This example gets all proposals pending approval. -require 'dfp_api' -class GetProposalsPendingApproval +require 'dfp_api' - def self.run_example(dfp) - proposal_service = - dfp.service(:ProposalService, :v201711) +def get_proposals_pending_approval(dfp) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) - # Create a statement to select proposals. - query = 'WHERE status = :status' - values = [ - { - :key => 'status', - :value => { - :xsi_type => 'TextValue', - :value => 'PENDING_APPROVAL' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select proposals. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'PENDING_APPROVAL') + end - # Retrieve a small amount of proposals at a time, paging through until all - # proposals have been retrieved. - total_result_set_size = 0 - begin - page = - proposal_service.get_proposals_by_statement(statement.toStatement()) + # Retrieve a small amount of proposals at a time, paging through until all + # proposals have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_service.get_proposals_by_statement(statement.to_statement()) - # Print out some information for each proposal. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |proposal, index| - puts "%d) Proposal with ID %d and name '%s' was found." % - [index + statement.offset, proposal[:id], proposal[:name]] - end + # Print out some information for each proposal. + unless page[:results].nil? + page[:results].each_with_index do |proposal, index| + puts '%d) Proposal with ID %d and name "%s" was found.' % + [index + statement.offset, proposal[:id], proposal[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < total_result_set_size + end - puts 'Total number of proposals: %d' % total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size + + puts 'Total number of proposals: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_proposals_pending_approval(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetProposalsPendingApproval.main() -end diff --git a/dfp_api/examples/v201711/proposal_service/request_buyer_acceptance.rb b/dfp_api/examples/v201711/proposal_service/request_buyer_acceptance.rb new file mode 100755 index 000000000..bfcc29bd5 --- /dev/null +++ b/dfp_api/examples/v201711/proposal_service/request_buyer_acceptance.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example requests buyer acceptance for a single proposal. To determine +# which proposals exist, run get_all_proposals.rb. + +require 'dfp_api' + +def request_buyer_acceptance(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select a single proposal. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + sb.limit = 1 + end + + # Get the proposal. + response = proposal_service.get_proposals_by_statement( + statement.to_statement() + ) + if response[:results].to_a.size < 1 + raise 'No proposals found to push to Marketplace.' + end + proposal = response[:results].first + + # Display some information about the proposal to be updated. + puts ('Programmatic proposal with ID %d, name "%s", and status "%s" ' + + 'will be pushed to Marketplace.') % [proposal[:id], proposal[:name], + proposal[:status]] + + # Perform action. + result = proposal_service.perform_proposal_action( + {:xsi_type => 'RequestBuyerAcceptance'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of programmatic proposals pushed to Marketplace: %d" % + result[:num_changes] + else + puts 'No programmatic proposals were pushed to Marketplace.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + request_buyer_acceptance(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/proposal_service/update_proposal.rb b/dfp_api/examples/v201711/proposal_service/update_proposal.rb new file mode 100755 index 000000000..ea6524eaf --- /dev/null +++ b/dfp_api/examples/v201711/proposal_service/update_proposal.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates the notes of a single proposal. To determine which +# proposals exist, run get_all_proposals.rb. + +require 'dfp_api' + +def update_proposal(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select a single proposal. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + sb.limit = 1 + end + + # Get the proposal. + response = proposal_service.get_proposals_by_statement( + statement.to_statement() + ) + raise 'No proposals found to update.' if response[:results].to_a.size < 1 + proposal = response[:results].first + + # Update the proposal by changing its notes. + proposal[:internal_notes] = 'Proposal needs review before approval.' + + # Send update to the server. + updated_proposals = proposal_service.update_proposals([proposal]) + + # Display the results. + if updated_proposals.to_a.size > 0 + updated_proposals.each do |proposal| + puts 'Proposal with ID %d and name "%s" was updated.' % + [proposal[:id], proposal[:name]] + end + else + puts 'No proposals were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + update_proposal(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/publisher_query_language_service/fetch_match_tables.rb b/dfp_api/examples/v201711/publisher_query_language_service/fetch_match_tables.rb index 3dff52c3c..4852f837f 100755 --- a/dfp_api/examples/v201711/publisher_query_language_service/fetch_match_tables.rb +++ b/dfp_api/examples/v201711/publisher_query_language_service/fetch_match_tables.rb @@ -24,22 +24,9 @@ # https://developers.google.com/doubleclick-publishers/docs/reference/v201711/PublisherQueryLanguageService require 'tempfile' - require 'dfp_api' - -API_VERSION = :v201711 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = ',' - -def fetch_match_tables() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def fetch_match_tables(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) @@ -47,16 +34,19 @@ def fetch_match_tables() fetch_tables = ['Line_Item', 'Ad_Unit'] fetch_tables.each do |table| - results_file_path = fetch_match_table(table, pql_service) - puts "%s table saved to:\n\t%s" % [table, results_file_path] + results_file_path = fetch_match_table(dfp, table, pql_service) + puts '%s table saved to:\n\t%s' % [table, results_file_path] end end # Fetches a match table from a PQL statement and writes it to a file. -def fetch_match_table(table_name, pql_service) +def fetch_match_table(dfp, table_name, pql_service) # Create a statement to select all items for the table. - statement = DfpApi::FilterStatement.new( - 'SELECT Id, Name, Status FROM %s ' % table_name + 'ORDER BY Id ASC') + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = table_name + sb.order_by = 'Id' + end # Set initial values. file_path = '%s.csv' % table_name @@ -64,30 +54,43 @@ def fetch_match_table(table_name, pql_service) open(file_path, 'wb') do |file| file_path = file.path() begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Only write column names if the first page. - if (offset == 0) + if statement.offset == 0 columns = result_set[:column_types].collect {|col| col[:label_name]} - file.write(columns.join(COLUMN_SEPARATOR) + "\n") + file.write(columns.join(COLUMN_SEPARATOR) + '\n') end # Print out every row. result_set[:rows].each do |row_set| row = row_set[:values].collect {|item| item[:value]} - file.write(row.join(COLUMN_SEPARATOR) + "\n") + file.write(row.join(COLUMN_SEPARATOR) + '\n') end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while result_set[:rows].size == statement.limit end return file_path end if __FILE__ == $0 + API_VERSION = :v201711 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = ',' + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - fetch_match_tables() + fetch_match_tables(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_all_browsers.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_all_browsers.rb new file mode 100755 index 000000000..6d839599e --- /dev/null +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_all_browsers.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all browsers available to target from the Browser table. +# The Browser PQL table schema can be found here: +# +# https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService + +require 'dfp_api' + +def get_all_browsers(dfp) + # Get the PublisherQueryLanguageService. + pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) + + # Build a statement to select all line items. + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, BrowserName, MajorVersion, MinorVersion' + sb.from = 'Browser' + sb.order_by = 'BrowserName' + end + + # Set initial values for paging. + result_set, all_rows = nil, 0 + + # Get all line items with paging. + begin + result_set = pql_service.select(statement.to_statement()) + + unless result_set.nil? + # Print out columns header. + columns = result_set[:column_types].collect {|col| col[:label_name]} + puts columns.join(COLUMN_SEPARATOR) + + # Print out every row. + result_set[:rows].each do |row_set| + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) + end + end + + statement.offset += statement.limit + all_rows += result_set[:rows].size + end while result_set[:rows].size == statement.limit + + puts "Total number of rows found: %d" % all_rows +end + +if __FILE__ == $0 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_browsers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_all_line_items.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_all_line_items.rb index 059069a0d..0bbed23de 100755 --- a/dfp_api/examples/v201711/publisher_query_language_service/get_all_line_items.rb +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_all_line_items.rb @@ -23,59 +23,61 @@ require 'dfp_api' - -API_VERSION = :v201711 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_all_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_all_line_items(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Statement parts to help build a statement to select all line items. - statement = DfpApi::FilterStatement.new( - 'SELECT Id, Name, Status FROM Line_Item ORDER BY Id ASC') + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = 'Line_Item' + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all line items with paging. begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Print out columns header. columns = result_set[:column_types].collect {|col| col[:label_name]} puts columns.join(COLUMN_SEPARATOR) # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts 'Total number of rows found: %d' % row_count end if __FILE__ == $0 + API_VERSION = :v201711 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = '\t' + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_all_line_items() + get_all_line_items(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_all_programmatic_buyers.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_all_programmatic_buyers.rb new file mode 100755 index 000000000..956f4e220 --- /dev/null +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_all_programmatic_buyers.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all programmatic buyer information from the PQL table. The +# Programmatic_Buyer PQL table schema can be found here: +# +# https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService + +require 'dfp_api' + +def get_all_programmatic_buyers(dfp) + # Get the PublisherQueryLanguageService. + pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) + + # Build a statement to select all programmatic buyers. + statement = dfp.new_statement_builder do |sb| + sb.select = 'BuyerAccountId, Name' + sb.from = 'Programmatic_Buyer' + sb.order_by = 'BuyerAccountId' + end + + # Set initial values for paging. + result_set, all_rows = nil, 0 + + # Get all programmatic buyers with paging. + begin + result_set = pql_service.select(statement.to_statement()) + + unless result_set.nil? + # Print out columns header. + columns = result_set[:column_types].collect {|col| col[:label_name]} + puts columns.join(COLUMN_SEPARATOR) + + # Print out every row. + result_set[:rows].each do |row_set| + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) + end + end + + statement.offset += statement.limit + all_rows += result_set[:rows].size + end while result_set[:rows].size == statement.limit + + puts "Total number of rows found: %d" % all_rows +end + +if __FILE__ == $0 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_programmatic_buyers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_geo_targets.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_geo_targets.rb index 7833e5251..020515970 100755 --- a/dfp_api/examples/v201711/publisher_query_language_service/get_geo_targets.rb +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_geo_targets.rb @@ -23,62 +23,65 @@ require 'dfp_api' - -API_VERSION = :v201711 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_geo_targets() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_geo_targets(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Create a statement to select all targetable cities. - statement_text = "SELECT Id, Name, CanonicalParentId, ParentIds, " + - "CountryCode, Type, Targetable FROM Geo_Target WHERE Type = 'City' " + - "AND Targetable = true ORDER BY Id ASC" - - statement = DfpApi::FilterStatement.new(statement_text) + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, CanonicalParentId, ParentIds, CountryCode, Type, ' + + 'Targetable' + sb.from = 'Geo_Target' + sb.where = 'Type = :type AND Targetable = :targetable' + sb.with_bind_variable('type', 'City') + sb.with_bind_variable('targetable', true) + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all cities with paging. begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Print out columns header. columns = result_set[:column_types].collect {|col| col[:label_name]} puts columns.join(COLUMN_SEPARATOR) # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts "Total number of rows found: %d" % row_count end if __FILE__ == $0 + API_VERSION = :v201711 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_geo_targets() + get_geo_targets(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_line_items_named_like.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_line_items_named_like.rb index 2cf89c540..9754ccb31 100755 --- a/dfp_api/examples/v201711/publisher_query_language_service/get_line_items_named_like.rb +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_line_items_named_like.rb @@ -21,35 +21,24 @@ require 'dfp_api' - -API_VERSION = :v201711 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_line_items_named_like() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_line_items_named_like(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Create a statement to select all line items matching subtext. - statement_text = - "SELECT Id, Name, Status FROM Line_Item WHERE Name LIKE 'line item%%' " + - "ORDER BY Id ASC" - - statement = DfpApi::FilterStatement.new(statement_text) + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = 'Line_Item' + sb.where = 'Name LIKE \'line item %%\'' + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all line items starting with "line item". begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) if result_set # Print out columns header. @@ -58,25 +47,36 @@ def get_line_items_named_like() # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts "Total number of rows found: %d" % row_count end if __FILE__ == $0 + API_VERSION = :v201711 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_line_items_named_like() + get_line_items_named_like(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/publisher_query_language_service/get_recent_changes.rb b/dfp_api/examples/v201711/publisher_query_language_service/get_recent_changes.rb index c84ed4970..6c69499f1 100755 --- a/dfp_api/examples/v201711/publisher_query_language_service/get_recent_changes.rb +++ b/dfp_api/examples/v201711/publisher_query_language_service/get_recent_changes.rb @@ -22,41 +22,55 @@ # A full list of available tables can be found at # https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService -require 'date' - require 'dfp_api' -API_VERSION = :v201711 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_recent_changes() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_recent_changes(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) - start_date_time = DateTime.parse(Date.today.to_s). - strftime('%Y-%m-%dT%H:%M:%S') - end_date_time = DateTime.parse((Date.today - 1).to_s). - strftime('%Y-%m-%dT%H:%M:%S') + # Set end_time to the beginning of today. + today = dfp.today() + end_time = dfp.datetime( + today.year, + today.month, + today.day, + 0, + 0, + 0, + 'America/New_York' + ) + + # Set start_time to the beginning of yesterday. + yesterday = today - 1 + start_time = dfp.datetime( + yesterday.year, + yesterday.month, + yesterday.day, + 0, + 0, + 0, + 'America/New_York' + ) # Create a statement to select recent changes. Change_History only supports # ordering by descending ChangeDateTime. To prevent complications from # changes that occur while paging, offset is not supported. Filter for a # specific time range instead. - statement = get_filter_statement(start_date_time, end_date_time) + statement = dfp.new_statement_builder do |sb| + sb.select = 'ChangeDateTime, EntityId, EntityType, Operation' + sb.from = 'Change_History' + sb.where = 'ChangeDateTime > :start_time AND ChangeDateTime < :end_time' + sb.order_by = 'ChangeDateTime' + sb.ascending = false + sb.with_bind_variable('start_time', start_time) + sb.with_bind_variable('end_time', end_time) + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) if result_set # Print out columns header. @@ -65,55 +79,40 @@ def get_recent_changes() # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - row[0] = format_date(row[0]) - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + change_date_time = dfp.datetime(row[0]) + row[0] = change_date_time.strftime('%Y-%m-%d %H:%M:%S ') + + row[0][:time_zone_id] + puts row.join(COLUMN_SEPARATOR) end # Get the earliest change time in the result set. - last_date_time = - format_date(result_set[:rows][-1][:values][0][:value], false) - statement = get_filter_statement(last_date_time, end_date_time) - all_rows += result_set[:rows].size + last_date_time = result_set[:rows][-1][:values][0][:value] + statement.configure do |sb| + sb.with_bind_variable('start_time', last_date_time) + end + row_count += result_set[:rows].size end end while result_set && result_set[:rows] && - result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + result_set[:rows].size == statement.limit - puts 'Total number of rows found: %d' % all_rows + puts 'Total number of rows found: %d' % row_count end -def get_filter_statement(start_date_time, end_date_time) - DfpApi::FilterStatement.new( - 'SELECT ChangeDateTime, EntityId, EntityType, Operation ' + - 'FROM Change_History ' + - 'WHERE ChangeDateTime < :start_date_time ' + - 'AND ChangeDateTime > :end_date_time ' + - 'ORDER BY ChangeDateTime DESC', - [ - { - :key => 'start_date_time', - :value => {:value => start_date_time, :xsi_type => 'TextValue'} - }, - { - :key => 'end_date_time', - :value => {:value => end_date_time, :xsi_type => 'TextValue'} - } - ] - ) -end +if __FILE__ == $0 + API_VERSION = :v201711 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" -def format_date(date_hash, with_time_zone = true) - date_time = '%s-%02d-%02dT%02d:%02d:%02d' % [ - date_hash[:date][:year], date_hash[:date][:month], date_hash[:date][:day], - date_hash[:hour], date_hash[:minute], date_hash[:second] - ] - date_time += ' %s' % date_hash[:time_zone_id] if with_time_zone - return date_time -end + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') -if __FILE__ == $0 begin - get_recent_changes() + get_recent_changes(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/rate_card_service/get_all_rate_cards.rb b/dfp_api/examples/v201711/rate_card_service/get_all_rate_cards.rb index 414683030..592e5528f 100755 --- a/dfp_api/examples/v201711/rate_card_service/get_all_rate_cards.rb +++ b/dfp_api/examples/v201711/rate_card_service/get_all_rate_cards.rb @@ -17,72 +17,66 @@ # limitations under the License. # # This example gets all rate cards. -require 'dfp_api' -class GetAllRateCards +require 'dfp_api' - def self.run_example(dfp) - rate_card_service = - dfp.service(:RateCardService, :v201711) +def get_all_rate_cards(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) - # Create a statement to select rate cards. - statement = DfpApi::FilterStatement.new() + # Create a statement to select rate cards. + statement = dfp.new_statement_builder() - # Retrieve a small amount of rate cards at a time, paging - # through until all rate cards have been retrieved. - total_result_set_size = 0; - begin - page = rate_card_service.get_rate_cards_by_statement( - statement.toStatement()) + # Retrieve a small amount of rate cards at a time, paging + # through until all rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) - # Print out some information for each rate card. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |rate_card, index| - puts "%d) Rate card with ID %d, name '%s', and currency code '%s' was found." % [ - index + statement.offset, - rate_card[:id], - rate_card[:name], - rate_card[:currency_code] - ] - end + # Print out some information for each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts ('%d) Rate card with ID %d, name "%s", and currency code "%s" ' + + 'was found.') % [index + statement.offset, rate_card[:id], + rate_card[:name], rate_card[:currency_code]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of rate cards: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_rate_cards(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllRateCards.main() -end diff --git a/dfp_api/examples/v201711/rate_card_service/get_marketplace_rate_cards.rb b/dfp_api/examples/v201711/rate_card_service/get_marketplace_rate_cards.rb index 86c55af7f..ee49aad1e 100755 --- a/dfp_api/examples/v201711/rate_card_service/get_marketplace_rate_cards.rb +++ b/dfp_api/examples/v201711/rate_card_service/get_marketplace_rate_cards.rb @@ -17,82 +17,69 @@ # limitations under the License. # # This example gets all rate cards that can be used for Marketplace products. -require 'dfp_api' -class GetMarketplaceRateCards +require 'dfp_api' - def self.run_example(dfp) - rate_card_service = - dfp.service(:RateCardService, :v201711) +def get_marketplace_rate_cards(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) - # Create a statement to select rate cards. - query = 'WHERE forMarketplace = :forMarketplace' - values = [ - { - :key => 'forMarketplace', - :value => { - :xsi_type => 'BooleanValue', - :value => 'true' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select rate cards. + statement = dfp.new_statement_builder do |sb| + sb.where = 'forMarketplace = :for_marketplace' + sb.with_bind_variable('for_marketplace', true) + end - # Retrieve a small amount of rate cards at a time, paging - # through until all rate cards have been retrieved. - total_result_set_size = 0; - begin - page = rate_card_service.get_rate_cards_by_statement( - statement.toStatement()) + # Retrieve a small amount of rate cards at a time, paging + # through until all rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) - # Print out some information for each rate card. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |rate_card, index| - puts "%d) Rate card with ID %d, name '%s', and currency code '%s' was found." % [ - index + statement.offset, - rate_card[:id], - rate_card[:name], - rate_card[:currency_code] - ] - end + # Print out some information for each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts ('%d) Rate card with ID %d, name "%s", and currency code "%s" ' + + 'was found.') % [index + statement.offset, rate_card[:id], + rate_card[:name], rate_card[:currency_code]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of rate cards: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_marketplace_rate_cards(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetMarketplaceRateCards.main() -end diff --git a/dfp_api/examples/v201711/rate_card_service/get_rate_cards_by_statement.rb b/dfp_api/examples/v201711/rate_card_service/get_rate_cards_by_statement.rb new file mode 100755 index 000000000..8a773b1f5 --- /dev/null +++ b/dfp_api/examples/v201711/rate_card_service/get_rate_cards_by_statement.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all rate cards that have a currency in US dollars. + +require 'dfp_api' + +def get_rate_cards_by_statement(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) + + # Create a statement to select rate cards. + statement = dfp.new_statement_builder do |sb| + sb.where = 'currencyCode = :currency_code' + sb.with_bind_variable('currency_code', 'USD') + end + + # Retrieve a small number of rate cards at a time, paging through until all + # rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get rate cards by statement. + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) + + # Display some information about each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts "%d) Rate card with ID %d and name '%s' was found." % + [index + statement.offset, rate_card[:id], rate_card[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_rate_cards_by_statement(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb b/dfp_api/examples/v201711/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb new file mode 100755 index 000000000..d532ee45b --- /dev/null +++ b/dfp_api/examples/v201711/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item reports for a given reconcilliation report. To +# determine how many reconciliation reports exist, run +# get_all_reconciliation_reports.rb. + +require 'dfp_api' + +def get_reconciliation_line_item_reports_for_reconciliation_report(dfp, + reconciliation_report_id) + # Get the ReconciliationLineItemReportService. + reconciliation_line_item_report_service = + dfp.service(:ReconciliationLineItemReportService, API_VERSION) + + # Create a statement to select reconciliation line item report. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id AND ' + + 'lineItemId != :line_item_id' + sb.with_bind_variable('reconciliation_report_id', reconciliation_report_id) + sb.with_bind_variable('line_item_id', 0) + sb.order_by = 'lineItemId' + end + + # Retrieve a small number of reconciliation line item reports at a time, + # paging through until all reconciliation line item reports have been + # retrieved. + page = {:total_result_set_size => 0} + begin + # Get reconciliation line item reports by statement. + page = reconciliation_line_item_report_service. + get_reconciliation_line_item_reports_by_statement( + statement.to_statement() + ) + + # Display some information about each reconciliation line item report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_line_item_report, index| + puts ('%d) Reconciliation line item report with ID %d and status ' + + '"%s" was found.') % [index + statement.offset, + reconciliation_line_item_report[:id], + reconciliation_line_item_report[:status]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation line item reports: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_line_item_reports_for_reconciliation_report( + dfp, reconciliation_report_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb b/dfp_api/examples/v201711/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb index 1e3d25d90..621cd3e68 100755 --- a/dfp_api/examples/v201711/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb +++ b/dfp_api/examples/v201711/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb @@ -16,84 +16,78 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example gets all reconciliation order reports for a given reconciliation report. +# This example gets all reconciliation order reports for a given reconciliation +# report. + require 'dfp_api' -class GetReconciliationOrderReportsForReconciliationReport +def get_reconciliation_order_reports_for_reconciliation_report(dfp, + reconciliation_report_id) + reconciliation_order_report_service = + dfp.service(:ReconciliationOrderReportService, API_VERSION) - RECONCILIATION_REPORT_ID = 'INSERT_RECONCILIATION_REPORT_ID_HERE'; + # Create a statement to select reconciliation order reports. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id' + sb.with_bind_variable( + 'reoconciliation_report_id', reconciliation_report_id + ) + end - def self.run_example(dfp, reconciliation_report_id) - reconciliation_order_report_service = - dfp.service(:ReconciliationOrderReportService, :v201711) + # Retrieve a small amount of reconciliation order reports at a time, paging + # through until all reconciliation order reports have been retrieved. + page = {:total_result_set_size => 0} + begin + page = reconciliation_order_report_service. + get_reconciliation_order_reports_by_statement(statement.to_statement()) - # Create a statement to select reconciliation order reports. - query = 'WHERE reconciliationReportId = :reconciliationReportId' - values = [ - { - :key => 'reconciliationReportId', - :value => { - :xsi_type => 'NumberValue', - :value => reconciliation_report_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each reconciliation order report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_order_report, index| + puts ('%d) Reconciliation order report with ID %d and status "%s" ' + + 'was found.') % [index + statement.offset, + reconciliation_order_report[:id], + reconciliation_order_report[:status]] + end + end - # Retrieve a small amount of reconciliation order reports at a time, paging - # through until all reconciliation order reports have been retrieved. - total_result_set_size = 0; - begin - page = reconciliation_order_report_service.get_reconciliation_order_reports_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each reconciliation order report. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |reconciliation_order_report, index| - puts "%d) Reconciliation order report with ID %d and status '%s' was found." % [ - index + statement.offset, - reconciliation_order_report[:id], - reconciliation_order_report[:status] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of reconciliation order reports: %d' % + page[:total_result_set_size] +end - puts 'Total number of reconciliation order reports: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, RECONCILIATION_REPORT_ID.to_i) + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_order_reports_for_reconciliation_report( + dfp, reconciliation_report_id + ) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetReconciliationOrderReportsForReconciliationReport.main() -end diff --git a/dfp_api/examples/v201711/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb b/dfp_api/examples/v201711/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb new file mode 100755 index 000000000..0d71931ad --- /dev/null +++ b/dfp_api/examples/v201711/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb @@ -0,0 +1,95 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Gets a reconciliation report's rows for line items that served through DFP. + +require 'dfp_api' + +def get_reconciliation_report_rows_for_reconciliation_report(dfp, + reconciliation_report_id) + # Get the ReconciliationReportRowService. + reconciliation_report_row_service = + dfp.service(:ReconciliationReportRowService, API_VERSION) + + # Create a statement to select reconciliation report rows. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id AND ' + + 'lineItemId != :line_item_id' + sb.with_bind_variable('reconciliation_report_id', reconciliation_report_id) + sb.with_bind_variable('line_item_id', 0) + sb.order_by = 'lineItemId' + end + + # Retrieve a small number of reconciliation report rows at a time, paging + # through until all reconciliation report rows have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get reconciliation report rows by statement. + page = reconciliation_report_row_service. + get_reconciliation_report_rows_by_statement(statement.to_statement()) + + # Print out some information for each reconciliation report row. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_report_row, index| + puts ('%d) Reconciliation report row with ID %d, reconciliation ' + + 'source "%s", and reconciled volume %s was found.') % + [index + statement.offset, + reconciliation_report_row[:id], + reconciliation_report_row[:reconciliation_source], + reconciliation_report_row[:reconciled_volume] || 'nil'] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation report rows: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_report_rows_for_reconciliation_report( + dfp, reconciliation_report_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/reconciliation_report_service/get_all_reconciliation_reports.rb b/dfp_api/examples/v201711/reconciliation_report_service/get_all_reconciliation_reports.rb index e9d97e7bb..423b6375f 100755 --- a/dfp_api/examples/v201711/reconciliation_report_service/get_all_reconciliation_reports.rb +++ b/dfp_api/examples/v201711/reconciliation_report_service/get_all_reconciliation_reports.rb @@ -17,77 +17,72 @@ # limitations under the License. # # This example gets all reconciliation reports. + require 'dfp_api' require 'date' -class GetAllReconciliationReports - - def self.run_example(dfp) - reconciliation_report_service = - dfp.service(:ReconciliationReportService, :v201711) +def get_all_reconciliation_reports(dfp) + reconciliation_report_service = + dfp.service(:ReconciliationReportService, API_VERSION) - # Create a statement to select reconciliation reports. - statement = DfpApi::FilterStatement.new() + # Create a statement to select reconciliation reports. + statement = dfp.new_statement_builder() - # Retrieve a small amount of reconciliation reports at a time, paging - # through until all reconciliation reports have been retrieved. - total_result_set_size = 0; - begin - page = reconciliation_report_service.get_reconciliation_reports_by_statement( - statement.toStatement()) + # Retrieve a small amount of reconciliation reports at a time, paging + # through until all reconciliation reports have been retrieved. + page = {:total_result_set_size => 0} + begin + page = reconciliation_report_service. + get_reconciliation_reports_by_statement(statement.to_statement()) - # Print out some information for each reconciliation report. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |reconciliation_report, index| - start_date = reconciliation_report[:start_date] - start_date_string = Date.new( - start_date[:year], - start_date[:month], - start_date[:day]).to_s - puts "%d) Reconciliation report with ID %d and start date '%s' was found." % [ - index + statement.offset, - reconciliation_report[:id], - start_date_string - ] - end + # Print out some information for each reconciliation report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_report, index| + start_date = reconciliation_report[:start_date] + start_date_string = Date.new( + start_date[:year], + start_date[:month], + start_date[:day]).to_s + puts ('%d) Reconciliation report with ID %d and start date "%s" was ' + + 'found.') % [index + statement.offset, reconciliation_report[:id], + start_date_string] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of reconciliation reports: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of reconciliation reports: %d' % + page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_reconciliation_reports(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllReconciliationReports.main() -end diff --git a/dfp_api/examples/v201711/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb b/dfp_api/examples/v201711/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb new file mode 100755 index 000000000..e5c391579 --- /dev/null +++ b/dfp_api/examples/v201711/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets the previous billing period's reconciliation report. + +require 'dfp_api' + +def get_reconciliation_report_for_last_billing_period(dfp) + # Get the ReconciliationReportService. + reconciliation_report_service = + dfp.service(:ReconciliationReportService, API_VERSION) + + # Create a date representing the first day of the previous month. + previous_month = dfp.today() << 1 + first_day_of_previous_month = dfp.date( + previous_month.year, + previous_month.month, + 1 + ) + + # Create a statement to select the last billing period's reconciliation + # report. + statement = dfp.new_statement_builder do |sb| + sb.where = 'startDate = :start_date' + sb.with_bind_variable('start_date', first_day_of_previous_month) + sb.limit = 1 + end + + # Get the reconciliation report. + response = reconciliation_report_service. + get_reconciliation_reports_by_statement(statement.to_statement()) + if response[:results].to_a.size < 1 + raise 'No reconciliation report found for last month.' + end + reconciliation_report = response[:results].first + + # Display the results. + start_date = dfp.date(reconciliation_report[:start_date]) + puts 'Reconciliation report with ID %d and start date "%s" was found.' % + [reconciliation_report[:id], start_date.strftime] +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_reconciliation_report_for_last_billing_period(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/report_service/display_report.rb b/dfp_api/examples/v201711/report_service/display_report.rb index 388efbf7c..9b322529a 100755 --- a/dfp_api/examples/v201711/report_service/display_report.rb +++ b/dfp_api/examples/v201711/report_service/display_report.rb @@ -21,25 +21,12 @@ # a report, run run_delivery_report.rb. require 'dfp_api' - require 'open-uri' -API_VERSION = :v201711 - -def display_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def display_report(dfp, report_job_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the completed report. - report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i - # Set the format of the report (e.g. CSV_DUMP) and download without # compression so we can print it. report_download_options = { @@ -49,15 +36,26 @@ def display_report() # Get the report URL. download_url = report_service.get_report_download_url_with_options( - report_job_id, report_download_options); + report_job_id, report_download_options + ) - puts "Downloading report from URL %s.\n" % download_url + puts 'Downloading report from URL %s.\n' % download_url puts open(download_url).read() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - display_report() + report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i + display_report(dfp, report_job_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/download_report.rb b/dfp_api/examples/v201711/report_service/download_report.rb index 8751c196d..b30d55fb5 100755 --- a/dfp_api/examples/v201711/report_service/download_report.rb +++ b/dfp_api/examples/v201711/report_service/download_report.rb @@ -16,48 +16,46 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example downloads a completed report. To run a report, run -# run_delivery_report.rb, run_sales_report.rb or run_inventory_report.rb. +# This example downloads a completed report. By default, downloaded reports +# are compressed to a gzip file. To run a report, run run_delivery_report.rb, +# run_sales_report.rb or run_inventory_report.rb. require 'dfp_api' - require 'open-uri' -API_VERSION = :v201711 - -def download_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def download_report(dfp, report_job_id, file_name) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the completed report. - report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i - - # Set the file path and name to save to. - file_name = 'INSERT_FILE_PATH_AND_NAME_HERE' - - # Change to your preffered export format. + # Set the export format used to generate the report. Other options include, + # TSV, TSV_EXCEL, and XML. export_format = 'CSV_DUMP' # Get the report URL. download_url = report_service.get_report_download_url( - report_job_id, export_format); + report_job_id, export_format + ) - puts "Downloading [%s] to [%s]..." % [download_url, file_name] + puts 'Downloading "%s" to "%s"...' % [download_url, file_name] open(file_name, 'wb') do |local_file| local_file << open(download_url).read() end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - download_report() + report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i + file_name = 'INSERT_FILE_PATH_AND_NAME_HERE' + download_report(dfp, report_job_id, file_name) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_delivery_report.rb b/dfp_api/examples/v201711/report_service/run_delivery_report.rb index 0d9806e4e..d4f24e5a3 100755 --- a/dfp_api/examples/v201711/report_service/run_delivery_report.rb +++ b/dfp_api/examples/v201711/report_service/run_delivery_report.rb @@ -20,53 +20,33 @@ # with additional attributes and can filter to include just one order. # To download the report see download_report.rb. -require 'date' require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_delivery_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_delivery_report(dfp, order_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Specify the order ID to filter by. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Specify a report to run for the last 7 days. - report_end_date = DateTime.now + report_end_date = dfp.today() report_start_date = report_end_date - 7 + # Create statement object to filter for an order. + statement = dfp.new_report_statement_builder do |sb| + sb.where = 'ORDER_ID = :order_id' + sb.with_bind_variable('order_id', order_id) + end + # Create report query. report_query = { :date_range_type => 'CUSTOM_DATE', - :start_date => {:year => report_start_date.year, - :month => report_start_date.month, - :day => report_start_date.day}, - :end_date => {:year => report_end_date.year, - :month => report_end_date.month, - :day => report_end_date.day}, + :start_date => report_start_date.to_h, + :end_date => report_end_date.to_h, :dimensions => ['ORDER_ID', 'ORDER_NAME'], :dimension_attributes => ['ORDER_TRAFFICKER', 'ORDER_START_DATE_TIME', 'ORDER_END_DATE_TIME'], :columns => ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS', 'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE', 'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'], - # Create statement object to filter for an order. - :statement => { - :query => 'WHERE ORDER_ID = :order_id', - :values => [ - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ] - } + :statement => statement.to_statement() } # Create report job. @@ -80,18 +60,29 @@ def run_delivery_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_delivery_report() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + run_delivery_report(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_inventory_report.rb b/dfp_api/examples/v201711/report_service/run_inventory_report.rb index b374eef8a..ecd23b95d 100755 --- a/dfp_api/examples/v201711/report_service/run_inventory_report.rb +++ b/dfp_api/examples/v201711/report_service/run_inventory_report.rb @@ -16,40 +16,26 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example runs a report equal to the "Whole network report" on the DFP -# website. To download the report see download_report.rb. +# This example runs a typical daily inventory report. To download the report +# see download_report.rb. require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_inventory_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_inventory_report(dfp) # Get the ReportService and NetworkService. report_service = dfp.service(:ReportService, API_VERSION) network_service = dfp.service(:NetworkService, API_VERSION) # Get the root ad unit ID to filter on. root_ad_unit_id = - network_service.get_current_network()[:effective_root_ad_unit_id] + network_service.get_current_network()[:effective_root_ad_unit_id].to_i # Create statement to filter on a parent ad unit with the root ad unit ID # to include all ad units in the network. - statement = { - :query => 'WHERE PARENT_AD_UNIT_ID = :parent_ad_unit_id', - :values => [ - {:key => 'parent_ad_unit_id', - :value => {:value => root_ad_unit_id, :xsi_type => 'NumberValue'}} - ] - } + statement = dfp.new_report_statement_builder do |sb| + sb.where = 'PARENT_AD_UNIT_ID = :parent_ad_unit_id' + sb.with_bind_variable('parent_ad_unit_id', root_ad_unit_id) + end # Create report query. report_query = { @@ -64,7 +50,7 @@ def run_inventory_report() 'TOTAL_INVENTORY_LEVEL_IMPRESSIONS', 'TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE' ], - :statement => statement + :statement => statement.to_statement() } # Create report job. @@ -78,18 +64,28 @@ def run_inventory_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_inventory_report() + run_inventory_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_reach_report.rb b/dfp_api/examples/v201711/report_service/run_reach_report.rb index 230f249f0..ee984e685 100755 --- a/dfp_api/examples/v201711/report_service/run_reach_report.rb +++ b/dfp_api/examples/v201711/report_service/run_reach_report.rb @@ -21,18 +21,7 @@ require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_reach_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_reach_report(dfp) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) @@ -54,18 +43,28 @@ def run_reach_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_reach_report() + run_reach_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_report_with_custom_fields.rb b/dfp_api/examples/v201711/report_service/run_report_with_custom_fields.rb index 65c083adf..beea7d4cc 100755 --- a/dfp_api/examples/v201711/report_service/run_report_with_custom_fields.rb +++ b/dfp_api/examples/v201711/report_service/run_report_with_custom_fields.rb @@ -21,24 +21,10 @@ require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_report_with_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_report_with_custom_fields(dfp, custom_field_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the custom field to filter on. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - # Create report query. report_query = { :date_range_type => 'LAST_MONTH', @@ -58,18 +44,29 @@ def run_report_with_custom_fields() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_report_with_custom_fields() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + run_report_with_custom_fields(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_sales_report.rb b/dfp_api/examples/v201711/report_service/run_sales_report.rb index 99f7b1aab..23b8185d0 100755 --- a/dfp_api/examples/v201711/report_service/run_sales_report.rb +++ b/dfp_api/examples/v201711/report_service/run_sales_report.rb @@ -21,18 +21,7 @@ require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_sales_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_sales_report(dfp) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) @@ -58,18 +47,28 @@ def run_sales_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_sales_report() + run_sales_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/report_service/run_saved_query.rb b/dfp_api/examples/v201711/report_service/run_saved_query.rb index 6e87dbd18..bf674980a 100755 --- a/dfp_api/examples/v201711/report_service/run_saved_query.rb +++ b/dfp_api/examples/v201711/report_service/run_saved_query.rb @@ -21,37 +21,19 @@ require 'dfp_api' -API_VERSION = :v201711 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_saved_query(saved_query_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_saved_query(dfp, saved_query_id) # Get the ReportService and NetworkService. report_service = dfp.service(:ReportService, API_VERSION) # Create statement to select a single saved report query. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => { - :value => saved_query_id, - :xsi_type => 'NumberValue'} - } - ], - # Limit results to single entity. - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :saved_query_id' + sb.with_bind_variable('saved_query_id', saved_query_id) + end saved_query_page = report_service.get_saved_queries_by_statement( - statement.toStatement()) + statement.to_statement() + ) unless saved_query_page[:results].nil? saved_query = response[:results].first @@ -62,20 +44,21 @@ def run_saved_query(saved_query_id) # Run report job. report_job = report_service.run_report_job(report_job); + report_job_status = 'IN_PROGRESS' MAX_RETRIES.times do |retry_count| # Get the report job status. report_job_status = report_service.get_report_job_status( - report_job[:id]) + report_job[:id] + ) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s."' % + [report_job[:id], report_job_status] else raise StandardError, 'Report query is not compatible with the API' end @@ -83,9 +66,20 @@ def run_saved_query(saved_query_id) end if __FILE__ == $0 + API_VERSION = :v201711 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - SAVED_QUERY_ID = 'INSERT_SAVED_QUERY_ID_HERE'.to_i - run_saved_query(SAVED_QUERY_ID) + saved_query_id = 'INSERT_SAVED_QUERY_ID_HERE'.to_i + run_saved_query(dfp, saved_query_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/suggested_ad_unit_service/approve_all_suggested_ad_units.rb b/dfp_api/examples/v201711/suggested_ad_unit_service/approve_all_suggested_ad_units.rb index abf7d455b..b15c04e9f 100755 --- a/dfp_api/examples/v201711/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +++ b/dfp_api/examples/v201711/suggested_ad_unit_service/approve_all_suggested_ad_units.rb @@ -16,68 +16,65 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This code example approves all suggested ad units with 50 or more requests. +# This code example approves all suggested ad units with more requests than the +# given threshold. # # This feature is only available to DFP premium solution networks. require 'dfp_api' - -API_VERSION = :v201711 -NUMBER_OF_REQUESTS = 50 - -def approve_suggested_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def approve_suggested_ad_units(dfp, num_requests) # Get the SuggestedAdUnitService. suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION) - # Create a statement to only select suggested ad units with 50 or more - # requests. - statement = DfpApi::FilterStatement.new( - 'WHERE numRequests >= :num_requests', - [ - {:key => 'num_requests', - :value => {:value => NUMBER_OF_REQUESTS, - :xsi_type => 'NumberValue'}} - ] - ) + # Create a statement to only select suggested ad units with more requests + # than the value of the num_requests parameter. + statement = dfp.new_statement_builder do |sb| + sb.where = 'numRequests >= :num_requests' + sb.with_bind_variable('num_requests', num_requests) + end begin # Get suggested ad units by statement. page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) + statement.to_statement() + ) unit_count_to_approve = 0 - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |ad_unit, index| - if ad_unit[:num_requests] >= NUMBER_OF_REQUESTS - puts(("%d) Suggested ad unit with ID '%s' and %d requests will be " + - "approved.") % [index + statement.offset, ad_unit[:id], - ad_unit[:num_requests]]) + if ad_unit[:num_requests] >= num_requests + puts ('%d) Suggested ad unit with ID "%s" and %d requests will be ' + + 'approved.') % [index + statement.offset, ad_unit[:id], + ad_unit[:num_requests]] unit_count_to_approve += 1 end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end puts "Number of suggested ad units to be approved: %d" % unit_count_to_approve if unit_count_to_approve > 0 + # Prepare statement for action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end + # Perform action with the same statement. result = suggested_ad_unit_service.perform_suggested_ad_unit_action( - {:xsi_type => 'ApproveSuggestedAdUnits'}, statement) + {:xsi_type => 'ApproveSuggestedAdUnits'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of ad units approved: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of ad units approved: %d' % result[:num_changes] else puts 'No ad units were approved.' end @@ -87,8 +84,18 @@ def approve_suggested_ad_units() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - approve_suggested_ad_units() + num_requests = 50 + approve_suggested_ad_units(dfp, num_requests) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/suggested_ad_unit_service/get_all_suggested_ad_units.rb b/dfp_api/examples/v201711/suggested_ad_unit_service/get_all_suggested_ad_units.rb index d0e475e8a..5646ca67c 100755 --- a/dfp_api/examples/v201711/suggested_ad_unit_service/get_all_suggested_ad_units.rb +++ b/dfp_api/examples/v201711/suggested_ad_unit_service/get_all_suggested_ad_units.rb @@ -17,71 +17,66 @@ # limitations under the License. # # This example gets all suggested ad units. -require 'dfp_api' -class GetAllSuggestedAdUnits +require 'dfp_api' - def self.run_example(dfp) - suggested_ad_unit_service = - dfp.service(:SuggestedAdUnitService, :v201711) +def get_all_suggested_ad_units(dfp) + # Get the SuggestedAdUnitService. + suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION) - # Create a statement to select suggested ad units. - statement = DfpApi::FilterStatement.new() + # Create a statement to select suggested ad units. + statement = dfp.new_statement_builder() - # Retrieve a small amount of suggested ad units at a time, paging - # through until all suggested ad units have been retrieved. - total_result_set_size = 0; - begin - page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) + # Retrieve a small amount of suggested ad units at a time, paging + # through until all suggested ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( + statement.to_statement() + ) - # Print out some information for each suggested ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |suggested_ad_unit, index| - puts "%d) Suggested ad unit with ID '%s' and num requests %d was found." % [ - index + statement.offset, - suggested_ad_unit[:id], - suggested_ad_unit[:num_requests] - ] - end + # Print out some information for each suggested ad unit. + unless page[:results].nil? + page[:results].each_with_index do |suggested_ad_unit, index| + puts '%d) Suggested ad unit with ID %d and num requests %d was found.' % + [index + statement.offset, suggested_ad_unit[:id], + suggested_ad_unit[:num_requests]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of suggested ad units: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of suggested ad units: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_suggested_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllSuggestedAdUnits.main() -end diff --git a/dfp_api/examples/v201711/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb b/dfp_api/examples/v201711/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb index b95c0b4b6..8b5df2ce4 100755 --- a/dfp_api/examples/v201711/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb +++ b/dfp_api/examples/v201711/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb @@ -17,83 +17,71 @@ # limitations under the License. # # This example gets all highly requested suggested ad units. + require 'dfp_api' -class GetHighlyRequestedSuggestedAdUnits +def get_highly_requested_suggested_ad_units(dfp, num_requests) + # Get the SuggestedAdUnitService. + suggested_ad_unit_service = + dfp.service(:SuggestedAdUnitService, API_VERSION) - NUM_REQUESTS = 'INSERT_NUM_REQUESTS_HERE'; + # Create a statement to select suggested ad units. + statement = dfp.new_statement_builder do |sb| + sb.where = 'numRequests >= :num_requests' + sb.with_bind_variable('num_requests', num_requests) + end - def self.run_example(dfp, num_requests) - suggested_ad_unit_service = - dfp.service(:SuggestedAdUnitService, :v201711) + # Retrieve a small amount of suggested ad units at a time, paging + # through until all suggested ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( + statement.to_statement() + ) - # Create a statement to select suggested ad units. - query = 'WHERE numRequests >= :numRequests' - values = [ - { - :key => 'numRequests', - :value => { - :xsi_type => 'NumberValue', - :value => num_requests - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each suggested ad unit. + unless page[:results].nil? + page[:results].each_with_index do |suggested_ad_unit, index| + puts '%d) Suggested ad unit with ID %d and num requests %d was found.' % + [index + statement.offset, suggested_ad_unit[:id], + suggested_ad_unit[:num_requests]] + end + end - # Retrieve a small amount of suggested ad units at a time, paging - # through until all suggested ad units have been retrieved. - total_result_set_size = 0; - begin - page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each suggested ad unit. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |suggested_ad_unit, index| - puts "%d) Suggested ad unit with ID '%s' and num requests %d was found." % [ - index + statement.offset, - suggested_ad_unit[:id], - suggested_ad_unit[:num_requests] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of suggested ad units: %d' % page[:total_result_set_size] +end - puts 'Total number of suggested ad units: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, NUM_REQUESTS.to_i) + begin + num_requests = 50 + get_highly_requested_suggested_ad_units(dfp, num_requests) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetHighlyRequestedSuggestedAdUnits.main() -end diff --git a/dfp_api/examples/v201711/team_service/create_teams.rb b/dfp_api/examples/v201711/team_service/create_teams.rb index 3ca5d05b2..48eac13ff 100755 --- a/dfp_api/examples/v201711/team_service/create_teams.rb +++ b/dfp_api/examples/v201711/team_service/create_teams.rb @@ -19,47 +19,48 @@ # This example creates new teams with the logged in user added to each team. To # determine which teams exist, run get_all_teams.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201711 -ITEM_COUNT = 5 - -def create_teams() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_teams(dfp, number_of_teams_to_create) # Get the TeamService. team_service = dfp.service(:TeamService, API_VERSION) # Create an array to store local team objects. - teams = (1..ITEM_COUNT).map do |index| + teams = (1..number_of_teams_to_create).map do |index| { - :name => "Team #%d" % index, + :name => "Team #%d - %d" % [index, SecureRandom.uuid()], :has_all_companies => false, :has_all_inventory => false } end # Create the teams on the server. - return_teams = team_service.create_teams(teams) + created_teams = team_service.create_teams(teams) - if return_teams - return_teams.each do |team| - puts "Team with ID: %d and name: '%s' was created." % + if created_teams.to_a.size > 0 + created_teams.each do |team| + puts 'Team with ID %d and name "%s" was created.' % [team[:id], team[:name]] end else - raise 'No teams were created.' + puts 'No teams were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_teams() + number_of_teams_to_create = 5 + create_teams(dfp, number_of_teams_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/team_service/get_all_teams.rb b/dfp_api/examples/v201711/team_service/get_all_teams.rb index 9419297a4..b9bbb096d 100755 --- a/dfp_api/examples/v201711/team_service/get_all_teams.rb +++ b/dfp_api/examples/v201711/team_service/get_all_teams.rb @@ -17,71 +17,65 @@ # limitations under the License. # # This example gets all teams. -require 'dfp_api' -class GetAllTeams +require 'dfp_api' - def self.run_example(dfp) - team_service = - dfp.service(:TeamService, :v201711) +def get_all_teams(dfp) + # Get the TeamService. + team_service = dfp.service(:TeamService, API_VERSION) - # Create a statement to select teams. - statement = DfpApi::FilterStatement.new() + # Create a statement to select teams. + statement = dfp.new_statement_builder() - # Retrieve a small amount of teams at a time, paging - # through until all teams have been retrieved. - total_result_set_size = 0; - begin - page = team_service.get_teams_by_statement( - statement.toStatement()) + # Retrieve a small amount of teams at a time, paging + # through until all teams have been retrieved. + page = {:total_result_set_size => 0} + begin + page = team_service.get_teams_by_statement( + statement.to_statement() + ) - # Print out some information for each team. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |team, index| - puts "%d) Team with ID %d and name '%s' was found." % [ - index + statement.offset, - team[:id], - team[:name] - ] - end + # Print out some information for each team. + unless page[:results].nil? + page[:results].each_with_index do |team, index| + puts '%d) Team with ID %d and name "%s" was found.' % + [index + statement.offset, team[:id], team[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of teams: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of teams: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_teams(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllTeams.main() -end diff --git a/dfp_api/examples/v201711/team_service/update_teams.rb b/dfp_api/examples/v201711/team_service/update_teams.rb index 476f5b65c..cdf51f14e 100755 --- a/dfp_api/examples/v201711/team_service/update_teams.rb +++ b/dfp_api/examples/v201711/team_service/update_teams.rb @@ -21,57 +21,52 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_teams() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the ID of the team to update. - team_id = 'INSERT_TEAM_ID_HERE'.to_i - +def update_teams(dfp, team_id) # Get the TeamService. team_service = dfp.service(:TeamService, API_VERSION) # Create a statement to select the matching team. - query = 'WHERE id = :id' - values = [ - {:key => 'id', :value => {:xsi_type => 'NumberValue', :value => team_id}} - ] - statement = DfpApi::FilterStatement.new(query, values) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :team_id' + sb.with_bind_variable('team_id', team_id) + sb.limit = 1 + end - # Get teams by statement. - page = team_service.get_teams_by_statement(statement.toStatement()) + # Get team by statement. + response = team_service.get_teams_by_statement(statement.to_statement()) + raise 'No teams found to update.' if response[:results].to_a.empty? + team = response[:results].first - if page[:results] - teams = page[:results] + # Change the description of the team. + team[:description] ||= '' + team[:description] += ' - UPDATED' - # Create a local set of teams than need to be updated. We are updating by - # changing the description. - updated_teams = teams.map do |team| - team[:description] ||= '' - team[:description] += ' - UPDATED' - team - end + # Update the teams on the server. + updated_teams = team_service.update_teams(updated_teams) - # Update the teams on the server. - return_teams = team_service.update_teams(updated_teams) - return_teams.each do |team| - puts "Team ID: %d, name: '%s' was updated" % [team[:id], team[:name]] + # Display the results. + if updated_teams.to_a.size > 0 + updated_teams.each do |team| + puts 'Team ID %d and name "%s" was updated' % [team[:id], team[:name]] end else - puts 'No teams found to update.' + puts 'No teams were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_teams() + team_id = 'INSERT_TEAM_ID_HERE'.to_i + update_teams(dfp, team_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_service/create_users.rb b/dfp_api/examples/v201711/user_service/create_users.rb index c9e95f5be..f7e425fd6 100755 --- a/dfp_api/examples/v201711/user_service/create_users.rb +++ b/dfp_api/examples/v201711/user_service/create_users.rb @@ -21,51 +21,51 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_users(dfp, emails_and_names, role_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - # Set the user's email addresses and names. - emails_and_names = [ - {:name => 'INSERT_NAME_HERE', - :email => 'INSERT_EMAIL_ADDRESS_HERE'}, - {:name => 'INSERT_NAME_HERE', - :email => 'INSERT_EMAIL_ADDRESS_HERE'} - ] - - # Set the role ID for new users. - role_id = 'INSERT_ROLE_ID_HERE'.to_i - # Create an array to store local user objects. users = emails_and_names.map do |email_and_name| email_and_name.merge({:role_id => role_id}) end # Create the users on the server. - return_users = user_service.create_users(users) + created_users = user_service.create_users(users) - if return_users - return_users.each do |user| - puts "User with ID: %d, name: %s and email: %s was created." % + if created_users.to_a.size > 0 + created_users.each do |user| + puts 'User with ID %d, name "%s", and email "%s" was created.' % [user[:id], user[:name], user[:email]] end else - raise 'No users were created.' + puts 'No users were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_users() + emails_and_names = [ + { + :name => 'INSERT_NAME_HERE', + :email => 'INSERT_EMAIL_ADDRESS_HERE' + }, + { + :name => 'INSERT_NAME_HERE', + :email => 'INSERT_EMAIL_ADDRESS_HERE' + } + ] + role_id = 'INSERT_ROLE_ID_HERE'.to_i + create_users(dfp, emails_and_names, role_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_service/deactivate_users.rb b/dfp_api/examples/v201711/user_service/deactivate_users.rb index 6b9c0273a..e6a28387b 100755 --- a/dfp_api/examples/v201711/user_service/deactivate_users.rb +++ b/dfp_api/examples/v201711/user_service/deactivate_users.rb @@ -22,59 +22,58 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def deactivate_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_users(dfp, user_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - # Set the ID of the user to deactivate - user_id = 'INSERT_USER_ID_HERE' - # Create filter text to select user by id. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :user_id', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.limit = 1 + end # Get users by statement. - page = user_service.get_users_by_statement(statement.toStatement()) + response = user_service.get_users_by_statement(statement.to_statement()) + raise 'No users found to deactivate.' if response[:results].to_a.empty? + user = response[:results].first - if page[:results] - page[:results].each do |user| - puts "User ID: %d, name: %s and status: %s will be deactivated." % - [user[:id], user[:name], user[:status]] - end + puts "User ID: %d, name: %s and status: %s will be deactivated." % + [user[:id], user[:name], user[:status]] - # Perform action. - result = user_service.perform_user_action( - {:xsi_type => 'DeactivateUsers'}, statement.toStatement()) + # Prepare statement for action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end - # Display results. - if result and result[:num_changes] > 0 - puts "Number of users deactivated: %d" % result[:num_changes] - else - puts 'No users were deactivated.' - end + # Perform action. + result = user_service.perform_user_action( + {:xsi_type => 'DeactivateUsers'}, + statement.to_statement() + ) + + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of users deactivated: %d' % result[:num_changes] else - puts 'No user found to deactivate.' + puts 'No users were deactivated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_users() + user_id = 'INSERT_USER_ID_HERE'.to_i + deactivate_users(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_service/get_all_roles.rb b/dfp_api/examples/v201711/user_service/get_all_roles.rb new file mode 100755 index 000000000..68df93d8b --- /dev/null +++ b/dfp_api/examples/v201711/user_service/get_all_roles.rb @@ -0,0 +1,64 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all roles that are defined for the users of the network. + +require 'dfp_api' + +def get_all_roles(dfp) + # Get the UserService. + user_service = dfp.service(:UserService, API_VERSION) + + # Get all user roles. + roles = user_service.get_all_roles() + + # Display the results. + roles.each do |role| + puts 'Role with ID %d and name "%s" was found.' % [role[:id], role[:name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_roles(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201711/user_service/get_all_users.rb b/dfp_api/examples/v201711/user_service/get_all_users.rb index 5b17420fe..a0e0db909 100755 --- a/dfp_api/examples/v201711/user_service/get_all_users.rb +++ b/dfp_api/examples/v201711/user_service/get_all_users.rb @@ -17,71 +17,62 @@ # limitations under the License. # # This example gets all users. -require 'dfp_api' -class GetAllUsers +require 'dfp_api' - def self.run_example(dfp) - user_service = - dfp.service(:UserService, :v201711) +def get_all_users(dfp) + user_service = dfp.service(:UserService, API_VERSION) - # Create a statement to select users. - statement = DfpApi::FilterStatement.new() + # Create a statement to select users. + statement = dfp.new_statement_builder() - # Retrieve a small amount of users at a time, paging - # through until all users have been retrieved. - total_result_set_size = 0; - begin - page = user_service.get_users_by_statement( - statement.toStatement()) + # Retrieve a small amount of users at a time, paging + # through until all users have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_service.get_users_by_statement(statement.to_statement()) - # Print out some information for each user. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user, index| - puts "%d) User with ID %d and name '%s' was found." % [ - index + statement.offset, - user[:id], - user[:name] - ] - end + # Print out some information for each user. + unless page[:results].nil? + page[:results].each_with_index do |user, index| + puts '%d) User with ID %d and name "%s" was found.' % + [index + statement.offset, user[:id], user[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of users: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of users: %d' % page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_users(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllUsers.main() -end diff --git a/dfp_api/examples/v201711/user_service/get_current_user.rb b/dfp_api/examples/v201711/user_service/get_current_user.rb index 9b9058768..b15aab571 100755 --- a/dfp_api/examples/v201711/user_service/get_current_user.rb +++ b/dfp_api/examples/v201711/user_service/get_current_user.rb @@ -20,29 +20,29 @@ require 'dfp_api' -API_VERSION = :v201711 - -def get_current_user() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_current_user(dfp) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) # Get the current user. user = user_service.get_current_user() - puts "Current user has ID %d, email %s and role %s." % + puts 'Current user has ID %d, email "%s", and role "%s".' % [user[:id], user[:email], user[:role_name]] end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_current_user() + get_current_user(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_service/get_user_by_email_address.rb b/dfp_api/examples/v201711/user_service/get_user_by_email_address.rb index 90cfa84e0..6e93cf372 100755 --- a/dfp_api/examples/v201711/user_service/get_user_by_email_address.rb +++ b/dfp_api/examples/v201711/user_service/get_user_by_email_address.rb @@ -17,83 +17,65 @@ # limitations under the License. # # This example gets users by email. -require 'dfp_api' - -class GetUserByEmailAddress - EMAIL_ADDRESS = 'INSERT_EMAIL_ADDRESS_HERE'; +require 'dfp_api' - def self.run_example(dfp, email_address) - user_service = - dfp.service(:UserService, :v201711) +def get_user_by_email_address(dfp, email_address) + # Get the UserService. + user_service = dfp.service(:UserService, :v201711) - # Create a statement to select users. - query = 'WHERE email = :email' - values = [ - { - :key => 'email', - :value => { - :xsi_type => 'TextValue', - :value => email_address - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select users. + statement = dfp.new_statement_builder do |sb| + sb.where = 'email = :email_address' + sb.with_bind_variable('email_address', email_address) + end - # Retrieve a small amount of users at a time, paging - # through until all users have been retrieved. - total_result_set_size = 0; - begin - page = user_service.get_users_by_statement( - statement.toStatement()) + # Retrieve a small amount of users at a time, paging + # through until all users have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_service.get_users_by_statement(statement.to_statement()) - # Print out some information for each user. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user, index| - puts "%d) User with ID %d and name '%s' was found." % [ - index + statement.offset, - user[:id], - user[:name] - ] - end + # Print out some information for each user. + unless page[:results].nil? + page[:results].each_with_index do |user, index| + puts '%d) User with ID %d and name "%s" was found.' % + [index + statement.offset, user[:id], user[:name]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of users: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of users: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, EMAIL_ADDRESS) + begin + email_address = 'INSERT_EMAIL_ADDRESS_HERE'; + get_user_by_email_address(dfp, email_address) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetUserByEmailAddress.main() -end diff --git a/dfp_api/examples/v201711/user_service/update_users.rb b/dfp_api/examples/v201711/user_service/update_users.rb index 20110ee74..8d1332e6c 100755 --- a/dfp_api/examples/v201711/user_service/update_users.rb +++ b/dfp_api/examples/v201711/user_service/update_users.rb @@ -16,65 +16,57 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates all users by adding "Sr." to the end of a single user. -# To determine which users exist, run get_all_users.rb. +# This example updates a single user's name. To determine which users exist, +# run get_all_users.rb. require 'dfp_api' - -API_VERSION = :v201711 - -def update_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_users(dfp, user_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create a statement to get all users. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.limit = 1 + end # Get users by statement. - page = user_service.get_users_by_statement(statement.toStatement()) + response = user_service.get_users_by_statement(statement.to_statement()) + raise 'No users found to update.' if response[:results].to_a.empty? + user = response[:results].first - if page[:results] - users = page[:results] + # Update the user object's name field. + user[:name] ||= '' + user[:name] += ' Ph.D.' - # Update each local users object by changing its name. - users.each {|user| user[:name] += ' Sr.'} + # Update the users on the server. + updated_users = user_service.update_users(users) - # Update the users on the server. - return_users = user_service.update_users(users) - - if return_users - return_users.each do |user| - puts ("User ID: %d, email: %s was updated with name %s") % - [user[:id], user[:email], user[:name]] - end - else - raise 'No users were updated.' + if updated_users.to_a.size > 0 + updated_users.each do |user| + puts 'User with ID %d and email "%s" was updated with name "%s".' % + [user[:id], user[:email], user[:name]] end else - puts 'No users found to update.' + puts 'No users were updated.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_users() + user_id = 'INSERT_USER_ID_HERE'.to_i + update_users(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_team_association_service/create_user_team_associations.rb b/dfp_api/examples/v201711/user_team_association_service/create_user_team_associations.rb index f1828a508..5b5b505e2 100755 --- a/dfp_api/examples/v201711/user_team_association_service/create_user_team_associations.rb +++ b/dfp_api/examples/v201711/user_team_association_service/create_user_team_associations.rb @@ -22,23 +22,10 @@ require 'dfp_api' -API_VERSION = :v201711 - -def create_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_user_team_associations(dfp, team_id, user_ids) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the users and team to add them to. - team_id = 'INSERT_TEAM_ID_HERE'.to_i - user_ids = ['INSERT_USER_ID_HERE'.to_i] - # Create an array to store local user team association objects. associations = user_ids.map do |user_id| { @@ -48,21 +35,32 @@ def create_user_team_associations() end # Create the user team associations on the server. - return_associations = uta_service.create_user_team_associations(associations) + created_associations = uta_service.create_user_team_associations(associations) - if return_associations - return_associations.each do |association| - puts ("A user team association between user ID %d and team ID %d was " + - "created.") % [association[:user_id], association[:team_id]] + if created_associations.to_a.size > 0 + created_associations.each do |association| + puts ('A user team association between user ID %d and team ID %d was ' + + 'created.') % [association[:user_id], association[:team_id]] end else - raise 'No user team associations were created.' + puts 'No user team associations were created.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_user_team_associations() + team_id = 'INSERT_TEAM_ID_HERE'.to_i + user_ids = ['INSERT_USER_ID_HERE'.to_i, 'INSERT_USER_ID_HERE'.to_i] + create_user_team_associations(dfp, team_id, user_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_team_association_service/delete_user_team_associations.rb b/dfp_api/examples/v201711/user_team_association_service/delete_user_team_associations.rb index 71e8c6f60..7da752c9a 100755 --- a/dfp_api/examples/v201711/user_team_association_service/delete_user_team_associations.rb +++ b/dfp_api/examples/v201711/user_team_association_service/delete_user_team_associations.rb @@ -21,64 +21,66 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def delete_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_user_team_associations(dfp, user_id) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the user to remove from its teams. - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create filter text to remove association by user ID. - statement = DfpApi::FilterStatement.new( - 'WHERE userId = :user_id', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + end begin # Get user team associations by statement. page = uta_service.get_user_team_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |association| - puts ("User team association of user ID %d with team ID %d will be " + - "deleted.") % [association[:user_id], association[:team_id]] + puts ('User team association of user ID %d with team ID %d will be ' + + 'deleted.') % [association[:user_id], association[:team_id]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - # Reset offset back to 0 to perform action. - statement.toStatementForAction() + # Configure the statement to perform the delete action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end # Perform the action. result = uta_service.perform_user_team_association_action( - {:xsi_type => 'DeleteUserTeamAssociations'}, statement.toStatement()) + {:xsi_type => 'DeleteUserTeamAssociations'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of user team associations deleted: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of user team associations deleted: %d' % result[:num_changes] else puts 'No user team associations were deleted.' end end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_user_team_associations() + user_id = 'INSERT_USER_ID_HERE'.to_i + delete_user_team_associations(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/user_team_association_service/get_all_user_team_associations.rb b/dfp_api/examples/v201711/user_team_association_service/get_all_user_team_associations.rb index ffa65b0e6..b87fe5320 100755 --- a/dfp_api/examples/v201711/user_team_association_service/get_all_user_team_associations.rb +++ b/dfp_api/examples/v201711/user_team_association_service/get_all_user_team_associations.rb @@ -17,71 +17,67 @@ # limitations under the License. # # This example gets all user team associations. -require 'dfp_api' -class GetAllUserTeamAssociations +require 'dfp_api' - def self.run_example(dfp) - user_team_association_service = - dfp.service(:UserTeamAssociationService, :v201711) +def get_all_user_team_associations(dfp) + # Get the UserTeamAssociationService. + user_team_association_service = + dfp.service(:UserTeamAssociationService, API_VERSION) - # Create a statement to select user team associations. - statement = DfpApi::FilterStatement.new() + # Create a statement to select user team associations. + statement = dfp.new_statement_builder() - # Retrieve a small amount of user team associations at a time, paging - # through until all user team associations have been retrieved. - total_result_set_size = 0; - begin - page = user_team_association_service.get_user_team_associations_by_statement( - statement.toStatement()) + # Retrieve a small amount of user team associations at a time, paging + # through until all user team associations have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_team_association_service. + get_user_team_associations_by_statement(statement.to_statement()) - # Print out some information for each user team association. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user_team_association, index| - puts "%d) User team association with team id %d and user id %d was found." % [ - index + statement.offset, - user_team_association[:team_id], - user_team_association[:user_id] - ] - end + # Print out some information for each user team association. + unless page[:results].nil? + page[:results].each_with_index do |user_team_association, index| + puts ('%d) User team association with team ID %d and user ID %d was ' + + 'found.') % [index + statement.offset, + user_team_association[:team_id], user_team_association[:user_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of user team associations: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + puts 'Total number of user team associations: %d' % + page[:total_result_set_size] +end - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') +if __FILE__ == $0 + API_VERSION = :v201711 - begin - run_example(dfp) + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + begin + get_all_user_team_associations(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetAllUserTeamAssociations.main() -end diff --git a/dfp_api/examples/v201711/user_team_association_service/get_user_team_associations_for_user.rb b/dfp_api/examples/v201711/user_team_association_service/get_user_team_associations_for_user.rb index d92a0f2b8..3ee9fb3ea 100755 --- a/dfp_api/examples/v201711/user_team_association_service/get_user_team_associations_for_user.rb +++ b/dfp_api/examples/v201711/user_team_association_service/get_user_team_associations_for_user.rb @@ -17,83 +17,71 @@ # limitations under the License. # # This example gets all user team associations (i.e. teams) for a given user. + require 'dfp_api' -class GetUserTeamAssociationsForUser +def get_user_team_associations_for_user(dfp, user_id) + # Get the UserTeamAssociationService. + user_team_association_service = + dfp.service(:UserTeamAssociationService, API_VERSION) - USER_ID = 'INSERT_USER_ID_HERE'; + # Create a statement to select user team associations. + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + end - def self.run_example(dfp, user_id) - user_team_association_service = - dfp.service(:UserTeamAssociationService, :v201711) + # Retrieve a small amount of user team associations at a time, paging + # through until all user team associations have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_team_association_service. + get_user_team_associations_by_statement(statement.to_statement()) - # Create a statement to select user team associations. - query = 'WHERE userId = :userId' - values = [ - { - :key => 'userId', - :value => { - :xsi_type => 'NumberValue', - :value => user_id - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Print out some information for each user team association. + unless page[:results].nil? + page[:results].each_with_index do |user_team_association, index| + puts ('%d) User team association with user ID %d and team ID %d was ' + + 'found.') % [index + statement.offset, + user_team_association[:user_id], user_team_association[:team_id]] + end + end - # Retrieve a small amount of user team associations at a time, paging - # through until all user team associations have been retrieved. - total_result_set_size = 0; - begin - page = user_team_association_service.get_user_team_associations_by_statement( - statement.toStatement()) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Print out some information for each user team association. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |user_team_association, index| - puts "%d) User team association with user ID %d and team ID %d was found." % [ - index + statement.offset, - user_team_association[:user_id], - user_team_association[:team_id] - ] - end - end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + puts 'Total number of user team associations: %d' % + page[:total_result_set_size] +end - puts 'Total number of user team associations: %d' % - total_result_set_size - end +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp, USER_ID.to_i) + begin + user_id = 'INSERT_USER_ID_HERE'.to_i + get_user_team_associations_for_user(dfp, user_id) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetUserTeamAssociationsForUser.main() -end diff --git a/dfp_api/examples/v201711/user_team_association_service/update_user_team_associations.rb b/dfp_api/examples/v201711/user_team_association_service/update_user_team_associations.rb index 871507b1c..4cc91354c 100755 --- a/dfp_api/examples/v201711/user_team_association_service/update_user_team_associations.rb +++ b/dfp_api/examples/v201711/user_team_association_service/update_user_team_associations.rb @@ -23,53 +23,41 @@ require 'dfp_api' - -API_VERSION = :v201711 - -def update_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_user_team_associations(dfp, user_id) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the user to set to read only access within its teams. - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create filter text to select user team associations by the user ID. - statement = DfpApi::FilterStatement.new( - 'WHERE userId = :user_id ORDER BY id ASC', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}}, - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.order_by = 'id' + end # Get user team associations by statement. page = uta_service.get_user_team_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) + if page[:results].to_a.empty? + raise 'No user team assiciations found to update.' + end - if page[:results] and !page[:results].empty? - associations = page[:results] - associations.each do |association| - # Update local user team association to read-only access. - association[:overridden_team_access_type] = 'READ_ONLY' - end + associations = page[:results] + associations.each do |association| + # Update local user team association to read-only access. + association[:overridden_team_access_type] = 'READ_ONLY' + end - # Update the user team association on the server. - return_associations = - uta_service.update_user_team_associations(associations) + # Update the user team association on the server. + updated_associations = + uta_service.update_user_team_associations(associations) - # Display results. - return_associations.each do |association| - puts ("User team association between user ID %d and team ID %d was " + - "updated with access type '%s'") % - [association[:user_id], association[:team_id], - association[:overridden_team_access_type]] + # Display results. + if updated_associations.to_a.size > 0 + updated_associations.each do |association| + puts ('User team association between user ID %d and team ID %d was ' + + 'updated with access type "%s".') % [association[:user_id], + association[:team_id], association[:overridden_team_access_type]] end else puts 'No user team associations were updated.' @@ -77,8 +65,18 @@ def update_user_team_associations() end if __FILE__ == $0 + API_VERSION = :v201711 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_user_team_associations() + user_id = 'INSERT_USER_ID_HERE'.to_i + update_user_team_associations(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201711/workflow_request_service/get_workflow_approval_requests.rb b/dfp_api/examples/v201711/workflow_request_service/get_workflow_approval_requests.rb index 6b45a087f..0207861da 100755 --- a/dfp_api/examples/v201711/workflow_request_service/get_workflow_approval_requests.rb +++ b/dfp_api/examples/v201711/workflow_request_service/get_workflow_approval_requests.rb @@ -16,83 +16,72 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example gets workflow approval requests. Workflow approval requests must be approved or rejected for a workflow to finish. -require 'dfp_api' +# This example gets workflow approval requests. Workflow approval requests must +# be approved or rejected for a workflow to finish. -class GetWorkflowApprovalRequests +require 'dfp_api' - def self.run_example(dfp) - workflow_request_service = - dfp.service(:WorkflowRequestService, :v201711) +def get_workflow_approval_requests(dfp) + # Get the WorkflowRequestService. + workflow_request_service = dfp.service(:WorkflowRequestService, API_VERSION) - # Create a statement to select workflow requests. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'WORKFLOW_APPROVAL_REQUEST' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select workflow requests. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'WORKFLOW_APPROVAL_REQUEST') + end - # Retrieve a small amount of workflow requests at a time, paging - # through until all workflow requests have been retrieved. - total_result_set_size = 0; - begin - page = workflow_request_service.get_workflow_requests_by_statement( - statement.toStatement()) + # Retrieve a small amount of workflow requests at a time, paging + # through until all workflow requests have been retrieved. + page = {:total_result_set_size => 0} + begin + page = workflow_request_service.get_workflow_requests_by_statement( + statement.to_statement() + ) - # Print out some information for each workflow request. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |workflow_request, index| - puts "%d) Workflow request with ID %d, entity type '%s', and entity ID %d was found." % [ - index + statement.offset, - workflow_request[:id], - workflow_request[:entity_type], - workflow_request[:entity_id] - ] - end + # Print out some information for each workflow request. + unless page[:results].nil? + page[:results].each_with_index do |workflow_request, index| + puts ('%d) Workflow request with ID %d, entity type "%s", and entity ' + + 'ID %d was found.') % [index + statement.offset, + workflow_request[:id], workflow_request[:entity_type], + workflow_request[:entity_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of workflow requests: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of workflow requests: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_workflow_approval_requests(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetWorkflowApprovalRequests.main() -end diff --git a/dfp_api/examples/v201711/workflow_request_service/get_workflow_external_condition_requests.rb b/dfp_api/examples/v201711/workflow_request_service/get_workflow_external_condition_requests.rb index 259071e26..6b01c018a 100755 --- a/dfp_api/examples/v201711/workflow_request_service/get_workflow_external_condition_requests.rb +++ b/dfp_api/examples/v201711/workflow_request_service/get_workflow_external_condition_requests.rb @@ -16,83 +16,72 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example gets workflow external condition requests. Workflow external condition requests must be triggered or skipped for a workflow to finish. -require 'dfp_api' +# This example gets workflow external condition requests. Workflow external +# condition requests must be triggered or skipped for a workflow to finish. -class GetWorkflowExternalConditionRequests +require 'dfp_api' - def self.run_example(dfp) - workflow_request_service = - dfp.service(:WorkflowRequestService, :v201711) +def get_workflow_external_condition_requests(dfp) + # Get the WorkflowRequestService. + workflow_request_service = dfp.service(:WorkflowRequestService, API_VERSION) - # Create a statement to select workflow requests. - query = 'WHERE type = :type' - values = [ - { - :key => 'type', - :value => { - :xsi_type => 'TextValue', - :value => 'WORKFLOW_EXTERNAL_CONDITION_REQUEST' - } - }, - ] - statement = DfpApi::FilterStatement.new(query, values) + # Create a statement to select workflow requests. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'WORKFLOW_EXTERNAL_CONDITION_REQUEST') + end - # Retrieve a small amount of workflow requests at a time, paging - # through until all workflow requests have been retrieved. - total_result_set_size = 0; - begin - page = workflow_request_service.get_workflow_requests_by_statement( - statement.toStatement()) + # Retrieve a small amount of workflow requests at a time, paging + # through until all workflow requests have been retrieved. + page = {:total_result_set_size => 0} + begin + page = workflow_request_service.get_workflow_requests_by_statement( + statement.to_statement() + ) - # Print out some information for each workflow request. - if page[:results] - total_result_set_size = page[:total_result_set_size] - page[:results].each_with_index do |workflow_request, index| - puts "%d) Workflow request with ID %d, entity type '%s', and entity ID %d was found." % [ - index + statement.offset, - workflow_request[:id], - workflow_request[:entity_type], - workflow_request[:entity_id] - ] - end + # Print out some information for each workflow request. + unless page[:results].nil? + page[:results].each_with_index do |workflow_request, index| + puts ('%d) Workflow request with ID %d, entity type "%s", and entity ' + + 'ID %d was found.') % [index + statement.offset, + workflow_request[:id], workflow_request[:entity_type], + workflow_request[:entity_id]] end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while statement.offset < page[:total_result_set_size] + end - puts 'Total number of workflow requests: %d' % - total_result_set_size - end + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of workflow requests: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201711 - def self.main() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') - begin - run_example(dfp) + begin + get_workflow_external_condition_requests(dfp) - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e - # API errors. - rescue DfpApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] end end end end - -if __FILE__ == $0 - GetWorkflowExternalConditionRequests.main() -end diff --git a/dfp_api/examples/v201705/activity_group_service/create_activity_groups.rb b/dfp_api/examples/v201802/activity_group_service/create_activity_groups.rb similarity index 86% rename from dfp_api/examples/v201705/activity_group_service/create_activity_groups.rb rename to dfp_api/examples/v201802/activity_group_service/create_activity_groups.rb index 000e4569e..bd9aaef58 100755 --- a/dfp_api/examples/v201705/activity_group_service/create_activity_groups.rb +++ b/dfp_api/examples/v201802/activity_group_service/create_activity_groups.rb @@ -21,23 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_activity_groups() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_activity_groups(dfp, advertiser_company_id) # Get the ActivityGroupService. activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - # Set the ID of the advertiser company this activity group is associated - # with. - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'; - # Create a short-term activity group. short_term_activity_group = { :name => 'Short-term activity group', @@ -56,11 +43,12 @@ def create_activity_groups() # Create the activity groups on the server. return_activity_groups = activity_group_service.create_activity_groups([ - short_term_activity_group, long_term_activity_group]) + short_term_activity_group, long_term_activity_group + ]) - if return_activity_groups + if return_activity_groups.to_a.size > 0 return_activity_groups.each do |activity_group| - puts "An activity group with ID: %d and name: %s was created." % + puts 'An activity group with ID %d and name "%s" was created.' % [activity_group[:id], activity_group[:name]] end else @@ -69,8 +57,18 @@ def create_activity_groups() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_activity_groups() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + create_activity_groups(dfp, advertiser_company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/activity_group_service/get_active_activity_groups.rb b/dfp_api/examples/v201802/activity_group_service/get_active_activity_groups.rb new file mode 100755 index 000000000..43f887415 --- /dev/null +++ b/dfp_api/examples/v201802/activity_group_service/get_active_activity_groups.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active activity groups. + +require 'dfp_api' + +def get_active_activity_groups(dfp) + activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) + + # Create a statement to select activity groups. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end + + # Retrieve a small amount of activity groups at a time, paging + # through until all activity groups have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get activity groups by statement. + page = activity_group_service.get_activity_groups_by_statement( + statement.to_statement() + ) + + # Print out some information for each activity group. + unless page[:results].nil? + page[:results].each_with_index do |activity_group, index| + puts '%d) Activity group with ID %d and name "%s" was found.' % [ + index + statement.offset, + activity_group[:id], + activity_group[:name] + ] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activity groups: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_activity_groups(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/activity_group_service/get_all_activity_groups.rb b/dfp_api/examples/v201802/activity_group_service/get_all_activity_groups.rb new file mode 100755 index 000000000..63d91c209 --- /dev/null +++ b/dfp_api/examples/v201802/activity_group_service/get_all_activity_groups.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all activity groups. +require 'dfp_api' + +def get_all_activity_groups(dfp) + activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) + + # Create a statement to select activity groups. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of activity groups at a time, paging + # through until all activity groups have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_group_service.get_activity_groups_by_statement( + statement.to_statement() + ) + + # Print out some information for each activity group. + unless page[:results].nil? + page[:results].each_with_index do |activity_group, index| + puts '%d) Activity group with ID %d and name "%s" was found.' % [ + index + statement.offset, + activity_group[:id], + activity_group[:name] + ] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activity groups: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_activity_groups(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/activity_group_service/update_activity_groups.rb b/dfp_api/examples/v201802/activity_group_service/update_activity_groups.rb similarity index 79% rename from dfp_api/examples/v201705/activity_group_service/update_activity_groups.rb rename to dfp_api/examples/v201802/activity_group_service/update_activity_groups.rb index f6229fbde..08da28c6b 100755 --- a/dfp_api/examples/v201705/activity_group_service/update_activity_groups.rb +++ b/dfp_api/examples/v201802/activity_group_service/update_activity_groups.rb @@ -21,38 +21,21 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_activity_groups() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_activity_groups(dfp, advertiser_company_id, activity_group_id) # Get the ActivityGroupService. activity_group_service = dfp.service(:ActivityGroupService, API_VERSION) - # Set the ID of the activity group and the company to update it with. - activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' - # Create statement to select a single activity group. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => activity_group_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', activity_group_id) + end page = activity_group_service.get_activity_groups_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? # Get the activity groups. activity_groups = page[:results] @@ -66,15 +49,26 @@ def update_activity_groups() activity_groups) return_activity_groups.each do |updates_activity_group| - puts "Activity group with ID: %d and name: %s was updated." % + puts 'Activity group with ID %d and name "%s" was updated.' % [updates_activity_group[:id], updates_activity_group[:name]] end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_activity_groups() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' + update_activity_groups(dfp, advertiser_company_id, activity_group_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/activity_service/create_activities.rb b/dfp_api/examples/v201802/activity_service/create_activities.rb similarity index 85% rename from dfp_api/examples/v201705/activity_service/create_activities.rb rename to dfp_api/examples/v201802/activity_service/create_activities.rb index c74d68751..2cbc84ba8 100755 --- a/dfp_api/examples/v201705/activity_service/create_activities.rb +++ b/dfp_api/examples/v201802/activity_service/create_activities.rb @@ -21,22 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_activities() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_activities(dfp, activity_group_id) # Get the ActivityService. activity_service = dfp.service(:ActivityService, API_VERSION) - # Set the ID of the activity group this activity is associated with. - activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE'; - # Create a daily visits activity. daily_visits_activity = { :name => 'Activity', @@ -53,21 +41,32 @@ def create_activities() # Create the activities on the server. return_activities = activity_service.create_activities([ - daily_visits_activity, custom_activity]) + daily_visits_activity, custom_activity + ]) - if return_activities + if return_activities.to_a.size > 0 return_activities.each do |activity| - puts "An activity with ID: %d, name: %s and type: %s was created." % + puts 'An activity with ID %d, name "%s", and type "%s" was created.' % [activity[:id], activity[:name], activity[:type]] end else - raise 'No activities were created.' + puts 'No activities were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_activities() + activity_group_id = 'INSERT_ACTIVITY_GROUP_ID_HERE' + create_activities(dfp, activity_group_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/activity_service/get_active_activities.rb b/dfp_api/examples/v201802/activity_service/get_active_activities.rb new file mode 100755 index 000000000..bcf4354ac --- /dev/null +++ b/dfp_api/examples/v201802/activity_service/get_active_activities.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active activities. +require 'dfp_api' + +def get_active_activities(dfp) + # Get the ActivityService. + activity_service = dfp.service(:ActivityService, API_VERSION) + + # Create a statement to select activities. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end + + # Retrieve a small amount of activities at a time, paging + # through until all activities have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_service.get_activities_by_statement( + statement.to_statement() + ) + + # Print out some information for each activity. + unless page[:results].nil? + page[:results].each_with_index do |activity, index| + puts '%d) Activity with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, activity[:id], activity[:name], + activity[:type]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activities: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_activities(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/activity_service/get_all_activities.rb b/dfp_api/examples/v201802/activity_service/get_all_activities.rb new file mode 100755 index 000000000..3dc59c915 --- /dev/null +++ b/dfp_api/examples/v201802/activity_service/get_all_activities.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all activities. +require 'dfp_api' + +def get_all_activities(dfp) + # Get the ActivityService. + activity_service = dfp.service(:ActivityService, API_VERSION) + + # Create a statement to select activities. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of activities at a time, paging + # through until all activities have been retrieved. + page = {:total_result_set_size => 0} + begin + page = activity_service.get_activities_by_statement( + statement.to_statement() + ) + + # Print out some information for each activity. + unless page[:results].nil? + page[:results].each_with_index do |activity, index| + puts '%d) Activity with ID %d and name "%s" was found.' % + [index + statement.offset, activity[:id], activity[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of activities: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_activities(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/activity_service/update_activities.rb b/dfp_api/examples/v201802/activity_service/update_activities.rb similarity index 81% rename from dfp_api/examples/v201705/activity_service/update_activities.rb rename to dfp_api/examples/v201802/activity_service/update_activities.rb index 372791546..ec8434586 100755 --- a/dfp_api/examples/v201705/activity_service/update_activities.rb +++ b/dfp_api/examples/v201802/activity_service/update_activities.rb @@ -21,36 +21,20 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_activities() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_activities(dfp, activity_id) # Get the ActivityService. activity_service = dfp.service(:ActivityService, API_VERSION) - # Set the ID of the activity to update. - activity_id = 'INSERT_ACTIVITY_ID_HERE' - # Create statement to select a single activity. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => activity_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', activity_id) + end - page = activity_service.get_activities_by_statement(statement.toStatement()) + # Get the activities by statement. + page = activity_service.get_activities_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? # Get the activities. activities = page[:results] @@ -63,20 +47,30 @@ def update_activities() return_activities = activity_service.update_activities(activities) # Display results. - if return_activities + if return_activities.to_a.size > 0 return_activities.each do |updated_activity| - puts "Activity with ID: %d and name: %s was updated." % + puts 'Activity with ID %d and name "%s" was updated.' % [updated_activity[:id], updated_activity[:name]] end else - raise 'No activities were updated.' + puts 'No activities were updated.' end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_activities() + activity_id = 'INSERT_ACTIVITY_ID_HERE' + update_activities(dfp, activity_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/audience_segment_service/create_audience_segments.rb b/dfp_api/examples/v201802/audience_segment_service/create_audience_segments.rb similarity index 86% rename from dfp_api/examples/v201705/audience_segment_service/create_audience_segments.rb rename to dfp_api/examples/v201802/audience_segment_service/create_audience_segments.rb index f4a5263c0..7a4bc24b0 100755 --- a/dfp_api/examples/v201705/audience_segment_service/create_audience_segments.rb +++ b/dfp_api/examples/v201802/audience_segment_service/create_audience_segments.rb @@ -21,20 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the AudienceSegmentService. +def create_audience_segments(dfp, custom_targeting_key_id, + custom_targeting_value_id) + # Get the AudienceSegmentService and the NetworkService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the root ad unit ID used to target the whole site. @@ -78,23 +68,33 @@ def create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) # Create the audience segment on the server. return_segments = audience_segment_service.create_audience_segments([segment]) - if return_segments + if return_segments.to_a.size > 0 return_segments.each do |segment| - puts ("An audience segment with ID: %d, name: '%s' and type: '%s' was " + - "created.") % [segment[:id], segment[:name], segment[:type]] + puts ('An audience segment with ID %d, name "%s", and type "%s" was ' + + 'created.') % [segment[:id], segment[:name], segment[:type]] end else - raise 'No audience segments were created.' + puts 'No audience segments were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # Set the IDs of the custom criteria to target. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE' - custom_targeting_value_id = 'INSERT_CUSTOM_TARGETING_VALUE_ID_HERE' - - create_audience_segments(custom_targeting_key_id, custom_targeting_value_id) + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + custom_targeting_value_id = 'INSERT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i + create_audience_segments( + dfp, custom_targeting_key_id, custom_targeting_value_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/audience_segment_service/get_all_audience_segments.rb b/dfp_api/examples/v201802/audience_segment_service/get_all_audience_segments.rb new file mode 100755 index 000000000..10d04bad3 --- /dev/null +++ b/dfp_api/examples/v201802/audience_segment_service/get_all_audience_segments.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all audience segments. + +require 'dfp_api' + +def get_all_audience_segments(dfp) + audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) + + # Create a statement to select audience segments. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get audience segments by statement. + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) + + # Print out some information for each audience segment. + unless page[:results].nil? + page[:results].each_with_index do |audience_segment, index| + puts ('%d) Audience segment with ID %d, name "%s", and size %d was ' + + 'found.') % [index + statement.offset, audience_segment[:id], + audience_segment[:name], audience_segment[:size]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of audience segments: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_audience_segments(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/audience_segment_service/get_first_party_audience_segments.rb b/dfp_api/examples/v201802/audience_segment_service/get_first_party_audience_segments.rb new file mode 100755 index 000000000..fa0984b18 --- /dev/null +++ b/dfp_api/examples/v201802/audience_segment_service/get_first_party_audience_segments.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all first party audience segments. + +require 'dfp_api' + +def get_first_party_audience_segments(dfp) + audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) + + # Create a statement to select audience segments. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'FIRST_PARTY') + end + + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) + + # Print out some information for each audience segment. + if page[:results] + page[:results].each_with_index do |audience_segment, index| + puts ('%d) Audience segment with ID %d, name "%s", and size %d was ' + + 'found.') % [index + statement.offset, audience_segment[:id], + audience_segment[:name], audience_segment[:size]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of audience segments: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_first_party_audience_segments(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/audience_segment_service/populate_first_party_audience_segments.rb b/dfp_api/examples/v201802/audience_segment_service/populate_first_party_audience_segments.rb similarity index 54% rename from dfp_api/examples/v201705/audience_segment_service/populate_first_party_audience_segments.rb rename to dfp_api/examples/v201802/audience_segment_service/populate_first_party_audience_segments.rb index e45560c54..8307d68d6 100755 --- a/dfp_api/examples/v201705/audience_segment_service/populate_first_party_audience_segments.rb +++ b/dfp_api/examples/v201802/audience_segment_service/populate_first_party_audience_segments.rb @@ -21,65 +21,65 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def populate_first_party_audience_segments(audience_segment_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def populate_first_party_audience_segments(dfp, audience_segment_id) # Get the AudienceSegmentService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) - # Statement parts to help build a statement to select first party audience - # segment for an ID. - statement = DfpApi::FilterStatement.new( - 'WHERE type = :type AND id = :audience_segment_id ORDER BY id ASC', - [ - {:key => 'type', - :value => {:value => 'FIRST_PARTY', :xsi_type => 'TextValue'}}, - {:key => 'audience_segment_id', - :value => {:value => audience_segment_id, :xsi_type => 'TextValue'}}, - ], - 1 - ) + # Create a statement to select first party audience segment for an ID. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type AND id = :audience_segment_id' + sb.with_bind_variable('type', 'FIRST_PARTY') + sb.with_bind_variable('audience_segment_id', audience_segment_id) + end - # Get audience segments by statement. - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + # Retrieve a small amount of audience segments at a time, paging + # through until all audience segments have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get audience segments by statement. + page = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) - if page[:results] - page[:results].each do |segment| - puts "First party audience segment ID: %d, name: '%s' will be populated" % - [segment[:id], segment[:name]] + unless page[:results].nil? + page[:results].each do |segment| + puts ('First party audience segment with ID %d and name "%s" will be ' + + 'populated.') % [segment[:id], segment[:name]] + end - # Perform action. - result = audience_segment_service.perform_audience_segment_action( - {:xsi_type => 'PopulateAudienceSegments'}, - {:query => statement.toStatement()}) + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] - # Display results. - if result and result[:num_changes] > 0 - puts 'Number of audience segments populated: %d.' % result[:num_changes] - else - puts 'No audience segments were populated.' - end - end + # Perform action. + result = audience_segment_service.perform_audience_segment_action( + {:xsi_type => 'PopulateAudienceSegments'}, + {:query => statement.to_statement()} + ) + + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of audience segments populated: %d.' % result[:num_changes] else - puts 'No first party audience segments found to populate.' + puts 'No audience segments were populated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # Audience segment ID to populate. audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE' - populate_first_party_audience_segments(audience_segment_id) + populate_first_party_audience_segments(dfp, audience_segment_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/audience_segment_service/update_audience_segments.rb b/dfp_api/examples/v201802/audience_segment_service/update_audience_segments.rb similarity index 61% rename from dfp_api/examples/v201705/audience_segment_service/update_audience_segments.rb rename to dfp_api/examples/v201802/audience_segment_service/update_audience_segments.rb index f118f4549..6ca38653c 100755 --- a/dfp_api/examples/v201705/audience_segment_service/update_audience_segments.rb +++ b/dfp_api/examples/v201802/audience_segment_service/update_audience_segments.rb @@ -22,59 +22,49 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_audience_segments() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the ID of the first party audience segment to update. - audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE' - +def update_audience_segments(dfp, audience_segment_id) # Get the AudienceSegmentService. audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION) # Create statement text to select the audience segment to update. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :segment_id ORDER BY id ASC', - [ - {:key => 'segment_id', - :value => {:value => audience_segment_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) - - # Get audience segments by statement. - page = audience_segment_service.get_audience_segments_by_statement( - statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :audience_segment_id' + sb.with_bind_variable('audience_segment_id', audience_segment_id) + sb.limit = 1 + end - if page[:results] - audience_segments = page[:results] + # Get the audience segment. + response = audience_segment_service.get_audience_segments_by_statement( + statement.to_statement() + ) + raise 'No audience segments to update.' if response[:results].to_a.empty? + audience_segment = page[:results].first - # Create a local set of audience segments than need to be updated. - audience_segments.each do |audience_segment| - audience_segment[:membership_expiration_days] = 180 - end + # Change the membership expiration days after which a user's cookie will be + # removed from the audience segment due to inactivity. + audience_segment[:membership_expiration_days] = 180 - # Update the audience segments on the server. - return_audience_segments = - audience_segment_service.update_audience_segments(audience_segments) - return_audience_segments.each do |audience_segment| - puts 'Audience segment ID: %d was updated' % audience_segment[:id] - end - else - puts 'No audience segments found to update.' + # Update the audience segment on the server. + updated_audience_segments = + audience_segment_service.update_audience_segments([audience_segment]) + updated_audience_segments.each do |audience_segment| + puts 'Audience segment with ID %d was updated' % audience_segment[:id] end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_audience_segments() + audience_segment_id = 'INSERT_AUDIENCE_SEGMENT_ID_HERE'.to_i + update_audience_segments(dfp, audience_segment_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/base_rate_service/get_all_base_rates.rb b/dfp_api/examples/v201802/base_rate_service/get_all_base_rates.rb new file mode 100755 index 000000000..451f2e182 --- /dev/null +++ b/dfp_api/examples/v201802/base_rate_service/get_all_base_rates.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all base rates. +require 'dfp_api' + +def get_all_base_rates(dfp) + base_rate_service = dfp.service(:BaseRateService, API_VERSION) + + # Create a statement to select base rates. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of base rates at a time, paging + # through until all base rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = base_rate_service.get_base_rates_by_statement( + statement.to_statement() + ) + + # Print out some information for each base rate. + unless page[:results].nil? + page[:results].each_with_index do |base_rate, index| + puts ('%d) Base rate with ID %d, type "%s" and rate card ID %d was ' + + 'found.') % [index + statement.offset, base_rate[:id], + base_rate[:xsi_type], base_rate[:rate_card_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of base rates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_base_rates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/base_rate_service/get_base_rates_for_rate_card.rb b/dfp_api/examples/v201802/base_rate_service/get_base_rates_for_rate_card.rb new file mode 100755 index 000000000..a472f6255 --- /dev/null +++ b/dfp_api/examples/v201802/base_rate_service/get_base_rates_for_rate_card.rb @@ -0,0 +1,85 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all base rates belonging to a rate card. +require 'dfp_api' + +def get_base_rates_for_rate_card(dfp, rate_card_id) + base_rate_service = dfp.service(:BaseRateService, API_VERSION) + + # Create a statement to select base rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'rateCardId = :rate_card_id' + sb.with_bind_variable('rate_card_id', rate_card_id) + end + + # Retrieve a small amount of base rates at a time, paging + # through until all base rates have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the base rates by statement. + page = base_rate_service.get_base_rates_by_statement( + statement.to_statement() + ) + + # Print out some information for each base rate. + unless page[:results].nil? + page[:results].each_with_index do |base_rate, index| + puts ('%d) Base rate with ID %d, type "%s", and rate card ID %d was ' + + 'found.' % [index + statement.offset, base_rate[:id], + base_rate[:xsi_type], base_rate[:rate_card_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of base rates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + rate_card_id = 'INSERT_RATE_CARD_ID_HERE'.to_i + get_base_rates_for_rate_card(dfp, rate_card_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/cdn_configuration_service/create_cdn_configurations.rb b/dfp_api/examples/v201802/cdn_configuration_service/create_cdn_configurations.rb new file mode 100755 index 000000000..2fa9e0475 --- /dev/null +++ b/dfp_api/examples/v201802/cdn_configuration_service/create_cdn_configurations.rb @@ -0,0 +1,117 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates new CDN configurations. To determine which CDN +# configurations exist, run get_all_cdn_configurations.rb. + +require 'dfp_api' + +def create_cdn_configurations(dfp) + # Get the CdnConfigurationService. + cdn_configuration_service = dfp.service(:CdnConfigurationService, API_VERSION) + + # Make CDN Configuration objects. + # Only LIVE_STREAM_SOURCE_CONTENT is currently supported by the API. + # Basic example with no security policies. + cdn_config_without_security_policy = { + :name => 'ApiConfig1', + :cdn_configuration_type => 'LIVE_STREAM_SOURCE_CONTENT', + :source_content_configuration => { + :ingest_settings => { + :url_prefix => 'ingest1.com', + :security_policy => { + :security_policy_type => 'NONE' + } + }, + :default_delivery_settings => { + :url_prefix => 'delivery1.com', + :security_policy => { + :security_policy_type => 'NONE' + } + } + } + } + # Complex example with security policies. + cdn_config_with_security_policy = { + :name => 'ApiConfig2', + :cdn_configuration_type => 'LIVE_STREAM_SOURCE_CONTENT', + :source_content_configuration => { + :ingest_settings => { + :url_prefix => 'ingest1.com', + :security_policy => { + :security_policy_type => 'AKAMAI', + :disable_server_side_url_signing => false, + :token_authentication_key => 'abc123' + } + }, + :default_delivery_settings => { + :url_prefix => 'delivery1.com', + :security_policy => { + :security_policy_type => 'AKAMAI', + :disable_server_side_url_signing => true, + :origin_forwarding_type => 'CONVENTIONAL', + :origin_path_prefix => '/path/to/my/origin' + } + } + } + } + + # Create the CDN configurations on the server. + cdn_configurations = cdn_configuration_service.create_cdn_configurations([ + cdn_config_without_security_policy, cdn_config_with_security_policy + ]) + + if cdn_configurations.to_a.size > 0 + cdn_configurations.each do |cdn_configuration| + puts 'A CDN configuration with ID %d and name "%s" was created.' % + [cdn_configuration[:id], cdn_configuration[:name]] + end + else + puts 'No CDN configurations were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + create_cdn_configurations(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/cdn_configuration_service/get_all_cdn_configurations.rb b/dfp_api/examples/v201802/cdn_configuration_service/get_all_cdn_configurations.rb new file mode 100755 index 000000000..e84bdb2bd --- /dev/null +++ b/dfp_api/examples/v201802/cdn_configuration_service/get_all_cdn_configurations.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all of your network's CDN configurations. + +require 'dfp_api' + +def get_all_cdn_configurations(dfp) + # Get the CdnConfigurationService. + cdn_configuration_service = dfp.service(:CdnConfigurationService, API_VERSION) + + # Create a statement to select CDN configurations. + statement = dfp.new_statement_builder() + + # Retrieve a small number of CDN configurations at a time, paging + # through until all CDN configuration objects have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the CDN configurations by statement. + page = cdn_configuration_service.get_cdn_configurations_by_statement( + statement.to_statement() + ) + + # Print out some information for each CDN configuration. + unless page[:results].nil? + page[:results].each_with_index do |cdn_configuration, index| + puts '%d) CDN configuration with ID %d and name "%s" was found.' % + [index + statement.offset, cdn_configuration[:id], + cdn_configuration[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of CDN configurations: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_cdn_configurations(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/common/error_handling.rb b/dfp_api/examples/v201802/common/error_handling.rb similarity index 90% rename from dfp_api/examples/v201705/common/error_handling.rb rename to dfp_api/examples/v201802/common/error_handling.rb index a53e120df..d9fb8f4c9 100755 --- a/dfp_api/examples/v201705/common/error_handling.rb +++ b/dfp_api/examples/v201802/common/error_handling.rb @@ -20,16 +20,7 @@ require 'dfp_api' -API_VERSION = :v201705 - -def produce_api_error() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def produce_api_error(dfp) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) @@ -39,15 +30,25 @@ def produce_api_error() # Execute request and get the response, this should raise an exception. user = user_service.update_user(user) - # Output retrieved data. - puts "User ID: %d, name: %s, email: %s" % + # Output retrieved data. (This code will not actually be executed, since the + # call to update_user raises an exception.) + puts 'User ID: %d, name: %s, email: %s' % [user[:id], user[:name], user[:email]] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin # This function should produce an exception for demo. - produce_api_error() + produce_api_error(dfp) # One of two kinds of exception might occur, general HTTP error like 403 or # 404 and DFP API error defined in WSDL and described in documentation. diff --git a/dfp_api/examples/v201705/common/oauth2_jwt_handling.rb b/dfp_api/examples/v201802/common/oauth2_jwt_handling.rb similarity index 83% rename from dfp_api/examples/v201705/common/oauth2_jwt_handling.rb rename to dfp_api/examples/v201802/common/oauth2_jwt_handling.rb index 6d6bf97ef..c67c74689 100755 --- a/dfp_api/examples/v201705/common/oauth2_jwt_handling.rb +++ b/dfp_api/examples/v201802/common/oauth2_jwt_handling.rb @@ -25,17 +25,7 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def oauth2_jwt_handling() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def oauth2_jwt_handling(dfp) # Option 1: provide key filename as authentication -> oauth2_keyfile in the # configuration file. No additional code is necessary. # To provide a file name at runtime, use authorize: @@ -54,32 +44,43 @@ def oauth2_jwt_handling() user_service = dfp.service(:UserService, API_VERSION) # Create a statement to select all users. - statement = DfpApi::FilterStatement.new('ORDER BY id ASC') + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end # Define initial values. + page = {:total_result_set_size => 0} begin # Get users by statement. - page = user_service.get_users_by_statement( - statement.toStatement()) + page = user_service.get_users_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |user, index| - puts "%d) User ID: %d, name: %s, email: %s" % + puts '%d) User ID: %d, name: %s, email: %s' % [index + statement.offset, user[:id], user[:name], user[:email]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer - if page.include?(:total_result_set_size) - puts "Total number of users: %d" % page[:total_result_set_size] - end + puts 'Total number of users: %d' % page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - oauth2_jwt_handling() + oauth2_jwt_handling(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/common/setup_oauth2.rb b/dfp_api/examples/v201802/common/setup_oauth2.rb similarity index 89% rename from dfp_api/examples/v201705/common/setup_oauth2.rb rename to dfp_api/examples/v201802/common/setup_oauth2.rb index f09b78b0b..d9d11425e 100755 --- a/dfp_api/examples/v201705/common/setup_oauth2.rb +++ b/dfp_api/examples/v201802/common/setup_oauth2.rb @@ -21,31 +21,21 @@ require 'dfp_api' -API_VERSION = :v201705 - -def setup_oauth2() - # DfpApi::Api will read a config file from ENV['HOME']/dfp_api.yml - # when called without parameters. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def setup_oauth2(dfp) # You can call authorize explicitly to obtain the access token. Otherwise, it # will be invoked automatically on the first API call. # There are two ways to provide verification code, first one is via the block: token = dfp.authorize() do |auth_url| - puts "Hit Auth error, please navigate to URL:\n\t%s" % auth_url + puts 'Hit Auth error, please navigate to URL:\n\t%s' % auth_url print 'log in and type the verification code: ' verification_code = gets.chomp verification_code end - if token - print "\nWould you like to update your dfp_api.yml to save " + - "OAuth2 credentials? (y/N): " + unless token.nil? + print '\nWould you like to update your dfp_api.yml to save ' + + 'OAuth2 credentials? (y/N): ' response = gets.chomp - if ('y'.casecmp(response) == 0) or ('yes'.casecmp(response) == 0) + if ('y'.casecmp(response) == 0) || ('yes'.casecmp(response) == 0) dfp.save_oauth2_token(token) puts 'OAuth2 token is now saved to ~/dfp_api.yml and will be ' + 'automatically used by the library.' @@ -64,8 +54,16 @@ def setup_oauth2() end if __FILE__ == $0 + # DfpApi::Api will read a config file from ENV['HOME']/dfp_api.yml + # when called without parameters. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - setup_oauth2() + setup_oauth2(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/company_service/create_companies.rb b/dfp_api/examples/v201802/company_service/create_companies.rb similarity index 75% rename from dfp_api/examples/v201705/company_service/create_companies.rb rename to dfp_api/examples/v201802/company_service/create_companies.rb index 681729ed6..079d89bd9 100755 --- a/dfp_api/examples/v201705/company_service/create_companies.rb +++ b/dfp_api/examples/v201802/company_service/create_companies.rb @@ -19,46 +19,45 @@ # This example creates new companies. To determine which companies exist, run # get_all_companies.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -# Number of companies to create. -ITEM_COUNT = 5 - -def create_companies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_companies(dfp, number_of_companies_to_create) # Get the CompanyService. company_service = dfp.service(:CompanyService, API_VERSION) # Create an array to store local company objects. - companies = (1..ITEM_COUNT).map do |index| - {:name => "Advertiser #%d-%d" % [Time.new.to_f * 1000, index], - :type => 'ADVERTISER'} + companies = (1..number_of_companies_to_create).map do + {:name => 'Advertiser %d' % SecureRandom.uuid(), :type => 'ADVERTISER'} end # Create the companies on the server. - return_companies = company_service.create_companies(companies) + created_companies = company_service.create_companies(companies) - if return_companies - return_companies.each do |company| - puts "Company with ID: %d, name: %s and type: %s was created." % + if created_companies.to_a.size > 0 + created_companies.each do |company| + puts 'Company with ID %d, name "%s", and type "%s" was created.' % [company[:id], company[:name], company[:type]] end else - raise 'No companies were created.' + puts 'No companies were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_companies() + number_of_companies_to_create = 5 + create_companies(dfp, number_of_companies_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/company_service/get_advertisers.rb b/dfp_api/examples/v201802/company_service/get_advertisers.rb new file mode 100755 index 000000000..da4273de4 --- /dev/null +++ b/dfp_api/examples/v201802/company_service/get_advertisers.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all companies that are advertisers. +require 'dfp_api' + +def get_advertisers(dfp) + company_service = dfp.service(:CompanyService, API_VERSION) + + # Create a statement to select companies. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'ADVERTISER') + end + + # Retrieve a small amount of companies at a time, paging + # through until all companies have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the companies by statement. + page = company_service.get_companies_by_statement( + statement.to_statement() + ) + + # Print out some information for each company. + unless page[:results].nil? + page[:results].each_with_index do |company, index| + puts '%d) Company with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, company[:id], company[:name], + company[:type]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of companies: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_advertisers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/company_service/get_all_companies.rb b/dfp_api/examples/v201802/company_service/get_all_companies.rb new file mode 100755 index 000000000..f119cf36d --- /dev/null +++ b/dfp_api/examples/v201802/company_service/get_all_companies.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all companies. +require 'dfp_api' + +def get_all_companies(dfp) + company_service = dfp.service(:CompanyService, API_VERSION) + + # Create a statement to select companies. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of companies at a time, paging + # through until all companies have been retrieved. + page = {:total_result_set_size => 0} + begin + page = company_service.get_companies_by_statement( + statement.to_statement() + ) + + # Print out some information for each company. + unless page[:results].nil? + page[:results].each_with_index do |company, index| + puts '%d) Company with ID %d, name "%s", and type "%s" was found.' % + [index + statement.offset, company[:id], company[:name], + company[:type]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of companies: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_companies(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/company_service/update_companies.rb b/dfp_api/examples/v201802/company_service/update_companies.rb similarity index 53% rename from dfp_api/examples/v201705/company_service/update_companies.rb rename to dfp_api/examples/v201802/company_service/update_companies.rb index e2ce92b7c..428c72f6b 100755 --- a/dfp_api/examples/v201705/company_service/update_companies.rb +++ b/dfp_api/examples/v201802/company_service/update_companies.rb @@ -16,75 +16,58 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates the names of all companies that are advertisers by -# appending "LLC." up to the first 500. To determine which companies exist, run +# This example updates a company's name. To determine which companies exist, run # get_all_companies.rb. require 'dfp_api' - -API_VERSION = :v201705 - -def update_companies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_companies(dfp, company_id) # Get the CompanyService. company_service = dfp.service(:CompanyService, API_VERSION) - # Specify a single company to fetch. - company_id = 'INSERT_COMPANY_ID_HERE' - # Create a statement to only select a single company. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :company_id ORDER BY id ASC', - [ - {:key => 'company_id', - :value => {:value => company_id, :xsi_type => 'NumberValue'} - } - ], - 1 - ) - - # Get companies by statement. - page = company_service.get_companies_by_statement(statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :company_id' + sb.with_bind_variable('company_id', company_id) + sb.limit = 1 + end - if page[:results] - companies = page[:results] + # Get the company by statement. + response = company_service.get_companies_by_statement( + statement.to_statement() + ) + raise 'No companies found to update.' if response[:results].to_a.empty? + company = response[:results].first - # Update each local company object by appending ' LLC.' to its name. - companies.each do |company| - company[:name] += ' LLC.' - # Workaround for issue #94. - [:address, :email, :fax_phone, :primary_phone, - :external_id, :comment].each do |item| - company[item] = "" if company[item].nil? - end - end + # Update company object by appending ' LLC.' to its name. + company[:name] += ' LLC.' - # Update the companies on the server. - return_companies = company_service.update_companies(companies) + # Update the companies on the server. + updated_companies = company_service.update_companies([company]) - if return_companies - return_companies.each do |company| - puts "A company with ID [%d], name: %s and type %s was updated." % - [company[:id], company[:name], company[:type]] - end - else - raise 'No companies were updated.' + if updated_companies.to_a.size > 0 + updated_companies.each do |company| + puts 'A company with ID %d, name "%s", and type "%s" was updated.' % + [company[:id], company[:name], company[:type]] end else - puts 'No companies found to update.' + puts 'No companies were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_companies() + company_id = 'INSERT_COMPANY_ID_HERE'.to_i + update_companies(dfp, company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/contact_service/create_contacts.rb b/dfp_api/examples/v201802/contact_service/create_contacts.rb similarity index 78% rename from dfp_api/examples/v201705/contact_service/create_contacts.rb rename to dfp_api/examples/v201802/contact_service/create_contacts.rb index b16a5d8ee..49d211774 100755 --- a/dfp_api/examples/v201705/contact_service/create_contacts.rb +++ b/dfp_api/examples/v201802/contact_service/create_contacts.rb @@ -21,25 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_contacts() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_contacts(dfp, advertiser_company_id, agency_company_id) # Get the ContactService. contact_service = dfp.service(:ContactService, API_VERSION) - # Set the ID of the advertiser company this contact is associated with. - advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' - - # Set the ID of the agency company this contact is associated with. - agency_company_id = 'INSERT_AGENCY_COMPANY_ID_HERE' - # Create an advertiser contact. advertiser_contact = { :name => 'Mr. Advertiser', @@ -55,23 +40,34 @@ def create_contacts() } # Create the contacts on the server. - return_contacts = contact_service.create_contacts([advertiser_contact, + created_contacts = contact_service.create_contacts([advertiser_contact, agency_contact]) # Display results. - if return_contacts - return_contacts.each do |contact| - puts 'A contact with ID %d and name %s was created.' % [contact[:id], + if created_contacts.to_a.size > 0 + created_contacts.each do |contact| + puts 'A contact with ID %d and name "%s" was created.' % [contact[:id], contact[:name]] end else - raise 'No contacts were created.' + puts 'No contacts were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_contacts() + advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE' + agency_company_id = 'INSERT_AGENCY_COMPANY_ID_HERE' + create_contacts(dfp, advertiser_company_id, agency_company_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/contact_service/get_all_contacts.rb b/dfp_api/examples/v201802/contact_service/get_all_contacts.rb new file mode 100755 index 000000000..b070a5dd3 --- /dev/null +++ b/dfp_api/examples/v201802/contact_service/get_all_contacts.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all contacts. + +require 'dfp_api' + +def get_all_contacts(dfp) + contact_service = dfp.service(:ContactService, API_VERSION) + + # Create a statement to select contacts. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of contacts at a time, paging + # through until all contacts have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the contacts by statement. + page = contact_service.get_contacts_by_statement( + statement.to_statement() + ) + + # Print out some information for each contact. + unless page[:results].nil? + page[:results].each_with_index do |contact, index| + puts '%d) Contact with ID %d and name "%s" was found.' % + [index + statement.offset, contact[:id], contact[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of contacts: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_contacts(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/contact_service/get_uninvited_contacts.rb b/dfp_api/examples/v201802/contact_service/get_uninvited_contacts.rb new file mode 100755 index 000000000..40d6d6267 --- /dev/null +++ b/dfp_api/examples/v201802/contact_service/get_uninvited_contacts.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all contacts that aren't invited yet. + +require 'dfp_api' + +def get_uninvited_contacts(dfp) + contact_service = dfp.service(:ContactService, API_VERSION) + + # Create a statement to select contacts. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'UNINVITED') + end + + # Retrieve a small amount of contacts at a time, paging + # through until all contacts have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get the contacts by statement. + page = contact_service.get_contacts_by_statement( + statement.to_statement() + ) + + # Print out some information for each contact. + unless page[:results].nil? + page[:results].each_with_index do |contact, index| + puts '%d) Contact with ID %d and name "%s" was found.' % + [index + statement.offset, contact[:id], contact[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of contacts: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_uninvited_contacts(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/contact_service/update_contacts.rb b/dfp_api/examples/v201802/contact_service/update_contacts.rb similarity index 60% rename from dfp_api/examples/v201705/contact_service/update_contacts.rb rename to dfp_api/examples/v201802/contact_service/update_contacts.rb index 8b615a31b..af8dd6881 100755 --- a/dfp_api/examples/v201705/contact_service/update_contacts.rb +++ b/dfp_api/examples/v201802/contact_service/update_contacts.rb @@ -16,67 +16,57 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates contact comments. To determine which contacts exist, +# This example updates a contact's address. To determine which contacts exist, # run get_all_contacts.rb. require 'dfp_api' - -API_VERSION = :v201705 - -def update_contacts() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_contacts(dfp, contact_id) # Get the ContactService. contact_service = dfp.service(:ContactService, API_VERSION) - contact_id = 'INSERT_CONTACT_ID_HERE'.to_i - # Create a statement to only select a single contact. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => contact_id, :xsi_type => 'NumberValue'}} - ], - 1 - } + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :contact_id' + sb.with_bind_variable('contact_id', contact_id) + sb.limit = 1 + end # Get contacts by statement. - page = contact_service.get_contacts_by_statement(statement.toStatement()) + response = contact_service.get_contacts_by_statement(statement.to_statement()) + raise 'No contacts found to update.' if response[:results].to_a.empty? + contact = response[:results].first - if page[:results] - contacts = page[:results] + # Update the address of the contact. + contact[:address] = '123 New Street, New York, NY, 10011' - contacts.each do |contact| - # Update the comment of the contact. - contact[:address] = '123 New Street, New York, NY, 10011' - end - - # Update the contact on the server. - return_contacts = contact_service.update_contacts([contact]) + # Update the contact on the server. + updated_contacts = contact_service.update_contacts([contact]) - # Display results. - if return_contacts - return_contacts.each do |updated_contact| - puts "Contact with ID: %d, name: %s and comment: '%s' was updated." % - [updated_contact[:id], updated_contact[:name], - updated_contact[:comment]] - end - else - raise 'No contacts were updated.' + # Display results. + if updated_contacts.to_a.size > 0 + updated_contacts.each do |contact| + puts 'Contact with ID %d, name: "%s", and address "%s" was updated.' % + [contact[:id], contact[:name], contact[:comment]] end + else + puts 'No contacts were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_contacts() + contact_id = 'INSERT_CONTACT_ID_HERE'.to_i + update_contacts(dfp, contact_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb similarity index 74% rename from dfp_api/examples/v201705/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb rename to dfp_api/examples/v201802/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb index d0e1a244b..02411a50a 100755 --- a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb @@ -20,25 +20,14 @@ # # This feature is only available to DFP video publishers. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_content_metadata_key_hierarchies(dfp, hierarchy_level_one_key_id, + hierarchy_level_two_key_id) # Get the ContentMetadataKeyHierarchyService. cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Set the IDs of the custom targeting keys for the hierarchy. - hierarchy_level_one_key_id = 'INSERT_LEVEL_ONE_CUSTOM_TARGETING_KEY_ID_HERE' - hierarchy_level_two_key_id = 'INSERT_LEVEL_TWO_CUSTOM_TARGETING_KEY_ID_HERE' - hierarchy_level_1 = { :custom_targeting_key_id => hierarchy_level_own_key_id, :hierarchy_level => 1 @@ -52,27 +41,40 @@ def create_content_metadata_key_hierarchies() hierarchy_levels = [hierarchy_level_1, hierarchy_level_2] content_metadata_key_hierarchy = { - :name => 'Content Metadata Key Hierarchy #%d' % (Time.new.to_f * 1000), + :name => 'Content Metadata Key Hierarchy %d' % SecureRandom.uuid(), :hierarchy_levels => hierarchy_levels } # Create the content metadata key hierarchy on the server. content_metadata_key_hierarchies = cmkh_service.create_content_metadata_key_hierarchies( - [content_metadata_key_hierarchy]) + [content_metadata_key_hierarchy] + ) content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| - puts 'A content metadata key hierarchy with ID %d, name "%s", and %d ' + - 'levels was created.' % [ - content_metadata_key_hierarchy[:id], - content_metadata_key_hierarchy[:name], - content_metadata_key_hierarchy[:hierarchy_levels].length] + puts ('A content metadata key hierarchy with ID %d, name "%s", and %d ' + + 'levels was created.') % [content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name], + content_metadata_key_hierarchy[:hierarchy_levels].length] end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_content_metadata_key_hierarchies() + hierarchy_level_one_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + hierarchy_level_two_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + create_content_metadata_key_hierarchies( + dfp, hierarchy_level_one_key_id, hierarchy_level_two_key_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb similarity index 56% rename from dfp_api/examples/v201705/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb rename to dfp_api/examples/v201802/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb index 4843622e3..62d4101c4 100755 --- a/dfp_api/examples/v201705/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb +++ b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb @@ -22,66 +22,60 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def delete_content_metadata_key_hierarchies() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_content_metadata_key_hierarchies(dfp, + content_metadata_key_hierarchy_id) # Get the ContentMetadataKeyHierarchyService. cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) - # Set the ID of the content metadata key hierarchy. - content_metadata_key_hierarchy_id = 'CONTENT_METADATA_KEY_HIERARCHY_ID' - # Create a statement to only select a single content metadata key hierarchy. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => content_metadata_key_hierarchy_id, - :xsi_type => 'NumberValue'}}, - ], - 1 - ) - - # Get content metadata key hierarchies by statement. - page = cmkh_service.get_content_metadata_key_hierarchies_by_statement( - statement.toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', content_metadata_key_hierarchy_id) + sb.limit = 1 + end - if page[:results] - content_metadata_key_hierarchy = page[:results].first + # Get content metadata key hierarchy to delete. + response = cmkh_service.get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) + if response[:results].to_a.empty? + raise 'No content metadata key hierarchy found to delete.' end + content_metadata_key_hierarchy = response[:results].first - if content_metadata_key_hierarchy - puts 'Content metadata key hierarchy with ID ' + - '"%d" will be deleted.' % content_metadata_key_hierarchy[:id] + puts 'Content metadata key hierarchy with ID %d will be deleted.' % + content_metadata_key_hierarchy[:id] - # Perform action. - result = cmkh_service.perform_content_metadata_key_hierarchy_action( - {:xsi_type => 'DeleteContentMetadataKeyHierarchy'}, - statement.toStatement()) + # Perform action. + result = cmkh_service.perform_content_metadata_key_hierarchy_action( + {:xsi_type => 'DeleteContentMetadataKeyHierarchy'}, + statement.to_statement() + ) - # Display results. - if result and result[:num_changes] > 0 - puts 'Number of content metadata key hierarchies deleted: %d' % - result[:num_changes] - else - puts 'No content metadata key hierarchies were deleted.' - end + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of content metadata key hierarchies deleted: %d' % + result[:num_changes] else - puts 'No content metadata key hierarchy found to delete.' + puts 'No content metadata key hierarchies were deleted.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_content_metadata_key_hierarchies() + content_metadata_key_hierarchy_id = 'CONTENT_METADATA_KEY_HIERARCHY_ID'.to_i + delete_content_metadata_key_hierarchies( + dfp, content_metadata_key_hierarchy_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb new file mode 100755 index 000000000..1e6ba0fbb --- /dev/null +++ b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all content metadata key hierarchies. + +require 'dfp_api' + +def get_all_content_metadata_key_hierarchies(dfp) + content_metadata_key_hierarchy_service = + dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) + + # Create a statement to select content metadata key hierarchies. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of content metadata key hierarchies at a time, + # paging through until all content metadata key hierarchies have been + # retrieved. + page = {:total_result_set_size => 0} + begin + # Get the content metadata key hierarchies by statement. + page = content_metadata_key_hierarchy_service. + get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) + + # Print out some information for each content metadata key hierarchy. + unless page[:results].nil? + page[:results].each_with_index do |content_metadata_key_hierarchy, index| + puts ('%d) Content metadata key hierarchy with ID %d and name "%s" ' + + 'was found.') % [index + statement.offset, + content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of content metadata key hierarchies: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_content_metadata_key_hierarchies(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb new file mode 100755 index 000000000..f9269895f --- /dev/null +++ b/dfp_api/examples/v201802/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb @@ -0,0 +1,103 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates a single content metadata key hierarchy. +# +# This feature is only available to DFP video publishers. + +require 'dfp_api' + +def update_content_metadata_key_hierarchies(dfp, + content_metadata_key_hierarchy_id, custom_targeting_key_id) + # Get the ContentMetadataKeyHierarchyService. + cmkh_service = dfp.service(:ContentMetadataKeyHierarchyService, API_VERSION) + + # Create a statement to only select a single content metadata key hierarchy. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', content_metadata_key_hierarchy_id) + sb.limit = 1 + end + + # Get content metadata key hierarchy to update by statement. + response = cmkh_service.get_content_metadata_key_hierarchies_by_statement( + statement.to_statement() + ) + if response[:results].to_a.empty? + raise 'No content metadata key hierarchy found to update.' + end + content_metadata_key_hierarchy = response[:results].first + + # Update the content metadata key hierarchy by adding a hierarchy level. + hierarchy_levels = content_metadata_key_hierarchy[:hierarchy_levels] + + hierarchy_level = { + :custom_targeting_key_id => custom_targeting_key_id, + :hierarchy_level => hierarchy_levels.length + 1 + } + + content_metadata_key_hierarchy[:hierarchy_levels] = + hierarchy_levels.concat([hierarchy_level]) + + # Update the content metadata key hierarchy on the server. + content_metadata_key_hierarchies = + cmkh_service.update_content_metadata_key_hierarchies( + [content_metadata_key_hierarchy] + ) + + content_metadata_key_hierarchies.each do |content_metadata_key_hierarchy| + puts 'Content metadata key hierarchy with ID %d, name "%s" was updated.' % + [content_metadata_key_hierarchy[:id], + content_metadata_key_hierarchy[:name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + content_metadata_key_hierarchy_id = + 'INSERT_CONTENT_METADATA_KEY_HIERARCHY_ID_HERE'.to_i + custom_targeting_key_id = "INSERT_CUSTOM_TARGETING_KEY_ID_HERE".to_i + update_content_metadata_key_hierarchies( + dfp, content_metadata_key_hierarchy_id, custom_targeting_key_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/content_service/get_all_content.rb b/dfp_api/examples/v201802/content_service/get_all_content.rb new file mode 100755 index 000000000..16c96e8e2 --- /dev/null +++ b/dfp_api/examples/v201802/content_service/get_all_content.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all content. + +require 'dfp_api' + +def get_all_content(dfp) + content_service = + dfp.service(:ContentService, API_VERSION) + + # Create a statement to select content. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of content at a time, paging + # through until all content have been retrieved. + page = {:total_result_set_size => 0} + begin + page = content_service.get_content_by_statement( + statement.to_statement() + ) + + # Print out some information for each content. + unless page[:results].nil? + page[:results].each_with_index do |content, index| + puts '%d) Content with ID %d and name "%s" was found.' % + [index + statement.offset, content[:id], content[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of content: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_content(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/creative_service/copy_image_creatives.rb b/dfp_api/examples/v201802/creative_service/copy_image_creatives.rb similarity index 72% rename from dfp_api/examples/v201705/creative_service/copy_image_creatives.rb rename to dfp_api/examples/v201802/creative_service/copy_image_creatives.rb index bf5c531cc..48d6c913a 100755 --- a/dfp_api/examples/v201705/creative_service/copy_image_creatives.rb +++ b/dfp_api/examples/v201802/creative_service/copy_image_creatives.rb @@ -21,51 +21,30 @@ # creatives exist, run get_all_creatives.rb. require 'dfp_api' - require 'base64' -API_VERSION = :v201705 - -def copy_image_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def copy_image_creatives(dfp, image_creative_ids) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Create a list of creative ids to copy. - image_creative_ids = [ - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, - 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i - ] - # Create the statement to filter image creatives by ID. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s) AND creativeType = :creative_type" % - image_creative_ids.join(', '), - [ - {:key => 'creative_type', - :value => {:value => 'ImageCreative', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s) AND creativeType = :creative_type' % + image_creative_ids.join(', ') + sb.with_bind_variable('creative_type', 'ImageCreative') + end # Get creatives by statement. - page = creative_service.get_creatives_by_statement(statement.toStatement()) + page = creative_service.get_creatives_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 creatives = page[:results] # Copy each local creative object and change its name. new_creatives = creatives.map do |creative| new_creative = creative.dup() old_id = new_creative.delete(:id) - new_creative[:name] += " (Copy of %d)" % old_id + new_creative[:name] += ' (Copy of %d)' % old_id image_url = new_creative.delete(:image_url) new_creative[:image_byte_array] = Base64.encode64(AdsCommon::Http.get(image_url, dfp.config)) @@ -73,16 +52,16 @@ def copy_image_creatives() end # Create the creatives on the server. - return_creatives = creative_service.create_creatives(new_creatives) + created_creatives = creative_service.create_creatives(new_creatives) # Display copied creatives. - if return_creatives - return_creatives.each_with_index do |creative, index| - puts "A creative with ID [%d] was copied to ID [%d], name: %s" % + if created_creatives.to_a.size > 0 + created_creatives.each_with_index do |creative, index| + puts 'A creative with ID %d was copied to ID %d, named "%s".' % [creatives[index][:id], creative[:id], creative[:name]] end else - raise 'No creatives were copied.' + puts 'No creatives were copied.' end else puts 'No creatives found to copy.' @@ -90,8 +69,23 @@ def copy_image_creatives() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - copy_image_creatives() + image_creative_ids = [ + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i, + 'INSERT_IMAGE_CREATIVE_ID_HERE'.to_i + ] + copy_image_creatives(dfp, image_creative_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_service/create_creative_from_template.rb b/dfp_api/examples/v201802/creative_service/create_creative_from_template.rb similarity index 75% rename from dfp_api/examples/v201705/creative_service/create_creative_from_template.rb rename to dfp_api/examples/v201802/creative_service/create_creative_from_template.rb index e548ae09c..09895a6da 100755 --- a/dfp_api/examples/v201705/creative_service/create_creative_from_template.rb +++ b/dfp_api/examples/v201802/creative_service/create_creative_from_template.rb @@ -19,42 +19,28 @@ # This example creates a new template creative for a given advertiser. To # determine which companies are advertisers, run get_companies_by_statement.rb. # To determine which creatives already exist, run get_all_creatives.rb. To -# determine which creative templates run get_all_creative_templates.rb. +# determine which creative templates exist, run get_all_creative_templates.rb. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_creative_from_template() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creative_from_template(dfp, advertiser_id, creative_template_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - - # Use the image banner with optional third party tracking template. - creative_template_id = 10000680 - # Create the local custom creative object. creative = { :xsi_type => 'TemplateCreative', :name => 'Template creative', :advertiser_id => advertiser_id, :creative_template_id => creative_template_id, - :size => {:width => 600, :height => 315, :is_aspect_ratio => false} + :size => {:width => 300, :height => 250, :is_aspect_ratio => false} } # Prepare image data for asset value. - image_url = 'https://goo.gl/3b9Wfh' + image_url = + 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' image_data = AdsCommon::Http.get(image_url, dfp.config) image_data_base64 = Base64.encode64(image_data) @@ -65,7 +51,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => image_data_base64, # Filenames must be unique. - :file_name => "image%d.jpg" % Time.new.to_i + :file_name => 'image_%d.jpg' % SecureRandom.uuid() } } @@ -94,7 +80,7 @@ def create_creative_from_template() target_window_variable_value = { :xsi_type => 'StringCreativeTemplateVariableValue', :unique_name => 'Targetwindow', - :value => '__blank' + :value => '_blank' } creative[:creative_template_variable_values] = [asset_variable_value, @@ -102,21 +88,34 @@ def create_creative_from_template() url_variable_value, target_window_variable_value] # Create the creatives on the server. - return_creative = creative_service.create_creatives([creative])[0] + created_creatives = creative_service.create_creatives([creative]) - if return_creative - puts(("Template creative with ID: %d, name: %s and type '%s' was " + - "created and can be previewed at: '%s'") % - [return_creative[:id], return_creative[:name], - return_creative[:creative_type], return_creative[:preview_url]]) + if created_creatives.to_a_size > 0 + created_creatives.each do |creative| + puts ('Template creative with ID %d, name "%s" and type "%s" was ' + + 'created and can be previewed at "%s"') % [creative[:id], + creative[:name], creative[:creative_type], creative[:preview_url]] + end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_from_template() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + # Use the image banner with optional third party tracking template. + creative_template_id = 10000680 + create_creative_from_template(dfp, advertiser_id, creative_template_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_service/create_creatives.rb b/dfp_api/examples/v201802/creative_service/create_creatives.rb similarity index 61% rename from dfp_api/examples/v201705/creative_service/create_creatives.rb rename to dfp_api/examples/v201802/creative_service/create_creatives.rb index e1843ca9e..f3975e19e 100755 --- a/dfp_api/examples/v201705/creative_service/create_creatives.rb +++ b/dfp_api/examples/v201802/creative_service/create_creatives.rb @@ -21,73 +21,70 @@ # determine which creatives already exist, run get_all_creatives.rb. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -# Number of creatives to create. -ITEM_COUNT = 5 - -def create_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creatives(dfp, advertiser_id, number_of_creatives_to_create) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Prepare image data for creative. - image_url = 'https://goo.gl/3b9Wfh' + image_url = + 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' image_data = AdsCommon::Http.get(image_url, dfp.config) image_data_base64 = Base64.encode64(image_data) - size = {:width => 600, :height => 315} + size = {:width => 300, :height => 250} # Create an array to store local creative objects. - creatives = (1..ITEM_COUNT).map do |index| + creatives = (1..number_of_creatives_to_create).map do |index| { - :xsi_type => 'ImageCreative', - :name => "Image creative #%d-%d" % [index, (Time.new.to_f * 1000).to_i], - :advertiser_id => advertiser_id, - :destination_url => 'http://www.google.com', - :size => size, - :primary_image_asset => { - :file_name => 'image.jpg', - :asset_byte_array => image_data_base64, - :size => size.dup - } + :xsi_type => 'ImageCreative', + :name => 'Image creative #%d - %d' % [index, SecureRandom.uuid()], + :advertiser_id => advertiser_id, + :destination_url => 'http://www.google.com', + :size => size, + :primary_image_asset => { + :file_name => 'image.jpg', + :asset_byte_array => image_data_base64, + :size => size + } } end # Create the creatives on the server. - return_creatives = creative_service.create_creatives(creatives) + created_creatives = creative_service.create_creatives(creatives) - if return_creatives - return_creatives.each do |creative| + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| if creative[:creative_type] == 'ImageCreative' - puts ("Image creative with ID: %d, name: %s, size: %dx%d was " + - "created and can be previewed at: [%s]") % - [creative[:id], creative[:name], - creative[:size][:width], creative[:size][:height], - creative[:preview_url]] + puts ('Image creative with ID %d, name "%s", and size %dx%d was ' + + 'created and can be previewed at "%s".') % [creative[:id], + creative[:name], creative[:size][:width], creative[:size][:height], + creative[:preview_url]] else - puts "Creative with ID: %d, name: %s and type: %s was created." % + puts 'Creative with ID: %d, name: %s and type: %s was created.' % [creative[:id], creative[:name], creative[:creative_type]] end end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creatives() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + number_of_creatives_to_create = 5 + create_creatives(dfp, advertiser_id, number_of_creatives_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_service/create_custom_creative.rb b/dfp_api/examples/v201802/creative_service/create_custom_creative.rb similarity index 61% rename from dfp_api/examples/v201705/creative_service/create_custom_creative.rb rename to dfp_api/examples/v201802/creative_service/create_custom_creative.rb index d1a12df5a..defb10069 100755 --- a/dfp_api/examples/v201705/creative_service/create_custom_creative.rb +++ b/dfp_api/examples/v201802/creative_service/create_custom_creative.rb @@ -23,66 +23,66 @@ # This feature is only available to DFP premium solution networks. require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_custom_creative() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_creative(dfp, advertiser_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Prepare image data for creative. - image_url = 'https://goo.gl/3b9Wfh' + image_url = + 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' image_data = AdsCommon::Http.get(image_url, dfp.config) image_data_base64 = Base64.encode64(image_data) # Create an array to store local creative objects. custom_creative = { - :xsi_type => 'CustomCreative', - :name => 'Custom creative', - :advertiser_id => advertiser_id, - :destination_url => 'http://www.google.com', - :custom_creative_assets => [{ - :macro_name => 'IMAGE_ASSET', - :asset => { - :file_name => "image%d.jpg" % Time.new.to_i, - :asset_byte_array => image_data_base64 - } - }], - - # Set the HTML snippet using the custom creative asset macro. - :html_snippet => "" + - "
Click above for great deals!", - # Set the creative size. - :size => {:width => 600, :height => 315, :is_aspect_ratio => false} + :xsi_type => 'CustomCreative', + :name => 'Custom creative', + :advertiser_id => advertiser_id, + :destination_url => 'http://www.google.com', + :custom_creative_assets => [{ + :macro_name => 'IMAGE_ASSET', + :asset => { + :file_name => 'image_%d.jpg' % SecureRandom.uuid(), + :asset_byte_array => image_data_base64 + } + }], + # Set the HTML snippet using the custom creative asset macro. + :html_snippet => '' + + '
Click above for great ' + + 'deals!', + # Set the creative size. + :size => {:width => 300, :height => 250, :is_aspect_ratio => false} } # Create the creatives on the server. - return_creative = creative_service.create_creative(custom_creative) + created_creatives = creative_service.create_creative(custom_creative) - if return_creative - puts "Custom creative with ID: %d, name: '%s' and type: '%s' was created." % - [return_creative[:id], return_creative[:name], - return_creative[:creative_type]] + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| + puts ('Custom creative with ID %d, name "%s", and type "%s" was ' + + 'created.') % [creative[:id], creative[:name], + creative[:creative_type]] else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_creative() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + create_custom_creative(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_service/create_native_creative.rb b/dfp_api/examples/v201802/creative_service/create_native_creative.rb similarity index 85% rename from dfp_api/examples/v201705/creative_service/create_native_creative.rb rename to dfp_api/examples/v201802/creative_service/create_native_creative.rb index 96de93f99..023624939 100755 --- a/dfp_api/examples/v201705/creative_service/create_native_creative.rb +++ b/dfp_api/examples/v201802/creative_service/create_native_creative.rb @@ -26,34 +26,22 @@ # https://play.google.com/store/apps/details?id=com.google.fpl.pie_noon&hl=en require 'base64' +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_creative_from_template() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_native_creative(dfp, advertiser_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Set the ID of the advertiser (company) that all creatives will be assigned - # to. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - # Set the URLs of the application screenshot and the small application icon to # use and convert them to byte array strings. screenshot_url = 'https://lh4.ggpht.com/GIGNKdGHMEHFDw6TM2bgAUDKPQQRIReKZPq' + - 'EpMeEhZOPYnTdOQGaSpGSEZflIFs0iw=h300' + 'EpMeEhZOPYnTdOQGaSpGSEZflIFs0iw=h300' screenshot_data = AdsCommon::Http.get(screenshot_url, dfp.config) screenshot_data_base64 = Base64.encode64(screenshot_data) app_icon = 'https://lh6.ggpht.com/Jzvjne5CLs6fJ1MHF-XeuUfpABzl0YNMlp4' + - 'RpHnvPRCIj4--eTDwtyouwUDzVVekXw=w300') + 'RpHnvPRCIj4--eTDwtyouwUDzVVekXw=w300') app_icon_data = AdsCommon::Http.get(app_icon, dfp.config) app_icon_data_base64 = Base64.encode64(app_icon_data) @@ -63,12 +51,12 @@ def create_creative_from_template() # Create the local custom creative object. creative = { :xsi_type => 'TemplateCreative', - :name => "Native creative %d" % Time.new.to_i, + :name => 'Native creative - %d' % SecureRandom.uuid(), :advertiser_id => advertiser_id, :creative_template_id => creative_template_id, :size => {:width => 1, :height => 1, :is_aspect_ratio => false}, :destination_url => 'https://play.google.com/store/apps/details?id=' + - 'com.google.fpl.pie_noon' + 'com.google.fpl.pie_noon' } # Create the Image asset variable value. @@ -78,7 +66,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => screenshot_data_base64, # Filenames must be unique. - :file_name => "image%d.png" % Time.new.to_i + :file_name => 'image_%d.png' % SecureRandom.uuid() } } @@ -89,7 +77,7 @@ def create_creative_from_template() :asset => { :asset_byte_array => app_icon_data_base64, # Filenames must be unique. - :file_name => "image%d.png" % Time.new.to_i + :file_name => 'image_%d.png' % SecureRandom.uuid() } } @@ -155,21 +143,32 @@ def create_creative_from_template() ] # Create the creatives on the server. - return_creative = creative_service.create_creatives([creative])[0] + created_creatives = creative_service.create_creatives([creative]) - if return_creative - puts(("Native creative with ID: %d and name: %s was " + - "created and can be previewed at: '%s'") % - [return_creative[:id], return_creative[:name], - return_creative[:preview_url]]) + if created_creatives.to_a.size > 0 + created_creatives.each do |creative| + puts ('Native creative with ID %d and name "%s" was created and can be ' + + 'previewed at "%s".') % [creative[:id], creative[:name], + creative[:preview_url]] + end else - raise 'No creatives were created.' + puts 'No creatives were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_from_template() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + create_native_creative(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/creative_service/get_all_creatives.rb b/dfp_api/examples/v201802/creative_service/get_all_creatives.rb new file mode 100755 index 000000000..20ac14874 --- /dev/null +++ b/dfp_api/examples/v201802/creative_service/get_all_creatives.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all creatives. + +require 'dfp_api' + +def get_all_creatives(dfp) + # Get the CreativeService. + creative_service = dfp.service(:CreativeService, API_VERSION) + + # Create a statement to select creatives. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of creatives at a time, paging + # through until all creatives have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_service.get_creatives_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative. + unless page[:results].nil? + page[:results].each_with_index do |creative, index| + puts '%d) Creative with ID %d and name "%s" was found.' % + [index + statement.offset, creative[:id], creative[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creatives: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_creatives(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/creative_service/get_image_creatives.rb b/dfp_api/examples/v201802/creative_service/get_image_creatives.rb new file mode 100755 index 000000000..dbf18f43f --- /dev/null +++ b/dfp_api/examples/v201802/creative_service/get_image_creatives.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all image creatives. + +require 'dfp_api' + +def get_image_creatives(dfp) + # Get the CreativeService. + creative_service = dfp.service(:CreativeService, API_VERSION) + + # Create a statement to select creatives. + statement = dfp.new_statement_builder do |sb| + sb.where = 'creativeType = :creativeType' + sb.with_bind_variable('creativeType', 'ImageCreative') + end + + # Retrieve a small amount of creatives at a time, paging + # through until all creatives have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_service.get_creatives_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative. + unless page[:results].nil? + page[:results].each_with_index do |creative, index| + puts '%d) Creative with ID %d and name "%s" was found.' % + [index + statement.offset, creative[:id], creative[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creatives: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_image_creatives(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/creative_service/update_creatives.rb b/dfp_api/examples/v201802/creative_service/update_creatives.rb similarity index 62% rename from dfp_api/examples/v201705/creative_service/update_creatives.rb rename to dfp_api/examples/v201802/creative_service/update_creatives.rb index 53e89e086..3df1f63d2 100755 --- a/dfp_api/examples/v201705/creative_service/update_creatives.rb +++ b/dfp_api/examples/v201802/creative_service/update_creatives.rb @@ -21,63 +21,54 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_creatives() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_creatives(dfp, creative_id) # Get the CreativeService. creative_service = dfp.service(:CreativeService, API_VERSION) - # Specify creative ID to update. - creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i - # Create a statement to get first 500 image creatives. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => creative_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', creative_id) + sb.limit = 1 + end # Get creatives by statement. - page = creative_service.get_creatives_by_statement(statement.toStatement()) - - if page[:results] - creatives = page[:results] + response = creative_service.get_creatives_by_statement( + statement.to_statement() + ) + raise 'No creatives found to update.' if response[:results].to_a.empty? + creative = response[:results].first - # Update each local creative object by changing its destination URL. - creatives.each do |creative| - creative[:destination_url] = 'http://news.google.com' - end + # Update creative object by changing its destination URL. + creative[:destination_url] = 'http://news.google.com' - # Update the creatives on the server. - return_creatives = creative_service.update_creatives(creatives) + # Update the creative on the server. + updated_creatives = creative_service.update_creatives([creative]) - if return_creatives - return_creatives.each do |creative| - puts "Creative with ID: %d, name: %s and url: [%s] was updated." % - [creative[:id], creative[:name], creative[:destination_url]] - end - else - raise 'No creatives were updated.' + # Display the results. + if updated_creatives.to_a.size > 0 + updated_creatives.each do |creative| + puts 'Creative with ID %d, name "%s", and url "%s" was updated.' % + [creative[:id], creative[:name], creative[:destination_url]] end else - puts 'No creatives found to update.' + puts 'No creatives were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creatives() + creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i + update_creatives(dfp, creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_set_service/associate_creative_set_to_line_item.rb b/dfp_api/examples/v201802/creative_set_service/associate_creative_set_to_line_item.rb similarity index 66% rename from dfp_api/examples/v201705/creative_set_service/associate_creative_set_to_line_item.rb rename to dfp_api/examples/v201802/creative_set_service/associate_creative_set_to_line_item.rb index e264cc1df..7a7ffcd4a 100755 --- a/dfp_api/examples/v201705/creative_set_service/associate_creative_set_to_line_item.rb +++ b/dfp_api/examples/v201802/creative_set_service/associate_creative_set_to_line_item.rb @@ -16,26 +16,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This code example creates a line item creative association for a creative -# set. To create creative sets, run create_creative_set.rb. To create creatives, -# run create_creatives.rb. To determine which LICAs exist, run get_all_licas.rb. +# This code example creates a line item creative association (LICA) for a +# creative set. To create creative sets, run create_creative_set.rb. To create +# creatives, run create_creatives.rb. To determine which LICAs exist, run +# get_all_licas.rb. require 'dfp_api' -API_VERSION = :v201705 - -def associate_creative_set_to_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the line item ID and creative set ID to associate. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i - +def associate_creative_set_to_line_item(dfp, line_item_id, creative_set_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) @@ -45,15 +33,32 @@ def associate_creative_set_to_line_item() } # Create the LICAs on the server. - return_lica = lica_service.create_line_item_creative_associations([lica]) + created_licas = lica_service.create_line_item_creative_associations([lica]) - puts 'A LICA with line item ID %d and creative set ID %d was created.' % - [return_lica[:line_item_id], return_lica[:creative_set_id]] + # Display the results. + if created_licas.to_a.size > 0 + created_licas.each do |lica| + puts 'A LICA with line item ID %d and creative set ID %d was created.' % + [lica[:line_item_id], lica[:creative_set_id]] + end + else + puts 'No LICAs were updated.' end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - associate_creative_set_to_line_item() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i + associate_creative_set_to_line_item(dfp, line_item_id, creative_set_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_set_service/create_creative_set.rb b/dfp_api/examples/v201802/creative_set_service/create_creative_set.rb similarity index 67% rename from dfp_api/examples/v201705/creative_set_service/create_creative_set.rb rename to dfp_api/examples/v201802/creative_set_service/create_creative_set.rb index 4d627d4ee..fe80d64f2 100755 --- a/dfp_api/examples/v201705/creative_set_service/create_creative_set.rb +++ b/dfp_api/examples/v201802/creative_set_service/create_creative_set.rb @@ -18,48 +18,48 @@ # # This code example creates a new creative set. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_creative_set() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i - companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i - +def create_creative_set(dfp, master_creative_id, companion_creative_id) # Get the CreativeSetService. creative_set_service = dfp.service(:CreativeSetService, API_VERSION) # Create an array to store local creative set object. creative_set = { - :name => 'Creative set #%d' % (Time.new.to_f * 1000), - :master_creative_id => master_creative_id, - :companion_creative_ids => [companion_creative_id] + :name => 'Creative set #%d' % SecureRandom.uuid(), + :master_creative_id => master_creative_id, + :companion_creative_ids => [companion_creative_id] } # Create the creative set on the server. - return_set = creative_set_service.create_creative_set(creative_set) + created_creative_set = creative_set_service.create_creative_set(creative_set) - if return_set - puts ('Creative set with ID: %d, master creative ID: %d and companion ' + - 'creative IDs: [%s] was created') % - [return_set[:id], return_set[:master_creative_id], - return_set[:companion_creative_ids].join(', ')] - else + if created_creative_set.nil? raise 'No creative set was created.' + else + puts ('Creative set with ID %d, master creative ID %d and companion ' + + 'creative IDs [%s] was created') % [created_creative_set[:id], + created_creative_set[:master_creative_id], + created_creative_set[:companion_creative_ids].join(', ')] end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_set() + master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i + companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i + create_creative_set(dfp, master_creative_id, companion_creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/creative_set_service/get_all_creative_sets.rb b/dfp_api/examples/v201802/creative_set_service/get_all_creative_sets.rb new file mode 100755 index 000000000..ae52f3239 --- /dev/null +++ b/dfp_api/examples/v201802/creative_set_service/get_all_creative_sets.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all creative sets. + +require 'dfp_api' + +def get_all_creative_sets(dfp) + creative_set_service = dfp.service(:CreativeSetService, API_VERSION) + + # Create a statement to select creative sets. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of creative sets at a time, paging + # through until all creative sets have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative set. + unless page[:results].nil? + page[:results].each_with_index do |creative_set, index| + puts '%d) Creative set with ID %d and name "%s" was found.' % + [index + statement.offset, creative_set[:id], creative_set[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative sets: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_creative_sets(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/creative_set_service/get_creative_sets_for_master_creative.rb b/dfp_api/examples/v201802/creative_set_service/get_creative_sets_for_master_creative.rb new file mode 100755 index 000000000..11e2a4fa2 --- /dev/null +++ b/dfp_api/examples/v201802/creative_set_service/get_creative_sets_for_master_creative.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all creative sets for a master creative. + +require 'dfp_api' + +def get_creative_sets_for_master_creative(dfp, master_creative_id) + creative_set_service = dfp.service(:CreativeSetService, API_VERSION) + + # Create a statement to select creative sets. + statement = dfp.new_statement_builder do |sb| + sb.where = 'masterCreativeId = :mater_creative_id' + sb.with_bind_variable('master_creative_id', master_creative_id) + end + + # Retrieve a small amount of creative sets at a time, paging + # through until all creative sets have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative set. + unless page[:results].nil? + page[:results].each_with_index do |creative_set, index| + puts '%d) Creative set with ID %d and name "%s" was found.' % + [index + statement.offset, creative_set[:id], creative_set[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative sets: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + master_creative_id = 'INSERT_MASTER_CREATIVE_ID_HERE'.to_i + get_creative_sets_for_master_creative(dfp, master_creative_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/creative_set_service/update_creative_sets.rb b/dfp_api/examples/v201802/creative_set_service/update_creative_sets.rb similarity index 59% rename from dfp_api/examples/v201705/creative_set_service/update_creative_sets.rb rename to dfp_api/examples/v201802/creative_set_service/update_creative_sets.rb index 592e639b3..379b9c396 100755 --- a/dfp_api/examples/v201705/creative_set_service/update_creative_sets.rb +++ b/dfp_api/examples/v201802/creative_set_service/update_creative_sets.rb @@ -21,64 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_creative_sets() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the IDs of the creative set to get and companion creative ID to add. - creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i - companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i - +def update_creative_sets(dfp, creative_set_id, companion_creative_id) # Get the CreativeSetService. creative_set_service = dfp.service(:CreativeSetService, API_VERSION) # Create a statement to only select a single creative set. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id' - [ - {:key => 'id', - :value => {:value => creative_set_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :creative_set_id' + sb.with_bind_variable('creative_set_id', creative_set_id) + end # Get creative sets by statement. - page = creative_set_service.get_creative_sets_by_statement( - statement.toStatement()) - - if page[:results] - creative_sets = page[:results] + response = creative_set_service.get_creative_sets_by_statement( + statement.to_statement() + ) + raise 'No creative sets found to update.' if response[:results].to_a.empty? + creative_set = response[:results].first - creative_sets.each do |creative_set| - # Update the creative set locally. - creative_set[:companion_creative_ids] << companion_creative_id - end + # Update the creative set locally. + creative_set[:companion_creative_ids] << companion_creative_id - # Update the creative set on the server. - return_creative_set = creative_set_service.update_creative_set(creative_set) + # Update the creative set on the server. + updated_creative_sets = creative_set_service.update_creative_set(creative_set) - if return_creative_set - puts ('Creative set ID: %d, master creative ID: %d was updated with ' + - 'companion creative IDs: [%s]') % - [creative_set[:id], - creative_set[:master_creative_id], - creative_set[:companion_creative_ids].join(', ')] - else - raise 'No creative sets were updated.' + if updated_creative_sets.to_a.size > 0 + updated_creative_sets.each do |creative_set| + puts ('Creative set with ID %d and master creative ID: %d was updated ' + + 'with companion creative IDs [%s].') % [creative_set[:id], + creative_set[:master_creative_id], + creative_set[:companion_creative_ids].join(', ')] end + else + puts 'No creative sets were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creative_sets() + creative_set_id = 'INSERT_CREATIVE_SET_ID_HERE'.to_i + companion_creative_id = 'INSERT_COMPANION_CREATIVE_ID_HERE'.to_i + update_creative_sets(dfp, creative_set_id, companion_creative_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/creative_template_service/get_all_creative_templates.rb b/dfp_api/examples/v201802/creative_template_service/get_all_creative_templates.rb new file mode 100755 index 000000000..77a72262f --- /dev/null +++ b/dfp_api/examples/v201802/creative_template_service/get_all_creative_templates.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all creative templates. +require 'dfp_api' + +def get_all_creative_templates(dfp) + creative_template_service = dfp.service(:CreativeTemplateService, API_VERSION) + + # Create a statement to select creative templates. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of creative templates at a time, paging + # through until all creative templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_template_service.get_creative_templates_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative template. + unless page[:results].nil? + page[:results].each_with_index do |creative_template, index| + puts '%d) Creative template with ID %d and name "%s" was found.' % + [index + statement.offset, creative_template[:id], + creative_template[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative templates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_creative_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/creative_template_service/get_system_defined_creative_templates.rb b/dfp_api/examples/v201802/creative_template_service/get_system_defined_creative_templates.rb new file mode 100755 index 000000000..195edcd29 --- /dev/null +++ b/dfp_api/examples/v201802/creative_template_service/get_system_defined_creative_templates.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all system defined creative templates. +require 'dfp_api' + +def get_system_defined_creative_templates(dfp) + creative_template_service = dfp.service(:CreativeTemplateService, API_VERSION) + + # Create a statement to select creative templates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'SYSTEM_DEFINED') + end + + # Retrieve a small amount of creative templates at a time, paging + # through until all creative templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_template_service.get_creative_templates_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative template. + unless page[:results].nil? + page[:results].each_with_index do |creative_template, index| + puts '%d) Creative template with ID %d and name "%s" was found.' % + [index + statement.offset, creative_template[:id], + creative_template[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative templates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_system_defined_creative_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/creative_wrapper_service/create_creative_wrappers.rb b/dfp_api/examples/v201802/creative_wrapper_service/create_creative_wrappers.rb similarity index 80% rename from dfp_api/examples/v201705/creative_wrapper_service/create_creative_wrappers.rb rename to dfp_api/examples/v201802/creative_wrapper_service/create_creative_wrappers.rb index 1d4d08b4a..8cf7d6466 100755 --- a/dfp_api/examples/v201705/creative_wrapper_service/create_creative_wrappers.rb +++ b/dfp_api/examples/v201802/creative_wrapper_service/create_creative_wrappers.rb @@ -24,48 +24,46 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_creative_wrappers(dfp, label_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the creative wrapper label ID. - label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i - # Create creative wrapper objects. creative_wrapper = { # A label can only be associated with one creative wrapper. :label_id => label_id, :ordering => 'INNER', - :header => {:html_snippet => 'My creative wrapper header'}, - :footer => {:html_snippet => 'My creative wrapper footer'} + :html_header => 'My creative wrapper header', + :html_footer => 'My creative wrapper footer' } # Create the creative wrapper on the server. return_creative_wrappers = creative_wrapper_service.create_creative_wrappers([creative_wrapper]) - if return_creative_wrappers + if return_creative_wrappers.to_a.size > 0 return_creative_wrappers.each do |creative_wrapper| - puts "Creative wrapper with ID: %d applying to label: %d was created." % - [creative_wrapper[:id], creative_wrapper[:label_id]] + puts ('Creative wrapper with ID %d applying to the label with ID %d ' + + 'was created.') % [creative_wrapper[:id], creative_wrapper[:label_id]] end else - raise 'No creative wrappers were created.' + puts 'No creative wrappers were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_creative_wrappers() + label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i + create_creative_wrappers(dfp, label_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/creative_wrapper_service/deactivate_creative_wrapper.rb b/dfp_api/examples/v201802/creative_wrapper_service/deactivate_creative_wrapper.rb similarity index 71% rename from dfp_api/examples/v201705/creative_wrapper_service/deactivate_creative_wrapper.rb rename to dfp_api/examples/v201802/creative_wrapper_service/deactivate_creative_wrapper.rb index ca398d85e..c42afc0e0 100755 --- a/dfp_api/examples/v201705/creative_wrapper_service/deactivate_creative_wrapper.rb +++ b/dfp_api/examples/v201802/creative_wrapper_service/deactivate_creative_wrapper.rb @@ -20,54 +20,37 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_creative_wrappers(dfp, label_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the ID of the label for the creative wrapper to deactivate. - label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i - # Create statement to select creative wrappers by label id and status. - statement = DfpApi::FilterStatement.new( - 'WHERE labelId = :label_id AND status = :status', - [ - { - :key => 'label_id', - :value => {:value => label_id, :xsi_type => 'NumberValue'} - }, - { - :key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'labelId = :label_id AND status = :status' + sb.with_bind_variable('label_id', label_id) + sb.with_bind_variable('status', 'ACTIVE') + end # Get creative wrappers by statement. page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + if page[:results].to_a.size > 0 page[:results].each do |creative_wrapper| - puts 'Creative wrapper ID: %d, label: %d will be deactivated.' % - [creative_wrapper[:id], creative_wrapper[:label_id]] + puts 'Creative wrapper with ID %d applying to the label with ID %d ' + + 'will be deactivated.' % [creative_wrapper[:id], + creative_wrapper[:label_id]] end # Perform action. result = creative_wrapper_service.perform_creative_wrapper_action( - {:xsi_type => 'DeactivateCreativeWrappers'}, statement.toStatement()) + {:xsi_type => 'DeactivateCreativeWrappers'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts 'Number of creative wrappers deactivated: %d' % result[:num_changes] else puts 'No creative wrappers were deactivated.' @@ -78,8 +61,18 @@ def deactivate_creative_wrappers() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_creative_wrappers() + label_id = 'INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE'.to_i + deactivate_creative_wrappers(dfp, label_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/creative_wrapper_service/get_active_creative_wrappers.rb b/dfp_api/examples/v201802/creative_wrapper_service/get_active_creative_wrappers.rb new file mode 100755 index 000000000..b781cecbd --- /dev/null +++ b/dfp_api/examples/v201802/creative_wrapper_service/get_active_creative_wrappers.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active creative wrappers. + +require 'dfp_api' + +def get_active_creative_wrappers(dfp) + creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) + + # Create a statement to select creative wrappers. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end + + # Retrieve a small amount of creative wrappers at a time, paging + # through until all creative wrappers have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative wrapper. + unless page[:results].nil? + page[:results].each_with_index do |creative_wrapper, index| + puts '%d) Creative wrapper with ID %d and label ID %d was found.' % + [index + statement.offset, creative_wrapper[:id], + creative_wrapper[:label_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative wrappers: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_creative_wrappers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/creative_wrapper_service/get_all_creative_wrappers.rb b/dfp_api/examples/v201802/creative_wrapper_service/get_all_creative_wrappers.rb new file mode 100755 index 000000000..c20d4a16c --- /dev/null +++ b/dfp_api/examples/v201802/creative_wrapper_service/get_all_creative_wrappers.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all creative wrappers. + +require 'dfp_api' + +def get_all_creative_wrappers(dfp) + # Get the CreativeWrapperService. + creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) + + # Create a statement to select creative wrappers. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of creative wrappers at a time, paging + # through until all creative wrappers have been retrieved. + page = {:total_result_set_size => 0} + begin + page = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) + + # Print out some information for each creative wrapper. + unless page[:results].nil? + page[:results].each_with_index do |creative_wrapper, index| + puts '%d) Creative wrapper with ID %d and label ID %d was found.' % + [index + statement.offset, creative_wrapper[:id], + creative_wrapper[:label_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of creative wrappers: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_creative_wrappers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/creative_wrapper_service/update_creative_wrappers.rb b/dfp_api/examples/v201802/creative_wrapper_service/update_creative_wrappers.rb similarity index 59% rename from dfp_api/examples/v201705/creative_wrapper_service/update_creative_wrappers.rb rename to dfp_api/examples/v201802/creative_wrapper_service/update_creative_wrappers.rb index b626a423b..4f4e612a0 100755 --- a/dfp_api/examples/v201705/creative_wrapper_service/update_creative_wrappers.rb +++ b/dfp_api/examples/v201802/creative_wrapper_service/update_creative_wrappers.rb @@ -21,65 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_creative_wrappers() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_creative_wrappers(dfp, creative_wrapper_id) # Get the CreativeWrapperService. creative_wrapper_service = dfp.service(:CreativeWrapperService, API_VERSION) - # Set the ID of the creative wrapper to get. - creative_wrapper_id = 'INSERT_CREATIVE_WRAPPER_ID_HERE'.to_i - # Create a statement to only select a single creative wrapper. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => creative_wrapper_id, :xsi_type => 'NumberValue'} - } - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :creative_wrapper_id' + sb.with_bind_variable('creative_wrapper_id', creative_wrapper_id) + sb.limit = 1 + end # Get creative wrappers by statement. - page = creative_wrapper_service.get_creative_wrappers_by_statement( - statement.toStatement()) - - if page[:results] - creative_wrappers = page[:results] + response = creative_wrapper_service.get_creative_wrappers_by_statement( + statement.to_statement() + ) + raise 'No creative wrapper found to update.' if response[:results].to_a.empty? + creative_wrapper = response[:results].first - creative_wrappers.each do |creative_wrapper| - # Update local creative wrapper object by changing its ordering. - creative_wrapper[:ordering] = 'OUTER' - end + # Update creative wrapper object by changing its ordering. + creative_wrapper[:ordering] = 'OUTER' - # Update the creative wrapper on the server. - return_creative_wrappers = - creative_wrapper_service.update_creative_wrappers([creative_wrapper]) + # Update the creative wrapper on the server. + updated_creative_wrappers = + creative_wrapper_service.update_creative_wrappers([creative_wrapper]) - if return_creative_wrappers - return_creative_wrappers.each do |creative_wrapper| - puts ("Creative wrapper ID: %d, label ID: %d was updated with order" + - " '%s'") % [creative_wrapper[:id], creative_wrapper[:label_id], - creative_wrapper[:ordering]] - end - else - puts 'No creative wrappers found to update.' + if updated_creative_wrappers.to_a.size > 0 + updated_creative_wrappers.each do |creative_wrapper| + puts ('Creative wrapper ID %d and label ID %d was updated with ordering' + + ' "%s"') % [creative_wrapper[:id], creative_wrapper[:label_id], + creative_wrapper[:ordering]] end + else + puts 'No creative wrappers found to update.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_creative_wrappers() + creative_wrapper_id = 'INSERT_CREATIVE_WRAPPER_ID_HERE'.to_i + update_creative_wrappers(dfp, creative_wrapper_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_field_service/create_custom_field_options.rb b/dfp_api/examples/v201802/custom_field_service/create_custom_field_options.rb similarity index 81% rename from dfp_api/examples/v201705/custom_field_service/create_custom_field_options.rb rename to dfp_api/examples/v201802/custom_field_service/create_custom_field_options.rb index 7f9b01c1e..bdb9997a0 100755 --- a/dfp_api/examples/v201705/custom_field_service/create_custom_field_options.rb +++ b/dfp_api/examples/v201802/custom_field_service/create_custom_field_options.rb @@ -23,22 +23,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_custom_field_options() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_field_options(dfp, custom_field_id) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Set the ID of the drop-down custom field to create options for. - custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i - # Create local custom field options. custom_field_options = [ { @@ -52,18 +40,31 @@ def create_custom_field_options() ] # Create the custom field options on the server. - return_custom_field_options = + created_custom_field_options = custom_field_service.create_custom_field_options(custom_field_options) - return_custom_field_options.each do |option| - puts "Custom field option with ID: %d and name: '%s' was created." % - [option[:id], option[:display_name]] - end + if created_custom_field_options.to_a.size > 0 + created_custom_field_options.each do |option| + puts 'Custom field option with ID %d and name "%s" was created.' % + [option[:id], option[:display_name]] + end + else + puts 'No custom field options were created.' end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_field_options() + custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i + create_custom_field_options(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_field_service/create_custom_fields.rb b/dfp_api/examples/v201802/custom_field_service/create_custom_fields.rb similarity index 85% rename from dfp_api/examples/v201705/custom_field_service/create_custom_fields.rb rename to dfp_api/examples/v201802/custom_field_service/create_custom_fields.rb index 19cdb9467..552840dcf 100755 --- a/dfp_api/examples/v201705/custom_field_service/create_custom_fields.rb +++ b/dfp_api/examples/v201802/custom_field_service/create_custom_fields.rb @@ -21,16 +21,7 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_fields(dfp) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) @@ -51,18 +42,31 @@ def create_custom_fields() ] # Create the custom fields on the server. - return_custom_fields = + created_custom_fields = custom_field_service.create_custom_fields(custom_fields) - return_custom_fields.each do |custom_field| - puts "Custom field with ID: %d and name: %s was created." % - [custom_field[:id], custom_field[:name]] + if created_custom_fields.to_a.size > 0 + created_custom_fields.each do |custom_field| + puts 'Custom field with ID %d and name "%s" was created.' % + [custom_field[:id], custom_field[:name]] + end + else + puts 'No custom fields were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_fields() + create_custom_fields(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_field_service/deactivate_all_line_item_custom_fields.rb b/dfp_api/examples/v201802/custom_field_service/deactivate_all_line_item_custom_fields.rb similarity index 74% rename from dfp_api/examples/v201705/custom_field_service/deactivate_all_line_item_custom_fields.rb rename to dfp_api/examples/v201802/custom_field_service/deactivate_all_line_item_custom_fields.rb index 43fd96775..36775575e 100755 --- a/dfp_api/examples/v201705/custom_field_service/deactivate_all_line_item_custom_fields.rb +++ b/dfp_api/examples/v201802/custom_field_service/deactivate_all_line_item_custom_fields.rb @@ -21,54 +21,46 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_all_line_item_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_all_line_item_custom_fields(dfp) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) # Create statement text to select active ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE entityType = :entity_type AND isActive = :is_active', - [ - {:key => 'entity_type', - :value => {:value => 'LINE_ITEM', :xsi_type => 'TextValue'}}, - {:key => 'is_active', - :value => {:value => true, :xsi_type => 'BooleanValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'entityType = :entity_type AND isActive = :is_active' + sb.with_bind_variable('entity_type', 'LINE_ITEM') + sb.with_bind_variable('is_active', true) + end begin # Get custom fields by statement. page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |custom_field, index| - puts "%d) Custom field with ID: %d and name: '%s' will be deactivated" % + puts '%d) Custom field with ID %d and name "%s" will be deactivated.' % [index + statement.offset, custom_field[:id], custom_field[:name]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Update statement for action. - statement.toStatementForAction() + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_field_service.perform_custom_field_action( - {:xsi_type => 'DeactivateCustomFields'}, statement.toStatement()) + {:xsi_type => 'DeactivateCustomFields'}, statement.to_statement()) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of custom fields deactivated: %d" % result[:num_changes] else puts 'No custom fields were deactivated.' @@ -76,8 +68,17 @@ def deactivate_all_line_item_custom_fields() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_all_line_item_custom_fields() + deactivate_all_line_item_custom_fields(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/custom_field_service/deactivate_custom_field.rb b/dfp_api/examples/v201802/custom_field_service/deactivate_custom_field.rb new file mode 100755 index 000000000..d0cffab1a --- /dev/null +++ b/dfp_api/examples/v201802/custom_field_service/deactivate_custom_field.rb @@ -0,0 +1,76 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example deactivates a custom field. To determine which custom fields +# exist, run get_all_custom_fields.rb. + +require 'dfp_api' + +def deactivate_custom_field(dfp, custom_field_id) + # Get the CustomFieldService. + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) + + # Create statement to select the custom field. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + end + + # Deactivate the custom field on the server. + result = custom_field_service.perform_custom_field_action( + {:xsi_type => 'DeactivateCustomFields'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of custom fields deactivated: %d" % result[:num_changes] + else + puts 'No custom fields were deactivated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + custom_field_id = 'INSERT_custom_field_id'.to_i + deactivate_custom_field(dfp, custom_field_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/custom_field_service/get_all_custom_fields.rb b/dfp_api/examples/v201802/custom_field_service/get_all_custom_fields.rb new file mode 100755 index 000000000..adebfcfa7 --- /dev/null +++ b/dfp_api/examples/v201802/custom_field_service/get_all_custom_fields.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all custom fields. + +require 'dfp_api' + +def get_all_custom_fields(dfp) + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) + + # Create a statement to select custom fields. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of custom fields at a time, paging + # through until all custom fields have been retrieved. + page = {:total_result_set_size => 0} + begin + page = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) + + # Print out some information for each custom field. + unless page[:results].nil? + page[:results].each_with_index do |custom_field, index| + puts '%d) Custom field with ID %d and name "%s" was found.' % + [index + statement.offset, custom_field[:id], custom_field[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of custom fields: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_custom_fields(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/custom_field_service/get_custom_fields_for_line_items.rb b/dfp_api/examples/v201802/custom_field_service/get_custom_fields_for_line_items.rb new file mode 100755 index 000000000..7d5b0c765 --- /dev/null +++ b/dfp_api/examples/v201802/custom_field_service/get_custom_fields_for_line_items.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all custom fields that can be applied to line items. + +require 'dfp_api' + +def get_custom_fields_for_line_items(dfp) + custom_field_service = dfp.service(:CustomFieldService, API_VERSION) + + # Create a statement to select custom fields. + statement = dfp.new_statement_builder do |sb| + sb.where = 'entityType = :entity_type' + sb.with_bind_variable('entity_type', 'LINE_ITEM') + end + + # Retrieve a small amount of custom fields at a time, paging + # through until all custom fields have been retrieved. + page = {:total_result_set_size => 0} + begin + page = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) + + # Print out some information for each custom field. + unless page[:results].nil? + page[:results].each_with_index do |custom_field, index| + puts '%d) Custom field with ID %d and name "%s" was found.' % + [index + statement.offset, custom_field[:id], custom_field[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of custom fields: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_custom_fields_for_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/custom_field_service/set_line_item_custom_field_value.rb b/dfp_api/examples/v201802/custom_field_service/set_line_item_custom_field_value.rb similarity index 59% rename from dfp_api/examples/v201705/custom_field_service/set_line_item_custom_field_value.rb rename to dfp_api/examples/v201802/custom_field_service/set_line_item_custom_field_value.rb index 843b1c295..44a06dbb9 100755 --- a/dfp_api/examples/v201705/custom_field_service/set_line_item_custom_field_value.rb +++ b/dfp_api/examples/v201802/custom_field_service/set_line_item_custom_field_value.rb @@ -23,86 +23,67 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def set_line_item_custom_field_value() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the CustomFieldService. +def set_line_item_custom_field_value(dfp, custom_field_id, + drop_down_custom_field_id, custom_field_option_id, line_item_id) + # Get the CustomFieldService and LineItemService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - - # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the custom fields, custom field option, and line item. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - drop_down_custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i - custom_field_option_id = 'INSERT_CUSTOM_FIELD_OPTION_ID_HERE'.to_i - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create a statement to only select a single custom field. - custom_field_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => custom_field_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + custom_field_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + sb.limit = 1 + end # Create a statement to only select a single drop down custom field. - drop_down_custom_field_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => drop_down_custom_field_id, - :xsi_type => 'NumberValue'}} - ], - 1 - ) + drop_down_custom_field_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :drop_down_custom_field_id' + sb.with_bind_variable( + 'drop_down_custom_field_id', drop_down_custom_field_id + ) + sb.limit = 1 + end # Create a statement to only select a single line item. - line_item_statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + line_item_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.limit = 1 + end # Get custom fields by statement. custom_fields_page = custom_field_service.get_custom_fields_by_statement( - custom_field_statement.toStatement()) + custom_field_statement.to_statement() + ) # Get drop down custom fields by statement. - drop_down_custom_fields_page = ( + drop_down_custom_fields_page = custom_field_service.get_custom_fields_by_statement( - drop_down_custom_field_statement.toStatement())) + drop_down_custom_field_statement.to_statement() + ) # Get line items by statement. line_items_page = line_item_service.get_line_items_by_statement( - line_item_statement.toStatement()) + line_item_statement.to_statement() + ) # Get singular custom field. - if custom_field_page[:results] + if custom_field_page[:results].to_a.size > 0 custom_field = custom_fields_page[:results].first + end # Get singular drop down custom field. - if drop_down_custom_field_page[:results] + if drop_down_custom_field_page[:results].to_a.size > 0 drop_down_custom_field = drop_down_custom_fields_page[:results].first + end # Get singular line item. - if line_item_page[:results] + if line_item_page[:results].to_a.size > 0 line_item = line_items_page[:results].first + end - if custom_field and drop_down_custom_field and line_item + if !custom_field.nil? && !drop_down_custom_field.nil? && !line_item.nil? # Create custom field values. custom_field_value = { :custom_field_id => custom_field[:id], @@ -117,48 +98,64 @@ def set_line_item_custom_field_value() } custom_field_values = [custom_field_value, drop_down_custom_field_value] - old_custom_field_values = line_item.include?(:custom_field_values) ? - line_item[:custom_field_values] : [] + old_custom_field_values = line_item[:custom_field_values] || [] # Only add existing custom field values for different custom fields than the # ones you are setting. old_custom_field_values.each do |old_custom_field_value| - unless custom_field_values.map {|value| value[:id]}.include?( - old_custom_field_value[:custom_field_id]) - custom_field_values << old_custom_field_value - end + custom_field_value_ids = custom_field_values.map {|value| value[:id]} + value_already_present = custom_field_value_ids.include?( + old_custom_field_value[:custom_field_id] + ) + custom_field_values << old_custom_field_value unless value_already_present end line_item[:custom_field_values] = custom_field_values # Update the line item on the server. - return_line_items = line_item_service.update_line_items([line_item]) + updated_line_items = line_item_service.update_line_items([line_item]) - return_line_items.each do |return_line_item| + # Display the results. + updated_line_items.each do |line_item| custom_field_value_strings = [] - if return_line_item.include?(:custom_field_values) - return_line_item[:custom_field_values].each do |value| - if value[:base_custom_field_value_type].eql?('CustomFieldValue') - custom_field_value_strings << "{ID: %d, value: '%s'}" % + if line_item.include?(:custom_field_values) + line_item[:custom_field_values].each do |value| + if value[:base_custom_field_value_type] == 'CustomFieldValue' + custom_field_value_strings << '{ID: %d, value: "%s"}' % [value[:custom_field_id], value[:value][:value]] end - if value[:base_custom_field_value_type].eql?( - 'DropDownCustomFieldValue') + if value[:base_custom_field_value_type] == 'DropDownCustomFieldValue' custom_field_value_strings << - "{ID: %d, custom field option ID: %d}" % + '{ID: %d, custom field option ID: %d}' % [value[:custom_field_id], value[:custom_field_option_id]] end end end - puts "Line item ID %d set with custom field values: [%s]" % + puts 'Line item ID %d set with custom field values [%s].' % [return_line_item[:id], custom_field_value_strings.join(', ')] end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - set_line_item_custom_field_value() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + drop_down_custom_field_id = 'INSERT_DROP_DOWN_CUSTOM_FIELD_ID_HERE'.to_i + custom_field_option_id = 'INSERT_CUSTOM_FIELD_OPTION_ID_HERE'.to_i + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + set_line_item_custom_field_value( + dfp, custom_field_id, drop_down_custom_field_id, + custom_field_option_id, line_item_id + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_field_service/update_custom_fields.rb b/dfp_api/examples/v201802/custom_field_service/update_custom_fields.rb similarity index 60% rename from dfp_api/examples/v201705/custom_field_service/update_custom_fields.rb rename to dfp_api/examples/v201802/custom_field_service/update_custom_fields.rb index 9db982683..259f867e6 100755 --- a/dfp_api/examples/v201705/custom_field_service/update_custom_fields.rb +++ b/dfp_api/examples/v201802/custom_field_service/update_custom_fields.rb @@ -21,64 +21,55 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_fields(dfp, custom_field_id) # Get the CustomFieldService. custom_field_service = dfp.service(:CustomFieldService, API_VERSION) - # Set the ID of the custom field to update. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - # Create a statement to only select a single custom field. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => {:value => custom_field_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :custom_field_id' + sb.with_bind_variable('custom_field_id', custom_field_id) + sb.limit = 1 + end # Get custom fields by statement. - page = custom_field_service.get_custom_fields_by_statement( - statement.toStatement()) - - if page[:results] - custom_fields = page[:results] + response = custom_field_service.get_custom_fields_by_statement( + statement.to_statement() + ) + raise 'No custom fields found to update.' if response[:results].to_a.empty? + custom_field = response[:results].first - custom_fields.each do |custom_field| - # Update local custom field object. - custom_field[:description] = '' if custom_field[:description].nil? - custom_field[:description] +=' Updated.' + # Update custom field object. + custom_field[:description] ||= '' + custom_field[:description] += ' Updated.' - # Update the custom field on the server. - return_custom_fields = - custom_field_service.update_custom_fields([custom_field]) + # Update the custom field on the server. + updated_custom_fields = + custom_field_service.update_custom_fields([custom_field]) - return_custom_fields.each do |custom_field| - puts "Custom field ID: " + - "%d, name: '%s' and description '%s' was updated." % [ - custom_field[:id], custom_field[:name], - custom_field[:description]] - end - else - puts 'No custom fields were found to update.' + if updated_custom_fields.to_a.size > 0 + updated_custom_fields.each do |custom_field| + puts 'Custom field ID %d, name "%s", and description "%s" was updated.' % + [custom_field[:id], custom_field[:name], custom_field[:description]] end + else + puts 'No custom fields were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_fields() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + update_custom_fields(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_targeting_service/create_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201802/custom_targeting_service/create_custom_targeting_keys_and_values.rb similarity index 60% rename from dfp_api/examples/v201705/custom_targeting_service/create_custom_targeting_keys_and_values.rb rename to dfp_api/examples/v201802/custom_targeting_service/create_custom_targeting_keys_and_values.rb index 013a8209d..2699abdb1 100755 --- a/dfp_api/examples/v201705/custom_targeting_service/create_custom_targeting_keys_and_values.rb +++ b/dfp_api/examples/v201802/custom_targeting_service/create_custom_targeting_keys_and_values.rb @@ -23,16 +23,7 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_custom_targeting_keys_and_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_custom_targeting_keys_and_values(dfp) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) @@ -40,71 +31,88 @@ def create_custom_targeting_keys_and_values() gender_key = {:display_name => 'gender', :name => 'g', :type => 'PREDEFINED'} # Create free-form key. - car_model_key = {:display_name => 'car model', :name => 'c', - :type => 'FREEFORM'} + car_model_key = { + :display_name => 'car model', + :name => 'c', + :type => 'FREEFORM' + } # Create predefined key that may be used for content targeting. - genre_key = {:display_name => 'genre', :name => 'genre', - :type => 'PREDEFINED'} + genre_key = { + :display_name => 'genre', + :name => 'genre', + :type => 'PREDEFINED' + } # Create the custom targeting keys on the server. - return_keys = custom_targeting_service.create_custom_targeting_keys( - [gender_key, car_model_key, genre_key]) - - if return_keys - return_keys.each do |key| - puts ("Custom targeting key ID: %d, name: %s and display name: %s" + - " was created.") % [key[:id], key[:name], key[:display_name]] + created_keys = custom_targeting_service.create_custom_targeting_keys( + [gender_key, car_model_key, genre_key] + ) + + if created_keys.to_a.size > 0 + created_keys.each do |key| + puts ('Custom targeting key ID %d, name "%s" and display name "%s"' + + ' was created.') % [key[:id], key[:name], key[:display_name]] end else raise 'No keys were created.' end # Create custom targeting value for the predefined gender key. - gender_male_value = {:custom_targeting_key_id => return_keys[0][:id], - :display_name => 'male', :match_type => 'EXACT'} + gender_male_value = { + :custom_targeting_key_id => created_keys[0][:id], + :display_name => 'male', + :match_type => 'EXACT' + } + # Name is set to 1 so that the actual name can be hidden from website users. gender_male_value[:name] = '1' # Create another custom targeting value for the same key. - gender_female_value = {:custom_targeting_key_id => return_keys[0][:id], - :display_name => 'female', :name => '2', :match_type => 'EXACT'} + gender_female_value = { + :custom_targeting_key_id => created_keys[0][:id], + :display_name => 'female', + :name => '2', + :match_type => 'EXACT' + } # Create custom targeting value for the free-form age key. These are values # that would be suggested in the UI or can be used when targeting # with a free-form custom criterion. car_model_honda_civic_value = { - :custom_targeting_key_id => return_keys[1][:id], - :display_name => 'honda civic', - :name => 'honda civic', - # Setting match type to exact will match exactly "honda civic". - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[1][:id], + :display_name => 'honda civic', + :name => 'honda civic', + # Setting match type to exact will match exactly "honda civic". + :match_type => 'EXACT' } # Create custom targeting values for the predefined genre key. genre_comedy_value = { - :custom_targeting_key_id => return_keys[2][:id], - :display_name => 'comedy', - :name => 'comedy', - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[2][:id], + :display_name => 'comedy', + :name => 'comedy', + :match_type => 'EXACT' } genre_drama_value = { - :custom_targeting_key_id => return_keys[2][:id], - :display_name => 'drama', - :name => 'drama', - :match_type => 'EXACT' + :custom_targeting_key_id => created_keys[2][:id], + :display_name => 'drama', + :name => 'drama', + :match_type => 'EXACT' } # Create the custom targeting values on the server. - return_values = custom_targeting_service.create_custom_targeting_values( - [gender_male_value, gender_female_value, car_model_honda_civic_value, - genre_comedy_value, genre_drama_value]) - - if return_values - return_values.each do |value| - puts ("A custom targeting value ID: %d, name: %s and display name: %s" + - " was created for key ID: %d.") % [value[:id], value[:name], + custom_targeting_values = [gender_male_value, gender_female_value, + car_model_honda_civic_value, genre_comedy_value, genre_drama_value] + created_values = custom_targeting_service.create_custom_targeting_values( + custom_targeting_values + ) + + if created_values.to_a.size > 0 + created_values.each do |value| + puts ('A custom targeting value ID %d, name "%s" and display name "%s"' + + ' was created for key ID %d.') % [value[:id], value[:name], value[:display_name], value[:custom_targeting_key_id]] end else @@ -114,8 +122,17 @@ def create_custom_targeting_keys_and_values() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_custom_targeting_keys_and_values() + create_custom_targeting_keys_and_values(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_keys.rb b/dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_keys.rb similarity index 71% rename from dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_keys.rb rename to dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_keys.rb index d886fbf6b..ba392fb78 100755 --- a/dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_keys.rb +++ b/dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_keys.rb @@ -21,69 +21,57 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def delete_custom_targeting_keys() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_custom_targeting_keys(dfp, custom_targeting_key_name) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set the name of the custom targeting key to delete. - custom_targeting_key_name = 'INSERT_CUSTOM_TARGETING_KEY_NAME_HERE' - - # Define initial values. custom_target_key_ids = [] # Create statement to only select custom targeting key by the given name. - statement = DfpApi::FilterStatement.new( - 'WHERE name = :name', - [ - {:key => 'name', - :value => {:value => custom_targeting_key_name, - :xsi_type => 'TextValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'name = :name' + sb.with_bind_variable('name', custom_targeting_key_name) + end + page = {:total_result_set_size => 0} begin page = custom_targeting_service.get_custom_targeting_keys_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |key| # Add key ID to the list for deletion. custom_target_key_ids << key[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer. - puts "Number of custom targeting keys to be deleted: %d" % + puts 'Number of custom targeting keys to be deleted: %d' % custom_target_key_ids.size if !(custom_target_key_ids.empty?) # Modify statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % - [custom_target_key_ids.join(', ')] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % custom_target_key_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_targeting_service.perform_custom_targeting_key_action( - {:xsi_type => 'DeleteCustomTargetingKeys'}, statement.toStatement()) + {:xsi_type => 'DeleteCustomTargetingKeys'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of custom targeting keys deleted: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of custom targeting keys deleted: %d' % result[:num_changes] else puts 'No custom targeting keys were deleted.' end @@ -91,8 +79,18 @@ def delete_custom_targeting_keys() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_custom_targeting_keys() + custom_targeting_key_name = 'INSERT_CUSTOM_TARGETING_KEY_NAME_HERE' + delete_custom_targeting_keys(dfp, custom_targeting_key_name) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_values.rb b/dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_values.rb similarity index 69% rename from dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_values.rb rename to dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_values.rb index b4e64d5b3..e34046417 100755 --- a/dfp_api/examples/v201705/custom_targeting_service/delete_custom_targeting_values.rb +++ b/dfp_api/examples/v201802/custom_targeting_service/delete_custom_targeting_values.rb @@ -22,77 +22,61 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def delete_custom_targeting_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_custom_targeting_values(dfp, custom_targeting_key_id) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set ID of the custom targeting key to delete values from. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - # Define initial values. custom_target_value_ids = [] # Create statement to only select custom values by the given custom targeting # key ID. - statement = DfpApi::FilterStatement.new( - 'WHERE customTargetingKeyId = :key_id', - [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'customTargetingKeyId = :key_id' + sb.with_bind_variable('key_id', custom_targeting_key_id) + end + page = {:total_result_set_size => 0} begin # Get custom targeting values by statement. page = custom_targeting_service.get_custom_targeting_values_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? # Increase query offset by page size. page[:results].each do |value| # Add value ID to the list for deletion. custom_target_value_ids << value[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] # Print a footer. - puts "Number of custom targeting value to be deleted: %d" % + puts 'Number of custom targeting value to be deleted: %d' % custom_target_value_ids.size if !(custom_target_value_ids.empty?) # Modify statement for action, note, values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE customTargetingKeyId = :key_id AND id IN (%s)" % - [custom_target_value_ids.join(', ')], - [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement.configure do |sb| + sb.where = 'customTargetingKeyId = :key_id AND id IN (%s)' % + custom_target_value_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = custom_targeting_service.perform_custom_targeting_value_action( - {:xsi_type => 'DeleteCustomTargetingValues'}, statement.toStatement()) + {:xsi_type => 'DeleteCustomTargetingValues'}, + statement.to_statement() + ) - # Display results. - if result and result[:num_changes] > 0 - puts "Number of custom targeting values deleted: %d" % + # Display the results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of custom targeting values deleted: %d' % result[:num_changes] else puts 'No custom targeting values were deleted.' @@ -101,8 +85,18 @@ def delete_custom_targeting_values() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_custom_targeting_values() + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + delete_custom_targeting_values(dfp, custom_targeting_key_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201802/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb new file mode 100755 index 000000000..b376688fb --- /dev/null +++ b/dfp_api/examples/v201802/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb @@ -0,0 +1,124 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all custom targeting keys and values. To create custom +# targeting keys can values, run create_custom_targeting_keys_and_values.rb. + +require 'dfp_api' + +def get_all_custom_targeting_keys_and_values(dfp) + # Get the CustomTargetingService. + custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) + + # Create a statement to get all custom targeting keys. + key_statement = dfp.new_statement_builder() + + # Retrieve a small number of custom targeting keys at a time, paging through + # until all custom targeting keys have been retrieved, and store their ids. + custom_targeting_key_ids = [] + page = {:total_result_set_size => 0} + begin + # Get custom targeting keys by statement. + page = custom_targeting_service.get_custom_targeting_keys_by_statement( + key_statement.to_statement() + ) + + # Display some information about each custom targeting key. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_key, index| + custom_targeting_key_ids << custom_targeting_key[:id] + puts ("%d) Custom targeting key with ID %d, name '%s', and display " + + "name '%s' was found.") % [key_statement.offset + index, + custom_targeting_key[:id], custom_targeting_key[:name], + custom_targeting_key[:display_name]] + end + end + key_statement.offset += key_statement.limit + end while key_statement.offset < page[:total_result_set_size] + + # Create a statement to get all custom targeting values for each key. + value_statement = dfp.new_statement_builder do |sb| + sb.where = "customTargetingKeyId = :customTargetingKeyId" + end + + # Get all custom targeting values for each custom targeting key. + total_result_count = 0 + custom_targeting_key_ids.each do |key_id| + value_statement.configure do |sb| + sb.with_bind_variable("customTargetingKeyId", key_id) + sb.offset = 0 + end + + # Retrieve a small number of custom targeting values at a time, paging + # through until all custom targeting values have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get custom targeting values by statement. + page = custom_targeting_service.get_custom_targeting_values_by_statement( + value_statement.to_statement() + ) + + # Display some information about each custom targeting value. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_value, index| + puts ("%d) Custom targeting value with ID %d, name '%s', and " + + "display name '%s', belonging to key with ID %d, was found.") % + [value_statement.offset + index, custom_targeting_value[:id], + custom_targeting_value[:name], + custom_targeting_value[:display_name], + custom_targeting_value[:custom_targeting_key_id]] + end + end + value_statement.offset += value_statement.limit + end while value_statement.offset < page[:total_result_set_size] + + total_result_count += page[:total_result_set_size] + end + + puts "Total number of custom targeting values found: %d" % total_result_count +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_custom_targeting_keys_and_values(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb b/dfp_api/examples/v201802/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb new file mode 100755 index 000000000..668412045 --- /dev/null +++ b/dfp_api/examples/v201802/custom_targeting_service/get_predefined_custom_targeting_keys_and_values.rb @@ -0,0 +1,128 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all predefined custom targeting keys and values. To create +# custom targeting keys can values, run +# create_custom_targeting_keys_and_values.rb. + +require 'dfp_api' + +def get_predefined_custom_targeting_keys_and_values(dfp) + # Get the CustomTargetingService. + custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) + + # Create a statement to get all custom targeting keys. + key_statement = dfp.new_statement_builder do |sb| + sb.where = "type = :type" + sb.with_bind_variable("type", "PREDEFINED") + end + + # Retrieve a small number of custom targeting keys at a time, paging through + # until all custom targeting keys have been retrieved, and store their ids. + custom_targeting_key_ids = [] + page = {:total_result_set_size => 0} + begin + # Get custom targeting keys by statement. + page = custom_targeting_service.get_custom_targeting_keys_by_statement( + key_statement.to_statement() + ) + + # Display some information about each custom targeting key. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_key, index| + custom_targeting_key_ids << custom_targeting_key[:id] + puts ("%d) Custom targeting key with ID %d, name '%s', and display " + + "name '%s' was found.") % [key_statement.offset + index, + custom_targeting_key[:id], custom_targeting_key[:name], + custom_targeting_key[:display_name]] + end + end + key_statement.offset += key_statement.limit + end while key_statement.offset < page[:total_result_set_size] + + # Create a statement to get all custom targeting values for each key. + value_statement = dfp.new_statement_builder do |sb| + sb.where = "customTargetingKeyId = :custom_targeting_key_id" + end + + # Get all custom targeting values for each custom targeting key. + total_result_count = 0 + custom_targeting_key_ids.each do |key_id| + value_statement.configure do |sb| + sb.with_bind_variable("custom_targeting_key_id", key_id) + sb.offset = 0 + end + + # Retrieve a small number of custom targeting values at a time, paging + # through until all custom targeting values have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get custom targeting values by statement. + page = custom_targeting_service.get_custom_targeting_values_by_statement( + value_statement.to_statement() + ) + + # Display some information about each custom targeting value. + unless page[:results].nil? + page[:results].each_with_index do |custom_targeting_value, index| + puts ("%d) Custom targeting value with ID %d, name '%s', and " + + "display name '%s', belonging to key with ID %d, was found.") % + [value_statement.offset + index, custom_targeting_value[:id], + custom_targeting_value[:name], + custom_targeting_value[:display_name], + custom_targeting_value[:custom_targeting_key_id]] + end + end + value_statement.offset += value_statement.limit + end while value_statement.offset < page[:total_result_set_size] + + total_result_count += page[:total_result_set_size] + end + + puts "Total number of custom targeting values found: %d" % total_result_count +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_predefined_custom_targeting_keys_and_values(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_keys.rb b/dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_keys.rb similarity index 81% rename from dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_keys.rb rename to dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_keys.rb index f140099c4..c23a67a5f 100755 --- a/dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_keys.rb +++ b/dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_keys.rb @@ -22,29 +22,22 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_custom_targeting_keys() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_targeting_keys(dfp) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) # Create a statement to get all custom targeting keys. - statement = DfpApi::FilterStatement.new('ORDER BY id ASC') + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end # Get custom targeting keys by statement. page = custom_targeting_service.get_custom_targeting_keys_by_statement( - statement) + statement.to_statement() + ) keys = page[:results] - raise 'No targeting keys found to update' if !keys || keys.empty? + raise 'No targeting keys found to update' if keys.to_a.empty? # Update each local custom targeting key object by changing its display name. keys.each do |key| @@ -53,13 +46,13 @@ def update_custom_targeting_keys() end # Update the custom targeting keys on the server. - result_keys = custom_targeting_service.update_custom_targeting_keys(keys) + updated_keys = custom_targeting_service.update_custom_targeting_keys(keys) - if result_keys + if updated_keys.to_a.size > 0 # Print details about each key in results. - result_keys.each_with_index do |custom_targeting_key, index| - puts ("%d) Custom targeting key with ID [%d], name: %s," + - " displayName: %s type: %s was updated") % [index, + updated_keys.each_with_index do |custom_targeting_key, index| + puts ('%d) Custom targeting key with ID %d, name "%s", ' + + 'displayName "%s", and type "%s" was updated') % [index, custom_targeting_key[:id], custom_targeting_key[:name], custom_targeting_key[:display_name], custom_targeting_key[:type]] end @@ -69,8 +62,17 @@ def update_custom_targeting_keys() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_targeting_keys() + update_custom_targeting_keys(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_values.rb b/dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_values.rb similarity index 65% rename from dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_values.rb rename to dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_values.rb index 9251f0ef4..e465336c3 100755 --- a/dfp_api/examples/v201705/custom_targeting_service/update_custom_targeting_values.rb +++ b/dfp_api/examples/v201802/custom_targeting_service/update_custom_targeting_values.rb @@ -22,70 +22,66 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_custom_targeting_values() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_custom_targeting_values(dfp, custom_targeting_key_id) # Get the CustomTargetingService. custom_targeting_service = dfp.service(:CustomTargetingService, API_VERSION) - # Set the ID of the custom targeting key to get custom targeting values for. - custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i - # Create a statement to get first 500 custom targeting keys. - statement = DfpApi::FilterStatement.new( - :query => 'WHERE customTargetingKeyId = :key_id', - :values => [ - {:key => 'key_id', - :value => {:value => custom_targeting_key_id, - :xsi_type => 'NumberValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'customTargetingKeyId = :key_id' + sb.with_bind_variable('key_id', custom_targeting_key_id) + end + page = {:total_result_set_size => 0} begin # Get custom targeting keys by statement. page = custom_targeting_service.get_custom_targeting_values_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] - # Update each local custom targeting values object by changing its display - # name. - page[:results].each do |value| + unless page[:results].nil? + # Update each custom targeting values object by changing its display name. + values = page[:results] + values.each do |value| display_name = (value[:display_name].nil?) ? value[:name] : value[:display_name] value[:display_name] = display_name + ' (Deprecated)' end # Update the custom targeting keys on the server. - result_values = custom_targeting_service.update_custom_targeting_values( - values) + updated_values = custom_targeting_service.update_custom_targeting_values( + values + ) - if result_values + unless updated_values.nil? # Print details about each value in results. - result_values.each_with_index do |custom_targeting_value, index| - puts ("%d) Custom targeting key with ID [%d], name: %s," + - " displayName: %s was updated") % [ - index + statement.offset, custom_targeting_value[:id], - custom_targeting_value[:name], - custom_targeting_value[:display_name]] + updated_values.each_with_index do |custom_targeting_value, index| + puts ('%d) Custom targeting key with ID %d, name "%s", and display ' + + 'name "%s" was updated.') % [index + statement.offset, + custom_targeting_value[:id], custom_targeting_value[:name], + custom_targeting_value[:display_name]] end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_custom_targeting_values() + custom_targeting_key_id = 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + update_custom_targeting_values(dfp, custom_targeting_key_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/exchange_rate_service/create_exchange_rate.rb b/dfp_api/examples/v201802/exchange_rate_service/create_exchange_rate.rb new file mode 100755 index 000000000..7b2ba10da --- /dev/null +++ b/dfp_api/examples/v201802/exchange_rate_service/create_exchange_rate.rb @@ -0,0 +1,78 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates an exchange rate. + +require 'dfp_api' + +def create_exchange_rate(dfp) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a configuration object for a fixed exchange rate with currency code + # 'AUD', with direction FROM_NETWORK and a value of 1.5. + exchange_rate = { + :currency_code => 'AUD', + :direction => 'FROM_NETWORK', + :exchange_rate => 15_000_000_000, + :refresh_rate => 'FIXED' + } + + # Create the exchange rate on the server. + created_exchange_rates = exchange_rate_service.create_exchange_rates([ + exchange_rate + ]) + + # Display the results. + created_exchange_rates.each do |exchange_rate| + puts ('Created an exchange rate with ID %d, currency code %s, direction ' + + '%s, and exchange rate %.2f.') % [exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + (exchange_rate[:exchange_rate] / 10_000_000_000.0)] + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + create_exchange_rate(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/exchange_rate_service/get_all_exchange_rates.rb b/dfp_api/examples/v201802/exchange_rate_service/get_all_exchange_rates.rb new file mode 100755 index 000000000..626ede041 --- /dev/null +++ b/dfp_api/examples/v201802/exchange_rate_service/get_all_exchange_rates.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all exchange rates. + +require 'dfp_api' + +def get_all_exchange_rates(dfp) + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a statement to select exchange rates. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of exchange rates at a time, paging + # through until all exchange rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) + + # Print out some information for each exchange rate. + unless page[:results].nil? + page[:results].each_with_index do |exchange_rate, index| + puts ('%d) Exchange rate with ID %d, currency code "%s", direction ' + + '"%s", and exchange rate %d was found.') % + [index + statement.offset, exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + exchange_rate[:exchange_rate]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of exchange rates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_exchange_rates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/exchange_rate_service/get_exchange_rates_for_currency_code.rb b/dfp_api/examples/v201802/exchange_rate_service/get_exchange_rates_for_currency_code.rb new file mode 100755 index 000000000..d91af0221 --- /dev/null +++ b/dfp_api/examples/v201802/exchange_rate_service/get_exchange_rates_for_currency_code.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets the exchange rate for a specific currency code. + +require 'dfp_api' + +def get_exchange_rates_for_currency_code(dfp, currency_code) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a statement to select exchange rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'currencyCode = :currency_code' + sb.with_bind_variable('currency_code', currency_code) + end + + # Retrieve a small number of exchange rates at a time, paging through until + # all exchange rates have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get exchange rates by statement. + page = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) + + # Display some information about each exchange rate. + unless page[:results].nil? + page[:results].each do |exchange_rate| + puts ('Exchange rate with ID %d, currency code "%s", and exchange ' + + 'rate %.2f was found.') % [exchange_rate[:id], + exchange_rate[:currency_code], + exchange_rate[:exchange_rate] / 10_000_000_000.0] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts "Total number of custom targeting values found: %d" % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + currency_code = 'INSERT_CURRENCY_CODE_HERE' + get_exchange_rates_for_currency_code(dfp, currency_code) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/exchange_rate_service/update_exchange_rate.rb b/dfp_api/examples/v201802/exchange_rate_service/update_exchange_rate.rb new file mode 100755 index 000000000..615ac0e9a --- /dev/null +++ b/dfp_api/examples/v201802/exchange_rate_service/update_exchange_rate.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates the value of an exchange rate. Note that updating the +# exchange rate value will only take effect if the exchange rate's refreshRate +# is set to FIXED. + +require 'dfp_api' + +def update_exchange_rate(dfp, exchange_rate_id) + # Get the ExchangeRateService. + exchange_rate_service = dfp.service(:ExchangeRateService, API_VERSION) + + # Create a statement to select the exchange rate. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :exchange_rate_id' + sb.with_bind_variable('exchange_rate_id', exchange_rate_id) + sb.limit = 1 + end + + # Get the exchange rate. + response = exchange_rate_service.get_exchange_rates_by_statement( + statement.to_statement() + ) + raise 'No exchange rates found to update.' if response[:results].to_a.empty? + exchange_rate = response[:results].first + + # Update the exchange rate value to 1.5. + exchange_rate[:exchange_rate] = 15_000_000_000 + + # Send the changes to the server. + updated_exchange_rates = exchange_rate_service.update_exchange_rates([ + exchange_rate + ]) + + # Display the results. + if updated_exchange_rates.to_a.size > 0 + updated_exchange_rates.each do |exchange_rate| + puts ('Exchange rate with ID %d, currency code "%s", direction "%s", ' + + 'and exchange rate %.2f was updated.') % [exchange_rate[:id], + exchange_rate[:currency_code], exchange_rate[:direction], + exchange_rate[:exchange_rate] / 10_000_000_000.0] + end + else + puts 'No exchange rates were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + exchange_rate_id = 'INSERT_EXCHANGE_RATE_ID_HERE'.to_i + update_exchange_rate(dfp, exchange_rate_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/forecast_service/get_availability_forecast.rb b/dfp_api/examples/v201802/forecast_service/get_availability_forecast.rb similarity index 75% rename from dfp_api/examples/v201705/forecast_service/get_availability_forecast.rb rename to dfp_api/examples/v201802/forecast_service/get_availability_forecast.rb index 88838c0ce..63157e7df 100755 --- a/dfp_api/examples/v201705/forecast_service/get_availability_forecast.rb +++ b/dfp_api/examples/v201802/forecast_service/get_availability_forecast.rb @@ -21,37 +21,21 @@ require 'dfp_api' -API_VERSION = :v201705 - -def get_availability_forecast() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the ForecastService. +def get_availability_forecast(dfp, advertiser_id) + # Get the ForecastService and the NetworkService. forecast_service = dfp.service(:ForecastService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) - # Set the advertiser to assign the prospective line item to. - # This allows for forecasting while taking into account - # same advertiser exclusion. - advertiser_id = 'INSERT_ADVERTISER_ID_HERE'.to_i - # Set the root ad unit to target the entire network. - root_ad_unit_id = ( - network_service.get_current_network()[:effective_root_ad_unit_id].to_i) + root_ad_unit_id = + network_service.get_current_network()[:effective_root_ad_unit_id].to_i # Create targeting. targeting = { :inventory_targeting => { :targeted_ad_units => [ { - :include_descendants => True, + :include_descendants => true, :ad_unit_id => root_ad_unit_id } ] @@ -71,12 +55,12 @@ def get_availability_forecast() :creative_placeholders => [creative_placeholder], # Set the line item's time to be now until the projected end date time. :start_date_time_type => 'IMMEDIATELY', - :end_date_time => Time.utc(2014, 01, 01), + :end_date_time => dfp.utc(Date.today.year + 1, 1, 1).to_h, # Set the line item to use 50% of the impressions. - :primary_goal => {:goal => { + :primary_goal => { :units => '50', :unit_type => 'IMPRESSIONS', - :goal_type => 'DAILY'} + :goal_type => 'DAILY' }, # Set the cost type to match the unit type. :cost_type => 'CPM' @@ -89,32 +73,47 @@ def get_availability_forecast() # Set forecasting options. forecast_options = { - :include_contending_line_items => True, - :include_targeting_criteria_breakdown => True, + :include_contending_line_items => true, + :include_targeting_criteria_breakdown => true, } # Get forecast for the line item. forecast = forecast_service.get_availability_forecast( prospective_line_item, forecast_options) - if forecast + unless forecast.nil? # Display results. matched = forecast[:matched_units] available_percent = forecast[:available_units] * 100.0 / matched unit_type = forecast[:unit_type].to_s.downcase - puts "%.2f %s matched." % [matched, unit_type] - puts "%.2f%% %s available." % [available_percent, unit_type] - puts "%d contending line items." % forecast[:contending_line_items].size - if forecast[:possible_units] + puts '%.2f %s matched.' % [matched, unit_type] + puts '%.2f%% of %s available.' % [available_percent, unit_type] + unless forecast[:contending_line_items].nil? + puts '%d contending line items.' % forecast[:contending_line_items].size + end + unless forecast[:possible_units].nil? possible_percent = forecast[:possible_units] * 100.0 / matched - puts "%.2f%% %s possible." % [possible_percent, unit_type] + puts '%.2f%% of %s possible.' % [possible_percent, unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_availability_forecast() + # Set the advertiser to assign the prospective line item to. + # This allows for forecasting while taking into account + # same advertiser exclusion. + advertiser_id = 'INSERT_ADVERTISER_ID_HERE'.to_i + get_availability_forecast(dfp, advertiser_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/forecast_service/get_availability_forecast_for_line_item.rb b/dfp_api/examples/v201802/forecast_service/get_availability_forecast_for_line_item.rb similarity index 79% rename from dfp_api/examples/v201705/forecast_service/get_availability_forecast_for_line_item.rb rename to dfp_api/examples/v201802/forecast_service/get_availability_forecast_for_line_item.rb index 5285dbb07..0aee1a84d 100755 --- a/dfp_api/examples/v201705/forecast_service/get_availability_forecast_for_line_item.rb +++ b/dfp_api/examples/v201802/forecast_service/get_availability_forecast_for_line_item.rb @@ -21,22 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def get_availability_forecast_for_line_item() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_availability_forecast_for_line_item(dfp, line_item_id) # Get the ForecastService. forecast_service = dfp.service(:ForecastService, API_VERSION) - # Set the line item to get a forecast for. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Set forecasting options. forecast_options = { :include_contending_line_items => True, @@ -45,26 +33,37 @@ def get_availability_forecast_for_line_item() # Get forecast for the line item. forecast = forecast_service.get_availability_forecast_by_id( - line_item_id, forecast_options) + line_item_id, forecast_options + ) - if forecast + unless forecast.nil? # Display results. matched = forecast[:matched_units] available_percent = forecast[:available_units] * 100.0 / matched unit_type = forecast[:unit_type].to_s.downcase - puts "%.2f %s matched." % [matched, unit_type] - puts "%.2f%% %s available." % [available_percent, unit_type] - puts "%d contending line items." % forecast[:contending_line_items].size - if forecast[:possible_units] + puts '%.2f %s matched.' % [matched, unit_type] + puts '%.2f%% of %s available.' % [available_percent, unit_type] + puts '%d contending line items.' % forecast[:contending_line_items].size + unless forecast[:possible_units].nil? possible_percent = forecast[:possible_units] * 100.0 / matched - puts "%.2f%% %s possible." % [possible_percent, unit_type] + puts '%.2f%% of %s possible.' % [possible_percent, unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_availability_forecast_for_line_item() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + get_availability_forecast_for_line_item(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/forecast_service/get_delivery_forecast_for_line_items.rb b/dfp_api/examples/v201802/forecast_service/get_delivery_forecast_for_line_items.rb similarity index 75% rename from dfp_api/examples/v201705/forecast_service/get_delivery_forecast_for_line_items.rb rename to dfp_api/examples/v201802/forecast_service/get_delivery_forecast_for_line_items.rb index 2450fb087..4ff71ff73 100755 --- a/dfp_api/examples/v201705/forecast_service/get_delivery_forecast_for_line_items.rb +++ b/dfp_api/examples/v201802/forecast_service/get_delivery_forecast_for_line_items.rb @@ -17,47 +17,45 @@ # limitations under the License. # # This example gets a delivery forecast for multiple line items. To determine -# which placements exist, run get_all_placements.rb. +# which line items exist, run get_all_line_items.rb. require 'dfp_api' -API_VERSION = :v201705 - -def get_delivery_forecast_for_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_delivery_forecast_for_line_items(dfp, line_item_id1, line_item_id2) # Get the ForecastService. forecast_service = dfp.service(:ForecastService, API_VERSION) - # Set the line items to get a forecast for. - line_item_id1 = 'INSERT_LINE_ITEM_ID_1_HERE'.to_i - line_item_id2 = 'INSERT_LINE_ITEM_ID_2_HERE'.to_i - # Get forecast for the line item. forecast = forecast_service.get_delivery_forecast_by_ids( [line_item_id1, line_item_id2], nil) - if forecast + unless forecast.nil? || forecast[:line_item_delivery_forecasts].nil? forecast[:line_item_delivery_forecasts].each do |single_forecast| # Display results. unit_type = single_forecast[:unit_type] puts ('Forecast for line item %d:\n\t%d %s matched\n\t%d %s ' + - 'delivered\n\t%d %s predicted\n') % [ - single_forecast[:line_item_id], single_forecast[:matched_units], - unit_type, single_forecast[:delivered_units], unit_type, - single_forecast[:predicted_delivery_units], unit_type] + 'delivered\n\t%d %s predicted\n') % [single_forecast[:line_item_id], + single_forecast[:matched_units], unit_type, + single_forecast[:delivered_units], unit_type, + single_forecast[:predicted_delivery_units], unit_type] end end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_delivery_forecast_for_line_items() + line_item_id1 = 'INSERT_LINE_ITEM_ID_1_HERE'.to_i + line_item_id2 = 'INSERT_LINE_ITEM_ID_2_HERE'.to_i + get_delivery_forecast_for_line_items(dfp, line_item_id1, line_item_id2) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/inventory_service/archive_ad_units.rb b/dfp_api/examples/v201802/inventory_service/archive_ad_units.rb new file mode 100755 index 000000000..1251a0a96 --- /dev/null +++ b/dfp_api/examples/v201802/inventory_service/archive_ad_units.rb @@ -0,0 +1,101 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example archives a parent ad unit and all its children ad units. To +# determine which ad units exist, run get_all_ad_units.rb or +# get_ad_unit_hierarchy.rb. + +require 'dfp_api' + +def archive_ad_units(dfp, parent_ad_unit_id) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Create statement text to select ad units. + statement = dfp.new_statement_builder do |sb| + sb.where = 'parentId = :parent_id OR id = :parent_id' + sb.with_bind_variable('parent_id', parent_ad_unit_id) + end + + archived_ad_unit_count = 0 + + # Retrieve a small number of ad units at a time, paging through until all ad + # units have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get ad units by statement. + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + + unless page[:results].nil? + # Display some information about each ad unit. + page[:results].each do |ad_unit| + puts 'Ad unit with ID %d and name "%s" will be archived.' % + [ad_unit[:id], ad_unit[:name]] + end + + # Perform action. + result = inventory_service.perform_ad_unit_action( + {:xsi_type => 'ArchiveAdUnits'}, statement.to_statement() + ) + unless result.nil? or result[:num_changes].nil? + archived_ad_unit_count += result[:num_changes] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Display number of changes. + if archived_ad_unit_count > 0 + puts 'Number of ad units archived: %d' % archived_ad_unit_count + else + puts 'No ad units were archived.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + parent_ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i + archive_ad_units(dfp, parent_ad_unit_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/inventory_service/create_ad_units.rb b/dfp_api/examples/v201802/inventory_service/create_ad_units.rb similarity index 70% rename from dfp_api/examples/v201705/inventory_service/create_ad_units.rb rename to dfp_api/examples/v201802/inventory_service/create_ad_units.rb index e8f5179c6..c94e1c06b 100755 --- a/dfp_api/examples/v201705/inventory_service/create_ad_units.rb +++ b/dfp_api/examples/v201802/inventory_service/create_ad_units.rb @@ -20,31 +20,19 @@ # determine which ad units exist, run get_inventory_tree.rb or # get_all_ad_units.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -# Number of ad units to create. -ITEM_COUNT = 5 - -def create_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the InventoryService. +def create_ad_units(dfp, number_of_ad_units_to_create) + # Get the InventoryService and the NetworkService. inventory_service = dfp.service(:InventoryService, API_VERSION) - - # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the effective root ad unit ID of the network. effective_root_ad_unit_id = network_service.get_current_network[:effective_root_ad_unit_id] - puts "Using effective root ad unit: %d" % effective_root_ad_unit_id + puts 'Using effective root ad unit: %d' % effective_root_ad_unit_id # Create the creative placeholder. creative_placeholder = { @@ -53,31 +41,43 @@ def create_ad_units() } # Create an array to store local ad unit objects. - ad_units = (1..ITEM_COUNT).map do |index| - {:name => "Ad_Unit_%d" % index, - :parent_id => effective_root_ad_unit_id, - :description => 'Ad unit description.', - :target_window => 'BLANK', - # Set the size of possible creatives that can match this ad unit. - :ad_unit_sizes => [creative_placeholder]} + ad_units = (1..number_of_ad_units_to_create).map do |index| + { + :name => 'Ad_Unit #%d - %d' % [index, SecureRandom.uuid()], + :parent_id => effective_root_ad_unit_id, + :description => 'Ad unit description.', + :target_window => 'BLANK', + # Set the size of possible creatives that can match this ad unit. + :ad_unit_sizes => [creative_placeholder] + } end # Create the ad units on the server. - return_ad_units = inventory_service.create_ad_units(ad_units) + created_ad_units = inventory_service.create_ad_units(ad_units) - if return_ad_units - return_ad_units.each do |ad_unit| - puts "Ad unit with ID: %d, name: %s and status: %s was created." % + if created_ad_units.to_a.size > 0 + created_ad_units.each do |ad_unit| + puts 'Ad unit with ID %d, name "%s", and status "%s" was created.' % [ad_unit[:id], ad_unit[:name], ad_unit[:status]] end else - raise 'No ad units were created.' + puts 'No ad units were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_ad_units() + number_of_ad_units_to_create = 5 + create_ad_units(dfp, number_of_ad_units_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/inventory_service/deactivate_ad_units.rb b/dfp_api/examples/v201802/inventory_service/deactivate_ad_units.rb similarity index 69% rename from dfp_api/examples/v201705/inventory_service/deactivate_ad_units.rb rename to dfp_api/examples/v201802/inventory_service/deactivate_ad_units.rb index beda7d53d..51fde255b 100755 --- a/dfp_api/examples/v201705/inventory_service/deactivate_ad_units.rb +++ b/dfp_api/examples/v201802/inventory_service/deactivate_ad_units.rb @@ -21,65 +21,54 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_ad_units(dfp) # Get the InventoryService. inventory_service = dfp.service(:InventoryService, API_VERSION) # Create statement text to select active ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE status = :status', - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end ad_unit_ids = [] + page = {:total_result_set_size => 0} begin # Get ad units by statement. - page = inventory_service.get_ad_units_by_statement(statement.toStatement()) + page = inventory_service.get_ad_units_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |ad_unit, index| - puts ("%d) Ad unit with ID: %d, status: %s and name: %s will be " + - "deactivated.") % [index + statement.offset, ad_unit[:id], - ad_unit[:status], ad_unit[:name]] + puts ('%d) Ad unit with ID %d, status "%s", and name "%s" will be ' + + 'deactivated.') % [index + statement.offset, ad_unit[:id], + ad_unit[:status], ad_unit[:name]] ad_unit_ids << ad_unit[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of ad units to be deactivated: %d" % ad_unit_ids.size + puts 'Number of ad units to be deactivated: %d' % ad_unit_ids.size if !ad_unit_ids.empty? # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE status = :status AND id in (%s)" % ad_unit_ids.join(', '), - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement.configure do |sb| + sb.where = 'status = :status AND id IN (%s)' % ad_unit_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = inventory_service.perform_ad_unit_action( - {:xsi_type => 'DeactivateAdUnits'}, statement.toStatement()) + {:xsi_type => 'DeactivateAdUnits'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of ad units deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of ad units deactivated: %d' % result[:num_changes] else puts 'No ad units were deactivated.' end @@ -89,8 +78,17 @@ def deactivate_ad_units() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_ad_units() + deactivate_ad_units(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/inventory_service/get_ad_unit_hierarchy.rb b/dfp_api/examples/v201802/inventory_service/get_ad_unit_hierarchy.rb new file mode 100755 index 000000000..8df1fab0f --- /dev/null +++ b/dfp_api/examples/v201802/inventory_service/get_ad_unit_hierarchy.rb @@ -0,0 +1,112 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example prints all ad unit names as a tree. + +require 'dfp_api' + +def get_ad_unit_hierarchy(dfp) + # Get the NetworkService and InventoryService. + network_service = dfp.service(:NetworkService, API_VERSION) + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Set the parent ad unit's ID for all children ad units to be fetched from. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Create a statement to select only the root ad unit by ID. + root_ad_unit_statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :id' + sb.with_bind_variable('id', root_ad_unit_id) + sb.limit = 1 + end + + # Make a request for the root ad unit + response = inventory_service.get_ad_units_by_statement( + root_ad_unit_statement.to_statement() + ) + root_ad_unit = response[:results].first + + # Create a statement to select all ad units. + statement = dfp.new_statement_builder() + + # Get all ad units in order to construct the hierarchy later. + all_ad_units = [] + page = {:total_result_set_size => 0} + begin + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + unless page[:results].nil? + all_ad_units += page[:results] + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Make call to helper functions for displaying ad unit hierarchy. + display_ad_unit_hierarchy(root_ad_unit, all_ad_units) +end + +def display_ad_unit_hierarchy(root_ad_unit, ad_unit_list) + parent_id_to_children_map = {} + ad_unit_list.each do |ad_unit| + unless ad_unit[:parent_id].nil? + (parent_id_to_children_map[ad_unit[:parent_id]] ||= []) << ad_unit + end + end + + display_hierarchy(root_ad_unit, parent_id_to_children_map) +end + +def display_hierarchy(root, parent_id_to_children_map, depth=0) + indent_string = '%s+--' % ([' '] * depth).join('|') + puts '%s%s (%s)' % [indent_string, root[:name], root[:id]] + parent_id_to_children_map.fetch(root[:id], []).each do |child| + display_hierarchy(child, parent_id_to_children_map, depth+1) + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_ad_unit_hierarchy(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/inventory_service/get_all_ad_unit_sizes.rb b/dfp_api/examples/v201802/inventory_service/get_all_ad_unit_sizes.rb new file mode 100755 index 000000000..5957a9de3 --- /dev/null +++ b/dfp_api/examples/v201802/inventory_service/get_all_ad_unit_sizes.rb @@ -0,0 +1,70 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all ad unit sizes. + +require 'dfp_api' + +def get_all_ad_unit_sizes(dfp) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Create a statement to select all ad unit sizes. + statement = dfp.new_statement_builder() + + # Get the ad unit sizes. + ad_unit_sizes = inventory_service.get_ad_unit_sizes_by_statement( + statement.to_statement() + ) + + # Display the results. + ad_unit_sizes.each do |ad_unit_size| + puts 'Ad unit size with dimensions "%s" was found.' % + ad_unit_size[:full_display_string] + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_ad_unit_sizes(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/inventory_service/get_all_ad_units.rb b/dfp_api/examples/v201802/inventory_service/get_all_ad_units.rb new file mode 100755 index 000000000..8e19c9f2b --- /dev/null +++ b/dfp_api/examples/v201802/inventory_service/get_all_ad_units.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all ad units. + +require 'dfp_api' + +def get_all_ad_units(dfp) + # Get the InventoryService. + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Create a statement to select ad units. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of ad units at a time, paging + # through until all ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + + # Print out some information for each ad unit. + unless page[:results].nil? + page[:results].each_with_index do |ad_unit, index| + puts '%d) Ad unit with ID %d and name "%s" was found.' % + [index + statement.offset, ad_unit[:id], ad_unit[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of ad units: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/inventory_service/get_top_level_ad_units.rb b/dfp_api/examples/v201802/inventory_service/get_top_level_ad_units.rb new file mode 100755 index 000000000..990008d66 --- /dev/null +++ b/dfp_api/examples/v201802/inventory_service/get_top_level_ad_units.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all child ad units of the effective root ad unit. + +require 'dfp_api' + +def get_top_level_ad_units(dfp) + # Get the NetworkService and InventoryService. + network_service = dfp.service(:NetworkService, API_VERSION) + inventory_service = dfp.service(:InventoryService, API_VERSION) + + # Set the parent ad unit's ID for all children ad units to be fetched from. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Create a statement to select all ad unit sizes. + statement = dfp.new_statement_builder do |sb| + sb.where = 'parentId = :parent_id' + sb.with_bind_variable('parent_id', root_ad_unit_id) + end + + # Retrieve a small number of ad units at a time, paging through until all ad + # units have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get ad units by statement. + page = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + + # Display some information about each ad unit. + unless page[:results].nil? + page[:results].each_with_index do |ad_unit, index| + puts '%d) Ad unit with ID %d and name "%s" was found.' % + [statement.offset + index, ad_unit[:id], ad_unit[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Number of results found: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_top_level_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/inventory_service/update_ad_units.rb b/dfp_api/examples/v201802/inventory_service/update_ad_units.rb similarity index 57% rename from dfp_api/examples/v201705/inventory_service/update_ad_units.rb rename to dfp_api/examples/v201802/inventory_service/update_ad_units.rb index 952aefcbe..4c249e049 100755 --- a/dfp_api/examples/v201705/inventory_service/update_ad_units.rb +++ b/dfp_api/examples/v201802/inventory_service/update_ad_units.rb @@ -22,78 +22,57 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_ad_units(dfp, ad_unit_id) # Get the InventoryService. inventory_service = dfp.service(:InventoryService, API_VERSION) - # Specify which ad unit to update. - ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i - # Create a statement to get first 500 ad units. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => { - :value => ad_unit_id, - :xsi_type => 'NumberValue' - } - } - ], - 1 - } + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :ad_unit_id' + sb.with_bind_variable('ad_unit_id', ad_unit_id) + sb.limit = 1 + end # Get ad units by statement. - page = inventory_service.get_ad_units_by_statement(statement.toStatement()) - - if page[:results] - ad_units = page[:results] - - new_ad_unit_size = { - :size => { - :width => 1, - :height => 1, - :is_aspect_ration => false - }, - :environment_type => 'BROWSER' - } + response = inventory_service.get_ad_units_by_statement( + statement.to_statement() + ) + raise 'No ad unit found to update.' if response[:results].to_a.empty? + ad_unit = response[:results].first + + new_ad_unit_size = { + :size => {:width => 1, :height => 1, :is_aspect_ration => false}, + :environment_type => 'BROWSER' + } - # Update local ad unit by adding a new size of 1x1. - ad_units.each do |ad_unit| - ad_unit[:ad_unit_sizes] <<= new_ad_unit_size - # Workaround for issue #94. - ad_unit[:description] = "" if ad_unit[:description].nil? - end + ad_unit[:ad_unit_sizes] << new_ad_unit_size - # Update the ad units on the server. - return_ad_units = inventory_service.update_ad_units(ad_units) + # Update the ad units on the server. + updated_ad_units = inventory_service.update_ad_units([ad_unit]) - if return_ad_units - return_ad_units.each do |ad_unit| - puts "Ad unit with ID: %d, name: %s and status: %s was updated" % - [ad_unit[:id], ad_unit[:name], ad_unit[:status]] - end - else - raise 'No ad units were updated.' + if updated_ad_units.to_a.size > 0 + updated_ad_units.each do |ad_unit| + puts 'Ad unit with ID %d, name "%s", and status "%s" was updated' % + [ad_unit[:id], ad_unit[:name], ad_unit[:status]] end else - puts 'No ad units found to update.' + puts 'No ad units were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_ad_units() + ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i + update_ad_units(dfp, ad_unit_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/label_service/create_labels.rb b/dfp_api/examples/v201802/label_service/create_labels.rb similarity index 76% rename from dfp_api/examples/v201705/label_service/create_labels.rb rename to dfp_api/examples/v201802/label_service/create_labels.rb index d01fb8439..a9e6c62b3 100755 --- a/dfp_api/examples/v201705/label_service/create_labels.rb +++ b/dfp_api/examples/v201802/label_service/create_labels.rb @@ -21,45 +21,48 @@ # # This feature is only available to DFP premium solution networks. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -# Number of labels to create. -ITEM_COUNT = 5 - -def create_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_labels(dfp, number_of_labels_to_create) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create an array to store local label objects. - labels = (1..ITEM_COUNT).map do |index| - {:name => "Label #%d" % index, :types => ['COMPETITIVE_EXCLUSION']} + labels = (1..number_of_labels_to_create).map do |index| + { + :name => "Label #%d - %d" % [index, SecureRandom.uuid()], + :types => ['COMPETITIVE_EXCLUSION'] + } end # Create the labels on the server. - return_labels = label_service.create_labels(labels) + created_labels = label_service.create_labels(labels) - if return_labels - return_labels.each do |label| - puts "Label with ID: %d, name: '%s' and types: '%s' was created." % + if created_labels.to_a.size > 0 + created_labels.each do |label| + puts 'Label with ID %d, name "%s" and types "%s" was created.' % [label[:id], label[:name], label[:types].join(', ')] end else - raise 'No labels were created.' + puts 'No labels were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_labels() + number_of_labels_to_create = 5 + create_labels(dfp, number_of_labels_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/label_service/deactivate_labels.rb b/dfp_api/examples/v201802/label_service/deactivate_labels.rb similarity index 69% rename from dfp_api/examples/v201705/label_service/deactivate_labels.rb rename to dfp_api/examples/v201802/label_service/deactivate_labels.rb index b007d6873..9d7d62ea2 100755 --- a/dfp_api/examples/v201705/label_service/deactivate_labels.rb +++ b/dfp_api/examples/v201802/label_service/deactivate_labels.rb @@ -23,60 +23,56 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_labels(dfp) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create statement to select active labels. - statement = DfpApi::FilterStatement.new( - 'WHERE isActive = :is_active', - [ - {:key => 'is_active', - :value => {:value => true, :xsi_type => 'BooleanValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end # Define initial values. label_ids = [] + # Retrieve a small number of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} begin # Get labels by statement. - page = label_service.get_labels_by_statement(statement.toStatement()) + page = label_service.get_labels_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |label, index| - puts ("%d) Label ID: %d, name: %s will be deactivated.") % + puts ('%d) Label ID %d and name "%s" will be deactivated.') % [index + statement.offset, label[:id], label[:name]] label_ids << label[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of labels to be deactivated: %d" % label_ids.size + puts 'Number of labels to be deactivated: %d' % label_ids.size if !label_ids.empty? # Create a statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % label_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % label_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = label_service.perform_label_action( - {:xsi_type => 'DeactivateLabels'}, statement.toStatement()) + {:xsi_type => 'DeactivateLabels'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of labels deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of labels deactivated: %d' % result[:num_changes] else puts 'No labels were deactivated.' end @@ -86,8 +82,17 @@ def deactivate_labels() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_labels() + deactivate_labels(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/label_service/get_active_labels.rb b/dfp_api/examples/v201802/label_service/get_active_labels.rb new file mode 100755 index 000000000..cbf849ef4 --- /dev/null +++ b/dfp_api/examples/v201802/label_service/get_active_labels.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active labels. + +require 'dfp_api' + +def get_active_labels(dfp) + # Get the LabelService. + label_service = dfp.service(:LabelService, API_VERSION) + + # Create a statement to select labels. + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end + + # Retrieve a small amount of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} + begin + page = label_service.get_labels_by_statement( + statement.to_statement() + ) + + # Print out some information for each label. + unless page[:results].nil? + page[:results].each_with_index do |label, index| + puts '%d) Label with ID %d and name "%s" was found.' % + [index + statement.offset, label[:id], label[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of labels: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_labels(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/label_service/get_all_labels.rb b/dfp_api/examples/v201802/label_service/get_all_labels.rb new file mode 100755 index 000000000..0bb859def --- /dev/null +++ b/dfp_api/examples/v201802/label_service/get_all_labels.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all labels. + +require 'dfp_api' + +def get_all_labels(dfp) + # Get the LabelService. + label_service = dfp.service(:LabelService, API_VERSION) + + # Create a statement to select labels. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of labels at a time, paging + # through until all labels have been retrieved. + page = {:total_result_set_size => 0} + begin + page = label_service.get_labels_by_statement( + statement.to_statement() + ) + + # Print out some information for each label. + unless page[:results].nil? + page[:results].each_with_index do |label, index| + puts '%d) Label with ID %d and name "%s" was found.' % + [index + statement.offset, label[:id], label[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of labels: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_labels(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/label_service/update_labels.rb b/dfp_api/examples/v201802/label_service/update_labels.rb similarity index 72% rename from dfp_api/examples/v201705/label_service/update_labels.rb rename to dfp_api/examples/v201802/label_service/update_labels.rb index 69dc55282..985f7b5a4 100755 --- a/dfp_api/examples/v201705/label_service/update_labels.rb +++ b/dfp_api/examples/v201802/label_service/update_labels.rb @@ -23,60 +23,59 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_labels() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_labels(dfp) # Get the LabelService. label_service = dfp.service(:LabelService, API_VERSION) # Create a statement to only select active labels. - statement = DfpApi::FilterStatement.new( - 'WHERE isActive = :is_active', - [ - {:key => 'is_active', - :value => { - :value => 'true', - :xsi_type => 'BooleanValue'} - } - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'isActive = :is_active' + sb.with_bind_variable('is_active', true) + end + page = {:total_result_set_size => 0} begin # Get labels by statement. - page = label_service.get_labels_by_statement(statement.toStatement()) + page = label_service.get_labels_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 # Update each local label object by changing its description. page[:results].each do |label| label[:description] = 'This label was updated' end # Update the labels on the server. - return_labels = label_service.update_labels(labels) + updated_labels = label_service.update_labels(labels) - if return_labels - return_labels.each do |label| - puts("Label ID: %d, name: %s was updated with description: %s.") % + if updated_labels.to_a.size > 0 + updated_labels.each do |label| + puts('Label ID %d and name "%s" was updated with description "%s".') % [label[:id], label[:name], label[:description]] end else - raise 'No labels were updated.' + puts 'No labels were updated.' end + else + puts 'No labels were found to update.' end - end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_labels() + update_labels(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/line_item_creative_association_service/create_licas.rb b/dfp_api/examples/v201802/line_item_creative_association_service/create_licas.rb similarity index 80% rename from dfp_api/examples/v201705/line_item_creative_association_service/create_licas.rb rename to dfp_api/examples/v201802/line_item_creative_association_service/create_licas.rb index 35eb00ab4..453bb37b9 100755 --- a/dfp_api/examples/v201705/line_item_creative_association_service/create_licas.rb +++ b/dfp_api/examples/v201802/line_item_creative_association_service/create_licas.rb @@ -25,29 +25,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_licas(dfp, line_item_id, creative_ids) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Get the CreativeService. - creative_service = dfp.service(:CreativeService, API_VERSION) - - # Set the line item ID and creative IDs to associate. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - creative_ids = [ - 'INSERT_CREATIVE_ID_HERE'.to_i, - 'INSERT_CREATIVE_ID_HERE'.to_i - ] - # Create an array to store local LICA objects. licas = creative_ids.map do |creative_id| # For each line item, associate it with the given creative. @@ -55,22 +36,35 @@ def create_licas() end # Create the LICAs on the server. - return_licas = lica_service.create_line_item_creative_associations(licas) + created_licas = lica_service.create_line_item_creative_associations(licas) - if return_licas - return_licas.each do |lica| - puts ("LICA with line item ID: %d, creative ID: %d and status: %s was " + - "created.") % [lica[:line_item_id], lica[:creative_id], lica[:status]] + if created_licas.to_a.size > 0 + created_licas.each do |lica| + puts ('LICA with line item ID %d, creative ID %d, and status "%s" was ' + + 'created.') % [lica[:line_item_id], lica[:creative_id], lica[:status]] end else - raise 'No LICAs were created.' + puts 'No LICAs were created.' end - end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + creative_ids = [ + 'INSERT_CREATIVE_ID_HERE'.to_i, + 'INSERT_CREATIVE_ID_HERE'.to_i + ] + create_licas(dfp, line_item_id, creative_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/line_item_creative_association_service/deactivate_licas.rb b/dfp_api/examples/v201802/line_item_creative_association_service/deactivate_licas.rb similarity index 61% rename from dfp_api/examples/v201705/line_item_creative_association_service/deactivate_licas.rb rename to dfp_api/examples/v201802/line_item_creative_association_service/deactivate_licas.rb index d883c8768..729d1e355 100755 --- a/dfp_api/examples/v201705/line_item_creative_association_service/deactivate_licas.rb +++ b/dfp_api/examples/v201802/line_item_creative_association_service/deactivate_licas.rb @@ -16,73 +16,66 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example deactivates all LICAs for the line item. To determine which LICAs -# exist, run get_all_licas.rb. To determine which line items exist, run -# get_all_line_items.rb. +# This example deactivates all line item creative associations (LICAs) for the +# line item. To determine which LICAs exist, run get_all_licas.rb. To determine +# which line items exist, run get_all_line_items.rb. require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_licas(dfp, line_item_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Set the line item to get LICAs by. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create statement to select active LICAs for a given line item. - statement = DfpApi::FilterStatement.new( - 'WHERE lineItemId = :line_item_id AND status = :status', - [ - {:key => 'line_item_id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}}, - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id AND status = :status' + sb.with_bind_variable('line_item_id', line_item_id) + sb.with_bind_variable('status', 'ACTIVE') + end creative_ids = [] + # Retrieve a small number of LICAs at a time, paging + # through until all LICAs have been retrieved. + page = {:total_result_set_size => 0} begin # Get LICAs by statement. page = lica_service.get_line_item_creative_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |lica| - puts ("%d) LICA with line item ID: %d, creative ID: %d and status: %s" + - " will be deactivated.") % [creative_ids.size, lica[:line_item_id], + puts ('%d) LICA with line item ID %d, creative ID %d and status "%s"' + + ' will be deactivated.') % [creative_ids.size, lica[:line_item_id], lica[:creative_id], lica[:status]] creative_ids << lica[:creative_id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of LICAs to be deactivated: %d" % creative_ids.size + puts 'Number of LICAs to be deactivated: %d' % creative_ids.size if !creative_ids.empty? - # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE creativeId IN (%s)" % creative_ids.join(', ')) + # Create statement for action. + statement = dfp.new_statement_builder do |sb| + sb.where = 'creativeId IN (%s)' % creative_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = lica_service.perform_line_item_creative_association_action( {:xsi_type => 'DeactivateLineItemCreativeAssociations'}, - statement.toStatement()) + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of LICAs deactivated: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of LICAs deactivated: %d' % result[:num_changes] else puts 'No LICAs were deactivated.' end @@ -92,8 +85,18 @@ def deactivate_licas() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + deactivate_licas(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/line_item_creative_association_service/get_all_licas.rb b/dfp_api/examples/v201802/line_item_creative_association_service/get_all_licas.rb new file mode 100755 index 000000000..7db95541c --- /dev/null +++ b/dfp_api/examples/v201802/line_item_creative_association_service/get_all_licas.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item creative associations (LICAs). + +require 'dfp_api' + +def get_all_licas(dfp) + # Get the LineItemCreativeAssociationService. + lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) + + # Create a statement to select all LICAs. + statement = dfp.new_statement_builder() + + # Retrieve a small number of LICAs at a time, paging through until all LICAs + # have been retrieved. + begin + # Get LICAs by statement. + page = lica_service.get_line_item_creative_associations_by_statement( + statement.to_statement() + ) + + # Display some information about each LICA. + unless page[:results].nil? + page[:results].each do |lica| + if lica[:creative_set_id].nil? + puts 'LICA with line item ID %d and creative ID %d was found.' % + [lica[:line_item_id], lica[:creative_id]] + else + puts ('LICA with line item ID %d, creative set ID %d, and status ' + + '"%s" was found.') % [lica[:line_item_id], lica[:creative_set_id], + lica[:status]] + end + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_licas(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_creative_association_service/get_licas_for_line_item.rb b/dfp_api/examples/v201802/line_item_creative_association_service/get_licas_for_line_item.rb new file mode 100755 index 000000000..06b606f53 --- /dev/null +++ b/dfp_api/examples/v201802/line_item_creative_association_service/get_licas_for_line_item.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item creative associations (LICAs) for a given +# line item. + +require 'dfp_api' + +def get_licas_for_line_item(dfp, line_item_id) + # Get the LineItemCreativeAssociationService. + lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) + + # Create a statement to select all LICAs. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + end + + # Retrieve a small number of LICAs at a time, paging through until all LICAs + # have been retrieved. + begin + # Get LICAs by statement. + page = lica_service.get_line_item_creative_associations_by_statement( + statement.to_statement() + ) + + # Display some information about each LICA. + unless page[:results].nil? + page[:results].each do |lica| + if lica[:creative_set_id].nil? + puts 'LICA with line item ID %d and creative ID %d was found.' % + [lica[:line_item_id], lica[:creative_id]] + else + puts ('LICA with line item ID %d, creative set ID %d, and status ' + + '"%s" was found.') % [lica[:line_item_id], lica[:creative_set_id], + lica[:status]] + end + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + get_licas_for_line_item(dfp, line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/line_item_creative_association_service/update_licas.rb b/dfp_api/examples/v201802/line_item_creative_association_service/update_licas.rb similarity index 70% rename from dfp_api/examples/v201705/line_item_creative_association_service/update_licas.rb rename to dfp_api/examples/v201802/line_item_creative_association_service/update_licas.rb index af5df050b..4f41886c0 100755 --- a/dfp_api/examples/v201705/line_item_creative_association_service/update_licas.rb +++ b/dfp_api/examples/v201802/line_item_creative_association_service/update_licas.rb @@ -16,58 +16,44 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates the destination URL of all LICAs belonging to a line item. -# To determine which LICAs exist, run get_all_licas.rb. +# This example updates the destination URL of all LICAs belonging to a line +# item. To determine which LICAs exist, run get_all_licas.rb. require 'dfp_api' - -API_VERSION = :v201705 - -def update_licas() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_licas(dfp, line_item_id) # Get the LineItemCreativeAssociationService. lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION) - # Set the line item to get LICAs by. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - # Create a statement to only select LICAs for the given line item ID. - statement = DfpApi::FilterStatement.new( - 'WHERE lineItemId = :line_item_id ORDER BY lineItemId, creativeId ASC', - [ - {:key => 'line_item_id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemId = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.order_by = 'creativeId' + end # Get LICAs by statement. page = lica_service.get_line_item_creative_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + if page[:results].to_a.size > 0 licas = page[:results] # Update each local LICA object by changing its destination URL. licas.each {|lica| lica[:destination_url] = 'http://news.google.com'} # Update the LICAs on the server. - return_licas = lica_service.update_line_item_creative_associations(licas) + updated_licas = lica_service.update_line_item_creative_associations(licas) - if return_licas - return_licas.each do |lica| - puts ("LICA with line item ID: %d and creative ID: %d was updated " + - "with destination url [%s]") % - [lica[:line_item_id], lica[:creative_id], lica[:destination_url]] + if updated_licas.to_a.size > 0 + updated_licas.each do |lica| + puts ('LICA with line item ID %d and creative ID %d was updated ' + + 'with destination url "%s".') % [lica[:line_item_id], + lica[:creative_id], lica[:destination_url]] end else - raise 'No LICAs were updated.' + puts 'No LICAs were updated.' end else puts 'No LICAs found to update.' @@ -75,8 +61,18 @@ def update_licas() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_licas() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + update_licas(dfp, line_item_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/line_item_service/activate_line_items.rb b/dfp_api/examples/v201802/line_item_service/activate_line_items.rb similarity index 70% rename from dfp_api/examples/v201705/line_item_service/activate_line_items.rb rename to dfp_api/examples/v201802/line_item_service/activate_line_items.rb index 41b0e1fad..98c7c2e6b 100755 --- a/dfp_api/examples/v201705/line_item_service/activate_line_items.rb +++ b/dfp_api/examples/v201802/line_item_service/activate_line_items.rb @@ -25,68 +25,61 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def activate_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def activate_line_items(dfp, order_id) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the order to get line items from. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to only select line items from the specified order that # are in the approved (needs creatives) state. - statement = DfpApi::FilterStatement.new( - 'WHERE orderID = :order_id AND status = :status', - [ - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}}, - {:key => 'status', - :value => {:value => 'NEEDS_CREATIVES', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'orderId = :order_id AND status = :status' + sb.with_bind_variable('order_id', order_id) + sb.with_bind_variable('status', 'NEEDS_CREATIVES') + end line_item_ids = [] + # Retrieve a small number of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} begin # Get line items by statement. page = line_item_service.get_line_items_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |line_item| - if !line_item[:is_archived] - puts ("%d) Line item with ID: %d, order ID: %d and name: %s will " + - "be activated.") % [line_item_ids.size, line_item[:id], + unless line_item[:is_archived] + puts ('%d) Line item with ID %d, order ID %d and name "%s" will ' + + 'be activated.') % [line_item_ids.size, line_item[:id], line_item[:order_id], line_item[:name]] line_item_ids << line_item[:id] end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] puts "Number of line items to be activated: %d" % line_item_ids.size if !line_item_ids.empty? - # Modify statement for action. Note, the values are still present. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % line_item_ids.join(', ')) + # Create statement for action. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % line_item_ids.join(', ') + sb.offset = nil + sb.limit = nil + end # Perform action. result = line_item_service.perform_line_item_action( - {:xsi_type => 'ActivateLineItems'}, statement.toStatement()) + {:xsi_type => 'ActivateLineItems'}, statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of line items activated: %d" % result[:num_changes] else puts 'No line items were activated.' @@ -97,8 +90,18 @@ def activate_line_items() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - activate_line_items() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + activate_line_items(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/line_item_service/create_line_items.rb b/dfp_api/examples/v201802/line_item_service/create_line_items.rb new file mode 100755 index 000000000..1a26a912d --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/create_line_items.rb @@ -0,0 +1,176 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates new line items. To determine which line items exist, run +# get_all_line_items.rb. To determine which orders exist, run +# get_all_orders.rb. To determine which placements exist, run +# get_all_placements.rb. To determine the IDs for locations, run +# get_all_cities.rb, get_all_countries.rb, get_all_metros.rb and +# get_all_regions.rb. + +require 'securerandom' +require 'dfp_api' + +def create_line_items(dfp, order_id, targeted_placement_ids, + number_of_line_items_to_create) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create inventory targeting. + inventory_targeting = {:targeted_placement_ids => targeted_placement_ids} + + # Create geographical targeting. + geo_targeting = { + # Include targets. + :targeted_locations => [ + {:id => 2840}, # USA. + {:id => 20123}, # Quebec, Canada. + {:id => 9000093} # Postal code B3P (Canada). + ], + # Exclude targets. + :excluded_locations => [ + {:id => 1016367}, # Chicago. + {:id => 200501} # New York. + ] + } + + # Create user domain targeting. Exclude domains that are not under the + # network's control. + user_domain_targeting = {:domains => ['usa.gov'], :targeted => false} + + # Create day-part targeting. + day_part_targeting = { + # Target only the weekend in the browser's timezone. + :time_zone => 'BROWSER', + :day_parts => [ + { + :day_of_week => 'SATURDAY', + :start_time => {:hour => 0, :minute => 'ZERO'}, + :end_time => {:hour => 24, :minute => 'ZERO'} + }, + { + :day_of_week => 'SUNDAY', + :start_time => {:hour => 0, :minute => 'ZERO'}, + :end_time => {:hour => 24, :minute => 'ZERO'} + } + ] + } + + # Create technology targeting. + technology_targeting = { + # Create browser targeting. + :browser_targeting => { + :is_targeted => true, + # Target just the Chrome browser. + :browsers => [{:id => 500072}] + } + } + + # Create targeting. + targeting = { + :geo_targeting => geo_targeting, + :inventory_targeting => inventory_targeting, + :user_domain_targeting => user_domain_targeting, + :day_part_targeting => day_part_targeting, + :technology_targeting => technology_targeting + } + + # Create an array to store local line item objects. + line_items = (1..number_of_line_items_to_create).map do |index| + { + :name => "Line item #%d - %d" % [index, SecureRandom.uuid()], + :order_id => order_id, + :targeting => targeting, + :line_item_type => 'STANDARD', + :allow_overbook => true, + :creative_rotation_type => 'EVEN' + # Set the size of creatives that can be associated with this line item. + :creative_placeholders => [{ + :size => {:width => 300, :height => 250, :is_aspect_ratio => false} + }], + # Set the length of the line item to run. + :start_date_time_type => 'IMMEDIATELY' + :end_date_time => dfp.datetime( + Date.today.year + 1, 9, 30, 0, 0, 0, 'America/New_York' + ).to_h, + # Set the cost per unit to $2. + :cost_type => 'CPM', + :cost_per_unit => { + :currency_code => 'USD', + :micro_amount => 2_000_000 + }, + # Set the number of units bought to 500,000 so that the budget is $1,000. + line_item[:primary_goal] = { + :units => 500_000, + :unit_type => 'IMPRESSIONS', + :goal_type => 'LIFETIME' + } + } + end + + # Create the line items on the server. + created_line_items = line_item_service.create_line_items(line_items) + + if created_line_items.to_a.size > 0 + created_line_items.each do |line_item| + puts ('Line item with ID %d, belonging to order ID %d, and named "%s" ' + + 'was created.') % [line_item[:id], line_item[:order_id], + line_item[:name]] + end + else + puts 'No line items were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + order_id = 'INSERT_ORDER_ID_HERE'.to_i + targeted_placement_ids = [ + 'INSERT_PLACEMENT_ID_HERE'.to_i, + 'INSERT_PLACEMENT_ID_HERE'.to_i + ] + number_of_line_items_to_create = 5 + create_line_items( + dfp, order_id, targeted_placement_ids, number_of_line_items_to_create + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_service/create_video_line_item.rb b/dfp_api/examples/v201802/line_item_service/create_video_line_item.rb new file mode 100755 index 000000000..9785798da --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/create_video_line_item.rb @@ -0,0 +1,159 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example create a new line item to serve to video content. To determine +# which line items exist, run get_all_line_items.rb. To determine which orders +# exist, run get_all_orders.rb. To create a video ad unit, run +# create_video_ad_unit.rb. To create criteria for categories, run +# create_custom_targeting_keys_and_values.rb. +# +# This feature is only available to DFP premium solution networks. + +require 'dfp_api' + +def create_video_line_item(dfp, order_id, targeted_video_ad_unit_id, + content_custom_targeting_key_id, content_custom_targeting_value_id) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create custom criteria for the content metadata targeting. + content_custom_criteria = { + :xsi_type => 'CustomCriteria', + :key_id => content_custom_targeting_key_id, + :value_ids => [content_custom_targeting_value_id], + :operator => 'IS' + } + + # Create custom criteria set. + custom_criteria_set = { + :children => [content_custom_criteria] + } + + # Create inventory targeting. + inventory_targeting = { + :targeted_ad_units => [{:ad_unit_id => targeted_video_ad_unit_id}] + } + + # Create video position targeting. + video_position = {:position_type => 'PREROLL'} + video_position_target = {:video_position => video_position} + video_position_targeting = {:targeted_positions => [video_position_target]} + + # Create targeting. + targeting = { + :custom_targeting => custom_criteria_set, + :inventory_targeting => inventory_targeting, + :video_position_targeting => video_position_targeting + } + + # Create local line item object. + line_item = { + :name => 'Video line item', + :order_id => order_id, + :targeting => targeting, + :line_item_type => 'SPONSORSHIP', + :allow_overbook => true, + # Set the environment type to video. + :environment_type => 'VIDEO_PLAYER', + # Set the creative rotation type to optimized. + :creative_rotation_type => 'OPTIMIZED', + # Set delivery of video companions to optional. + :companion_delivery_option => 'OPTIONAL', + # Set the length of the line item to run. + :start_date_time_type => 'IMMEDIATELY', + :end_date_time => dfp.datetime( + Date.today.year + 1, 9, 30, 0, 0, 0, 'America/New_York' + ).to_h, + # Set the cost per day to $1. + :cost_type => 'CPD', + :cost_per_unit => {:currency_code => 'USD', :micro_amount => 1_000_000}, + # Set the percentage to be 100%. + :primary_goal => { + :units => 100, + :unit_type => 'IMPRESSIONS', + :goal_type => 'DAILY' + } + } + + # Create the master creative placeholder and companion creative placeholders. + creative_master_placeholder = { + :size => {:width => 400, :height => 300, :is_aspect_ratio => false}, + :companions => [ + {:size => {:width => 300, :height => 250, :is_aspect_ratio => false}}, + {:size => {:width => 728, :height => 90, :is_aspect_ratio => false}} + ] + } + + # Set the size of creatives that can be associated with this line item. + line_item[:creative_placeholders] = [creative_master_placeholder] + + # Create the line item on the server. + created_line_item = line_item_service.create_line_item(line_item) + + if created_line_item.to_a.size > 0 + puts ('Line item with ID %d, belonging to order ID %d, and named "%s" ' + + 'was created.') % [created_line_item[:id], created_line_item[:order_id], + created_line_item[:name]] + else + puts 'No line items were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + # Set the order that the created line item will belong to and the video ad + # unit ID to target. + order_id = 'INSERT_ORDER_ID_HERE'.to_i + targeted_video_ad_unit_id = 'INSERT_VIDEO_AD_UNIT_ID_HERE'.to_i + # Set the custom targeting key ID and value ID representing the metadata on + # the content to target. This would typically be a key representing a + # "genre" and a value representing something like "comedy". + content_custom_targeting_key_id = + 'INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i + content_custom_targeting_value_id = + 'INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE'.to_i + create_video_line_item( + dfp, order_id, targeted_video_ad_unit_id, + content_custom_targeting_key_id, content_custom_targeting_value_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_service/get_all_line_items.rb b/dfp_api/examples/v201802/line_item_service/get_all_line_items.rb new file mode 100755 index 000000000..43c759a6d --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/get_all_line_items.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line items. + +require 'dfp_api' + +def get_all_line_items(dfp) + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a statement to select line items. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts '%d) Line item with ID %d and name "%s" was found.' % + [index + statement.offset, line_item[:id], line_item[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_service/get_line_items_that_need_creatives.rb b/dfp_api/examples/v201802/line_item_service/get_line_items_that_need_creatives.rb new file mode 100755 index 000000000..cc8e2c4e5 --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/get_line_items_that_need_creatives.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line items that are missing creatives. + +require 'dfp_api' + +def get_line_items_that_need_creatives(dfp) + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a statement to select line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'isMissingCreatives = :is_missing_creatives' + sb.with_bind_variable('is_missing_creatives', true) + end + + # Retrieve a small amount of line items at a time, paging + # through until all line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts '%d) Line item with ID %d and name "%s" was found.' % + [index + statement.offset, line_item[:id], line_item[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_line_items_that_need_creatives(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_service/get_recently_updated_line_items.rb b/dfp_api/examples/v201802/line_item_service/get_recently_updated_line_items.rb new file mode 100755 index 000000000..bea6e17da --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/get_recently_updated_line_items.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets only recently updated line items. + +require 'dfp_api' + +def get_recently_updated_line_items(dfp) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a DfpDateTime representing 24 hours in the past. + yesterday = dfp.now('America/New_York') - 24 * 60 * 60 + + # Create a statement to select line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lastModifiedDateTime >= :last_modified_date_time' + sb.with_bind_variable('last_modified_date_time', yesterday) + end + + # Retrieve a small number of line items at a time, paging through until all + # line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get line items by statement. + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each line item. + unless page[:results].nil? + page[:results].each_with_index do |line_item, index| + puts "%d) Line item with ID %d and name '%s' was found." % + [index + statement.offset, line_item[:id], line_item[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_recently_updated_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/line_item_service/pause_line_item.rb b/dfp_api/examples/v201802/line_item_service/pause_line_item.rb new file mode 100755 index 000000000..896b756bd --- /dev/null +++ b/dfp_api/examples/v201802/line_item_service/pause_line_item.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example pauses a line item. Line items must be paused before they can be +# updated. To determine which line items exist, run get_all_line_items.rb. + +require 'dfp_api' + +def pause_line_item(dfp, line_item_id) + # Get the LineItemService. + line_item_service = dfp.service(:LineItemService, API_VERSION) + + # Create a statement to select the line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + end + + # Retrieve a small number of line items at a time, paging through until all + # line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get line items by statement. + page = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each line item. + unless page[:results].nil? + page[:results].each do |line_item| + puts ("Line item with ID: %d, order ID: %d and name: %s will " + + "be paused.") % [line_item[:id], line_item[:order_id], + line_item[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts "Number of line items to be paused: %d" % page[:total_result_set_size] + + # Perform action. + result = line_item_service.perform_line_item_action( + {:xsi_type => 'PauseLineItems'}, statement.to_statement() + ) + + # Display results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of line items paused: %d" % result[:num_changes] + else + puts 'No line items were paused.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + line_item_id = 'INSERT_line_item_id_here'.to_i + pause_line_item(dfp, line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/line_item_service/target_custom_criteria.rb b/dfp_api/examples/v201802/line_item_service/target_custom_criteria.rb similarity index 51% rename from dfp_api/examples/v201705/line_item_service/target_custom_criteria.rb rename to dfp_api/examples/v201802/line_item_service/target_custom_criteria.rb index eb453c166..1900030ce 100755 --- a/dfp_api/examples/v201705/line_item_service/target_custom_criteria.rb +++ b/dfp_api/examples/v201802/line_item_service/target_custom_criteria.rb @@ -16,111 +16,109 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates a line item to add custom criteria targeting. To -# determine which line items exist, run get_all_line_items.rb. To determine +# This example updates a line item to add custom criteria targeting. The custom +# criteria set will be structured as follows: +# +# (custom_criteria[0].key == custom_criteria[0].values OR +# (custom_criteria[1].key != custom_criteria[1].values AND +# custom_criteria[2].key == custom_criteria[2].values)) +# +# To determine which line items exist, run get_all_line_items.rb. To determine # which custom targeting keys and values exist, run # get_all_custom_targeting_keys_and_values.rb. require 'dfp_api' - - require 'pp' -API_VERSION = :v201705 -PAGE_SIZE = 500 - -def target_custom_criteria() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def target_custom_criteria(dfp, line_item_id, custom_criteria_ids) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the line item to update targeting. - line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i - - # Set the IDs of the custom targeting keys. - custom_criteria_ids = [ - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, - {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, - :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]} - ] - # Create custom criteria. custom_criteria = [ - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[0][:key], - :value_ids => custom_criteria_ids[0][:values], - :operator => 'IS'}, - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[1][:key], - :value_ids => custom_criteria_ids[1][:values], - :operator => 'IS_NOT'}, - {:xsi_type => 'CustomCriteria', - :key_id => custom_criteria_ids[2][:key], - :value_ids => custom_criteria_ids[2][:values], - :operator => 'IS'} + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[0][:key], + :value_ids => custom_criteria_ids[0][:values], + :operator => 'IS' + }, + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[1][:key], + :value_ids => custom_criteria_ids[1][:values], + :operator => 'IS_NOT' + }, + { + :xsi_type => 'CustomCriteria', + :key_id => custom_criteria_ids[2][:key], + :value_ids => custom_criteria_ids[2][:values], + :operator => 'IS' + } ] - # Create the custom criteria set that will resemble: - # - # (custom_criteria[0].key == custom_criteria[0].values OR - # (custom_criteria[1].key != custom_criteria[1].values AND - # custom_criteria[2].key == custom_criteria[2].values)) sub_custom_criteria_set = { - :xsi_type => 'CustomCriteriaSet', - :logical_operator => 'AND', - :children => [custom_criteria[1], custom_criteria[2]] + :xsi_type => 'CustomCriteriaSet', + :logical_operator => 'AND', + :children => [custom_criteria[1], custom_criteria[2]] } top_custom_criteria_set = { - :xsi_type => 'CustomCriteriaSet', - :logical_operator => 'OR', - :children => [custom_criteria[0], sub_custom_criteria_set] + :xsi_type => 'CustomCriteriaSet', + :logical_operator => 'OR', + :children => [custom_criteria[0], sub_custom_criteria_set] } - # Create a statement to only select a single line item. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => line_item_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :line_item_id' + sb.with_bind_variable('line_item_id', line_item_id) + sb.limit = 1 + end # Get line items by statement. - page = line_item_service.get_line_items_by_statement(statement.toStatement()) - - if page[:results] - line_item = page[:results].first + response = line_item_service.get_line_items_by_statement( + statement.to_statement() + ) + raise 'No line item found to update.' if response[:results].to_a.empty? + line_item = response[:results].first - line_item[:targeting][:custom_targeting] = top_custom_criteria_set + line_item[:targeting][:custom_targeting] = top_custom_criteria_set - # Update the line items on the server. - return_line_item = line_item_service.update_line_items([line_item]) + # Update the line items on the server. + updated_line_items = line_item_service.update_line_items([line_item]) - # Display the updated line item. - if return_line_item - puts "Line item ID: %d was updated with custom criteria targeting:" % - return_line_item[:id] - pp return_line_item[:targeting] - else - puts 'Line item update failed.' + # Display the updated line item. + if updated_line_items.to_a.size > 0 + updated_line_items.each do |line_item| + puts 'Line item with ID %d was updated with custom criteria targeting:' % + line_item[:id] + pp line_item[:targeting] end + else + puts 'No line items were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - target_custom_criteria() + line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i + custom_criteria_ids = [ + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]}, + {:key => 'INSERT_CUSTOM_TARGETING_KEY_ID_HERE'.to_i, + :values => ['INSERT_CUSTOM_TARGETING_VALUE_IDS_HERE'.to_i]} + ] + target_custom_criteria(dfp, line_item_id, custom_criteria_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/line_item_service/update_line_items.rb b/dfp_api/examples/v201802/line_item_service/update_line_items.rb similarity index 70% rename from dfp_api/examples/v201705/line_item_service/update_line_items.rb rename to dfp_api/examples/v201802/line_item_service/update_line_items.rb index b28d98d72..a3513c06f 100755 --- a/dfp_api/examples/v201705/line_item_service/update_line_items.rb +++ b/dfp_api/examples/v201802/line_item_service/update_line_items.rb @@ -22,45 +22,27 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_line_items(dfp, order_id) # Get the LineItemService. line_item_service = dfp.service(:LineItemService, API_VERSION) - # Set the ID of the order to get line items from. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to get line items with even delivery rates. - statement = DfpApi::FilterStatement.new( - 'WHERE deliveryRateType = :delivery_rate_type AND ' + - 'orderId = :order_id ', - [ - {:key => 'delivery_rate_type', - :value => {:value => 'EVENLY', :xsi_type => 'TextValue'}}, - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'deliveryRateType = :delivery_rate_type AND orderId = :order_id' + sb.with_bind_variable('delivery_rate_type', 'EVENLY') + sb.with_bind_variable('order_id', order_id) + end # Get line items by statement. - page = line_item_service.get_line_items_by_statement(statement.toStatement()) + page = line_item_service.get_line_items_by_statement(statement.to_statement()) - if page[:results] + if page[:results].to_a.size > 0 line_items = page[:results] # Update each local line item object by changing its delivery rate. new_line_items = line_items.inject([]) do |new_line_items, line_item| # Archived line items can not be updated. - if !line_item[:is_archived] + unless line_item[:is_archived] line_item[:delivery_rate_type] = 'AS_FAST_AS_POSSIBLE' new_line_items << line_item end @@ -68,16 +50,16 @@ def update_line_items() end # Update the line items on the server. - return_line_items = line_item_service.update_line_items(new_line_items) + updated_line_items = line_item_service.update_line_items(new_line_items) - if return_line_items - return_line_items.each do |line_item| - puts ("Line item ID: %d, order ID: %d, name: %s was updated with " + - "delivery rate: %s") % [line_item[:id], line_item[:order_id], - line_item[:name], line_item[:delivery_rate_type]] + if updated_line_items.to_a.size > 0 + updated_line_items.each do |line_item| + puts ('Line item ID %d, order ID %d, name "%s" was updated with ' + + 'delivery rate "%s".') % [line_item[:id], line_item[:order_id], + line_item[:name], line_item[:delivery_rate_type]] end else - raise 'No line items were updated.' + puts 'No line items were updated.' end else puts 'No line items found to update.' @@ -85,8 +67,18 @@ def update_line_items() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_line_items() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + update_line_items(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/native_style_service/create_native_styles.rb b/dfp_api/examples/v201802/native_style_service/create_native_styles.rb similarity index 91% rename from dfp_api/examples/v201705/native_style_service/create_native_styles.rb rename to dfp_api/examples/v201802/native_style_service/create_native_styles.rb index ab397304a..bcd104436 100755 --- a/dfp_api/examples/v201705/native_style_service/create_native_styles.rb +++ b/dfp_api/examples/v201802/native_style_service/create_native_styles.rb @@ -18,23 +18,15 @@ # # Creates a native app install ad. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 - -def create_native_styles() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_native_styles(dfp) # Get the NativeStyleService. - native_style_service = dfp.service(:NativeStyleService, :v201705) + native_style_service = dfp.service(:NativeStyleService, API_VERSION) native_style = { - :name => 'Native style #%d' % (Time.new.to_f * 1000), + :name => 'Native style - %d' % SecureRandom.uuid(), :html_snippet => get_html(), :css_snippet => get_css(), # This is the creative template ID for the system-defined native app install @@ -49,14 +41,14 @@ def create_native_styles() # Create the native styles on the server. results = native_style_service.create_native_styles([native_style]) - if results + if results.to_a.size > 0 results.each_with_index do |style, index| - puts ("%d) Native style with ID %d, name '%s' and creative " + - "template ID %d was created.") % [index, style[:id], style[:name], + puts ('%d) Native style with ID %d, name "%s" and creative ' + + 'template ID %d was created.') % [index, style[:id], style[:name], style[:creative_template_id]] end else - raise 'No native styles were created.' + puts 'No native styles were created.' end end @@ -179,8 +171,17 @@ def get_css() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_native_styles() + create_native_styles(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/native_style_service/get_all_native_styles.rb b/dfp_api/examples/v201802/native_style_service/get_all_native_styles.rb new file mode 100755 index 000000000..9682b4368 --- /dev/null +++ b/dfp_api/examples/v201802/native_style_service/get_all_native_styles.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all native styles. + +require 'dfp_api' + +def get_all_native_styles(dfp) + # Get the NativeStyleService. + native_style_service = dfp.service(:NativeStyleService, API_VERSION) + + # Create a statement to select native styles. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of native styles at a time, paging through until + # all of them have been retrieved. + page = {:total_result_set_size => 0} + begin + page = native_style_service.get_native_styles_by_statement( + statement.to_statement() + ) + + # Print out some information for each native style. + unless page[:results].nil? + page[:results].each_with_index do |style, index| + puts ('%d) Native style with ID %d, name "%s", and creative ' + + 'template ID %d was found.') % [index + statement.offset, + style[:id], style[:name], style[:creative_template_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size + + puts 'Total number of native styles: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_native_styles(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/network_service/get_all_networks.rb b/dfp_api/examples/v201802/network_service/get_all_networks.rb new file mode 100755 index 000000000..fd1c42889 --- /dev/null +++ b/dfp_api/examples/v201802/network_service/get_all_networks.rb @@ -0,0 +1,65 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all networks which the current user can access. + +require 'dfp_api' + +def get_all_networks(dfp) + # Get the NetworkService. + network_service = dfp.service(:NetworkService, API_VERSION) + + # Get the current network. + networks = network_service.get_all_networks() + + # Display the results. + networks.each do |network| + puts 'Current network has network code %d and display name "%s".' % + [network[:network_code], network[:display_name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_networks(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/network_service/get_current_network.rb b/dfp_api/examples/v201802/network_service/get_current_network.rb similarity index 92% rename from dfp_api/examples/v201705/network_service/get_current_network.rb rename to dfp_api/examples/v201802/network_service/get_current_network.rb index a055f3a50..fb466206b 100755 --- a/dfp_api/examples/v201705/network_service/get_current_network.rb +++ b/dfp_api/examples/v201802/network_service/get_current_network.rb @@ -20,29 +20,29 @@ require 'dfp_api' -API_VERSION = :v201705 - -def get_current_network() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_current_network(dfp) # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Get the current network. network = network_service.get_current_network() - puts "Current network has network code %d and display name %s." % + puts 'Current network has network code %d and display name "%s".' % [network[:network_code], network[:display_name]] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_current_network() + get_current_network(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/network_service/make_test_network.rb b/dfp_api/examples/v201802/network_service/make_test_network.rb similarity index 91% rename from dfp_api/examples/v201705/network_service/make_test_network.rb rename to dfp_api/examples/v201802/network_service/make_test_network.rb index bd976dc4f..a47e3d1b5 100755 --- a/dfp_api/examples/v201705/network_service/make_test_network.rb +++ b/dfp_api/examples/v201802/network_service/make_test_network.rb @@ -31,31 +31,31 @@ require 'dfp_api' -API_VERSION = :v201705 - -def make_test_network() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def make_test_network(dfp) # Get the NetworkService. network_service = dfp.service(:NetworkService, API_VERSION) # Make a test network. network = network_service.make_test_network() - puts "Test network with network code %s and display name '%s' created." % + puts 'Test network with network code %s and display name "%s" created.' % [network[:network_code], network[:display_name]] - puts "You may now sign in at http://www.google.com/dfp/main?networkCode=%s" % + puts 'You may now sign in at http://www.google.com/dfp/main?networkCode=%s' % network[:network_code] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - make_test_network() + make_test_network(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/order_service/approve_orders.rb b/dfp_api/examples/v201802/order_service/approve_orders.rb similarity index 61% rename from dfp_api/examples/v201705/order_service/approve_orders.rb rename to dfp_api/examples/v201802/order_service/approve_orders.rb index 35c252d9e..0e546fc7a 100755 --- a/dfp_api/examples/v201705/order_service/approve_orders.rb +++ b/dfp_api/examples/v201802/order_service/approve_orders.rb @@ -19,67 +19,64 @@ # This example approves and overbooks all eligible draft or pending orders. To # determine which orders exist, run get_all_orders.rb. -require 'date' require 'dfp_api' - -API_VERSION = :v201705 -PAGE_SIZE = 500 - -def approve_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def approve_orders(dfp) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - # Create a statement text to select all eligible draft or pending orders. - statement = DfpApi::FilterStatement.new( - "WHERE status IN ('DRAFT', 'PENDING_APPROVAL') " + - "AND endDateTime >= :today AND isArchived = FALSE", - [ - {:key => 'today', - :value => {:value => Date.today.strftime('%Y-%m-%dT%H:%M:%S'), - :xsi_type => 'TextValue'}} - ] + # Create a DfpDateTime representing the start of the present day. + today = dfp.today() + start_of_today = dfp.datetime( + today.year, today.month, today.day, 0, 0, 0, 'America/New_York' ) + # Create a statement text to select all eligible draft or pending orders. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status IN (%s) AND endDateTime >= :start_of_today AND ' + + 'isArchived = :is_archived' % + ["'DRAFT'", "'PENDING_APPROVAL'"].join(', ') + sb.with_bind_variable('start_of_today', start_of_today) + sb.with_bind_variable('is_archived', false) + end + order_ids = [] + page = {:total_result_set_size => 0} begin # Get orders by statement. - page = order_service.get_orders_by_statement(statement.toStatement()) + page = order_service.get_orders_by_statement(statement.to_statement()) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |order, index| - puts ("%d) Order ID: %d, status: %s and name: %s will be " + - "approved.") % [index + statement.offset, - order[:id], order[:status], - order[:name]] + puts ('%d) Order ID %d, status "%s", and name "%s" will be ' + + 'approved.') % [index + statement.offset, order[:id], + order[:status], order[:name]] order_ids << order[:id] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - puts "Number of orders to be approved: %d" % order_ids.size + puts 'Number of orders to be approved: %d' % order_ids.size if !order_ids.empty? # Create statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % order_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % order_ids.join(', ') + end # Perform action. result = order_service.perform_order_action( - {:xsi_type => 'ApproveAndOverbookOrders'}, statement.toStatement()) + {:xsi_type => 'ApproveAndOverbookOrders'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of orders approved: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of orders approved: %d' % result[:num_changes] else puts 'No orders were approved.' end @@ -89,8 +86,17 @@ def approve_orders() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - approve_orders() + approve_orders(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/order_service/create_orders.rb b/dfp_api/examples/v201802/order_service/create_orders.rb similarity index 67% rename from dfp_api/examples/v201705/order_service/create_orders.rb rename to dfp_api/examples/v201802/order_service/create_orders.rb index f921b00a7..3c86a4ddc 100755 --- a/dfp_api/examples/v201705/order_service/create_orders.rb +++ b/dfp_api/examples/v201802/order_service/create_orders.rb @@ -21,54 +21,57 @@ # get_companies_by_statement.rb. To get salespeople and traffickers, run # get_all_users.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -# Number of orders to create. -ITEM_COUNT = 5 - -def create_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_orders(dfp, advertiser_id, salesperson_id, trafficker_id, + number_of_orders_to_create) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - # Set the advertiser (company), salesperson, and trafficker to assign to each - # order. - advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i - salesperson_id = 'INSERT_SALESPERSON_ID_HERE'.to_i - trafficker_id = 'INSERT_TRAFFICKER_ID_HERE'.to_i - # Create an array to store local order objects. - orders = (1..ITEM_COUNT).map do |index| - {:name => "Order #%d" % index, - :advertiser_id => advertiser_id, - :salesperson_id => salesperson_id, - :trafficker_id => trafficker_id} + orders = (1..number_of_orders_to_create).map do |index| + { + :name => 'Order #%d - %d' % [index, SecureRandom.uuid()], + :advertiser_id => advertiser_id, + :salesperson_id => salesperson_id, + :trafficker_id => trafficker_id + } end # Create the orders on the server. - return_orders = order_service.create_orders(orders) + created_orders = order_service.create_orders(orders) - if return_orders - return_orders.each do |order| - puts "Order with ID: %d and name: %s was created." % + if created_orders + created_orders.each do |order| + puts 'Order with ID %d and name "%s" was created.' % [order[:id], order[:name]] end else - raise 'No orders were created.' + puts 'No orders were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_orders() + advertiser_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'.to_i + salesperson_id = 'INSERT_SALESPERSON_ID_HERE'.to_i + trafficker_id = 'INSERT_TRAFFICKER_ID_HERE'.to_i + number_of_orders_to_create = 5 + create_orders( + dfp, advertiser_id, salesperson_id, trafficker_id, + number_of_orders_to_create + ) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/order_service/get_all_orders.rb b/dfp_api/examples/v201802/order_service/get_all_orders.rb new file mode 100755 index 000000000..02aa88fae --- /dev/null +++ b/dfp_api/examples/v201802/order_service/get_all_orders.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all orders. + +require 'dfp_api' + +def get_all_orders(dfp) + order_service = dfp.service(:OrderService, API_VERSION) + + # Create a statement to select orders. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of orders at a time, paging + # through until all orders have been retrieved. + page = {:total_result_set_size => 0} + begin + page = order_service.get_orders_by_statement( + statement.to_statement() + ) + + # Print out some information for each order. + unless page[:results].nil? + page[:results].each_with_index do |order, index| + puts '%d) Order with ID %d and name "%s" was found.' % + [index + statement.offset, order[:id], order[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of orders: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_orders(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/order_service/get_orders_starting_soon.rb b/dfp_api/examples/v201802/order_service/get_orders_starting_soon.rb new file mode 100755 index 000000000..57b378580 --- /dev/null +++ b/dfp_api/examples/v201802/order_service/get_orders_starting_soon.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all orders that are starting soon. + +require 'dfp_api' + +def get_orders_starting_soon(dfp) + # Get the OrderService. + order_service = dfp.service(:OrderService, API_VERSION) + + # Create DfpDateTime objects for now and 5 days from now. + now = dfp.now("America/New_York") + five_days_from_now = now + 5 * 24 * 60 * 60 + + # Create a statement to select orders. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status AND startDateTime >= :start_time AND ' + + 'startDateTime <= :end_time' + sb.with_bind_variable('status', 'APPROVED') + sb.with_bind_variable('start_time', now) + sb.with_bind_variable('end_time', five_days_from_now) + end + + # Retrieve a small number of orders at a time, paging through until all + # orders have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get orders by statement. + page = order_service.get_orders_by_statement(statement.to_statement()) + + # Display some information about each order. + unless page[:results].nil? + page[:results].each_with_index do |order, index| + puts "%d) Order with ID %d and name '%s' was found." % + [index + statement.offset, order[:id], order[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of orders: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_orders_starting_soon(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/order_service/update_orders.rb b/dfp_api/examples/v201802/order_service/update_orders.rb similarity index 60% rename from dfp_api/examples/v201705/order_service/update_orders.rb rename to dfp_api/examples/v201802/order_service/update_orders.rb index 7b683d325..ff0e3565c 100755 --- a/dfp_api/examples/v201705/order_service/update_orders.rb +++ b/dfp_api/examples/v201802/order_service/update_orders.rb @@ -21,67 +21,52 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_orders() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_orders(dfp, order_id) # Get the OrderService. order_service = dfp.service(:OrderService, API_VERSION) - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Create a statement to get first 500 orders. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :order_id' + sb.with_bind_variable('order_id', order_id) + sb.limit = 1 + end # Get orders by statement. - page = order_service.get_orders_by_statement(statement.toStatement()) + response = order_service.get_orders_by_statement(statement.to_statement()) + raise 'No orders found to update.' if response[:results].to_a.empty? + order = response[:results].first - if page[:results] - orders = page[:results] + # Archived orders can not be updated. + order[:notes] = 'Spoke to advertiser. All is well.' unless order[:is_archived] - orders.each do |order| - # Archived orders can not be updated. - if !order[:is_archived] - order[:notes] = 'Spoke to advertiser. All is well.' - # Workaround for issue #94. - order[:po_number] = "" if order[:po_number].nil? - end - end - - # Update the orders on the server. - return_orders = order_service.update_orders(orders) + # Update the orders on the server. + updated_orders = order_service.update_orders(orders) - if return_orders - return_orders.each do |order| - puts ("Order ID: %d, advertiser ID: %d, name: %s was updated " + - "with notes %s") % [order[:id], order[:advertiser_id], - order[:name], order[:notes]] - end - else - raise 'No orders were updated.' + if updated_orders.to_a.size > 0 + updated_orders.each do |order| + puts ('Order ID %d, advertiser ID %d, name "%s" was updated with notes ' + + '"%s".') % [order[:id], order[:advertiser_id], order[:name], + order[:notes]] end else - puts 'No orders found to update.' + puts 'No orders were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_orders() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + update_orders(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/package_service/get_all_packages.rb b/dfp_api/examples/v201802/package_service/get_all_packages.rb new file mode 100755 index 000000000..4ab2244a2 --- /dev/null +++ b/dfp_api/examples/v201802/package_service/get_all_packages.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all packages. + +require 'dfp_api' + +def get_all_packages(dfp) + package_service = dfp.service(:PackageService, API_VERSION) + + # Create a statement to select packages. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of packages at a time, paging + # through until all packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = package_service.get_packages_by_statement( + statement.to_statement() + ) + + # Print out some information for each package. + unless page[:results].nil? + page[:results].each_with_index do |package, index| + puts ('%d) Package with ID %d, name "%s", and proposal id %d was ' + + 'found.') % [index + statement.offset, package[:id], + package[:name], package[:proposal_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/package_service/get_in_progress_packages.rb b/dfp_api/examples/v201802/package_service/get_in_progress_packages.rb new file mode 100755 index 000000000..0997b0f1d --- /dev/null +++ b/dfp_api/examples/v201802/package_service/get_in_progress_packages.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all packages in progress. + +require 'dfp_api' + +def get_in_progress_packages(dfp) + package_service = dfp.service(:PackageService, API_VERSION) + + # Create a statement to select packages. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'IN_PROGRESS') + end + + # Retrieve a small amount of packages at a time, paging + # through until all packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = package_service.get_packages_by_statement( + statement.to_statement() + ) + + # Print out some information for each package. + unless page[:results].nil? + page[:results].each_with_index do |package, index| + puts ('%d) Package with ID %d, name "%s", and proposal ID %d was ' + + 'found.') % [index + statement.offset, package[:id], + package[:name], package[:proposal_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_in_progress_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/placement_service/create_placements.rb b/dfp_api/examples/v201802/placement_service/create_placements.rb similarity index 70% rename from dfp_api/examples/v201705/placement_service/create_placements.rb rename to dfp_api/examples/v201802/placement_service/create_placements.rb index 233f22609..d9e216b6d 100755 --- a/dfp_api/examples/v201705/placement_service/create_placements.rb +++ b/dfp_api/examples/v201802/placement_service/create_placements.rb @@ -19,54 +19,45 @@ # This example creates new placements for various ad unit sizes. To determine # which placements exist, run get_all_placements.rb. +require 'securerandom' require 'dfp_api' - -API_VERSION = :v201705 - -def create_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Get the InventoryService. +def create_placements(dfp) + # Get the InventoryService and the PlacementService. inventory_service = dfp.service(:InventoryService, API_VERSION) - - # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) # Create local placement object to store skyscraper ad units. skyscraper_ad_unit_placement = { - :name => "Skyscraper AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 120x600', - :targeted_ad_unit_ids => [] + :name => 'Skyscraper AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 120x600', + :targeted_ad_unit_ids => [] } # Create local placement object to store medium square ad units. medium_square_ad_unit_placement = { - :name => "Medium Square AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 300x250', - :targeted_ad_unit_ids => [] + :name => 'Medium Square AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 300x250', + :targeted_ad_unit_ids => [] } # Create local placement object to store banner ad units. banner_ad_unit_placement = { - :name => "Banner AdUnit Placement #%d" % (Time.new.to_f * 1000), - :description => 'Contains ad units for creatives of size 468x60', - :targeted_ad_unit_ids => [] + :name => 'Banner AdUnit Placement - %d' % SecureRandom.uuid(), + :description => 'Contains ad units for creatives of size 468x60', + :targeted_ad_unit_ids => [] } # Get the first 500 ad units. - page = inventory_service.get_ad_units_by_statement( - DfpApi::FilterStatement.new('ORDER BY id ASC').toStatement()) + statement = dfp.new_statement_builder do |sb| + sb.order_by = 'id' + end + page = inventory_service.get_ad_units_by_statement(statement.to_statement()) # Separate the ad units by size. - if page and page[:results] + if !page.nil? && page[:results] page[:results].each do |ad_unit| - if ad_unit[:parent_id] and ad_unit[:sizes] + if !ad_unit[:parent_id].nil? && !ad_unit[:ad_unit_sizes].nil? ad_unit[:ad_unit_sizes].each do |ad_unit_size| size = ad_unit_size[:size] receiver = case size[:width] @@ -88,27 +79,37 @@ def create_placements() non_empty_placements = [ medium_square_ad_unit_placement, skyscraper_ad_unit_placement, - banner_ad_unit_placement].delete_if {|plc| plc.empty?} + banner_ad_unit_placement + ].reject {|plc| plc[:targeted_ad_unit_ids].empty?} # Create the placements on the server. - placements = placement_service.create_placements(non_empty_placements) + created_placements = placement_service.create_placements(non_empty_placements) # Display results. - if placements - placements.each do |placement| - puts "Placement with ID: %d and name: %s created with ad units: [%s]" % + if created_placements.to_a.size > 0 + created_placements.each do |placement| + puts 'Placement with ID %d and name "%s" created with ad units [%s].' % [placement[:id], placement[:name], placement[:targeted_ad_unit_ids].join(', ')] end else - raise 'No placements created.' + puts 'No placements created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_placements() + create_placements(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/placement_service/deactivate_placements.rb b/dfp_api/examples/v201802/placement_service/deactivate_placements.rb similarity index 78% rename from dfp_api/examples/v201705/placement_service/deactivate_placements.rb rename to dfp_api/examples/v201802/placement_service/deactivate_placements.rb index 1cc78dad2..19b51da29 100755 --- a/dfp_api/examples/v201705/placement_service/deactivate_placements.rb +++ b/dfp_api/examples/v201802/placement_service/deactivate_placements.rb @@ -21,41 +21,30 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_placements(dfp) # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) # Create statement to select active placements. - statement = DfpApi::FilterStatement.new( - 'WHERE status = :status', - [ - {:key => 'status', - :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end # Define initial values. placement_ids = [] + page = {:total_result_set_size => 0} begin # Get placements by statement. page = placement_service.get_placements_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |placement, index| - puts ("%d) Placement ID: %d, name: %s and status: %s will be " + - "deactivated.") % [index + statement.offset, placement[:id], + puts ('%d) Placement ID %d, name "%s", and status "%s" will be ' + + 'deactivated.') % [index + statement.offset, placement[:id], placement[:name], placement[:status]] placement_ids << placement[:id] end @@ -66,15 +55,18 @@ def deactivate_placements() if !placement_ids.empty? # Create a statement for action. - statement = DfpApi::FilterStatement.new( - "WHERE id IN (%s)" % placement_ids.join(', ')) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id IN (%s)' % placement_ids.join(', ') + end # Perform action. result = placement_service.perform_placement_action( - {:xsi_type => 'DeactivatePlacements'}, statement.toStatement()) + {:xsi_type => 'DeactivatePlacements'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 + if !result.nil? && result[:num_changes] > 0 puts "Number of placements deactivated: %d" % result[:num_changes] else puts 'No placements were deactivated.' @@ -85,8 +77,17 @@ def deactivate_placements() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_placements() + deactivate_placements(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/placement_service/get_active_placements.rb b/dfp_api/examples/v201802/placement_service/get_active_placements.rb new file mode 100755 index 000000000..9bdb4be32 --- /dev/null +++ b/dfp_api/examples/v201802/placement_service/get_active_placements.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active placements. + +require 'dfp_api' + +def get_active_placements(dfp) + # Get the PlacementService. + placement_service = dfp.service(:PlacementService, API_VERSION) + + # Create a statement to select placements. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end + + # Retrieve a small amount of placements at a time, paging + # through until all placements have been retrieved. + page = {:total_result_set_size => 0} + begin + page = placement_service.get_placements_by_statement( + statement.to_statement() + ) + + # Print out some information for each placement. + unless page[:results].nil? + page[:results].each_with_index do |placement, index| + puts '%d) Placement with ID %d and name "%s" was found.' % + [index + statement.offset, placement[:id], placement[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of placements: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_placements(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/placement_service/get_all_placements.rb b/dfp_api/examples/v201802/placement_service/get_all_placements.rb new file mode 100755 index 000000000..b515111e5 --- /dev/null +++ b/dfp_api/examples/v201802/placement_service/get_all_placements.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all placements. + +require 'dfp_api' + +def get_all_placements(dfp) + # Get the PlacementService. + placement_service = dfp.service(:PlacementService, API_VERSION) + + # Create a statement to select placements. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of placements at a time, paging + # through until all placements have been retrieved. + total_result_set_size = 0; + begin + # Get placements by statement. + page = placement_service.get_placements_by_statement( + statement.to_statement() + ) + + # Print out some information for each placement. + unless page[:results].nil? + total_result_set_size = page[:total_result_set_size] + page[:results].each_with_index do |placement, index| + puts '%d) Placement with ID %d and name "%s" was found.' % + [index + statement.offset, placement[:id], placement[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of placements: %d' % total_result_set_size +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_placements(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/placement_service/update_placements.rb b/dfp_api/examples/v201802/placement_service/update_placements.rb similarity index 61% rename from dfp_api/examples/v201705/placement_service/update_placements.rb rename to dfp_api/examples/v201802/placement_service/update_placements.rb index 2dfa2f43b..bb6e5b5d5 100755 --- a/dfp_api/examples/v201705/placement_service/update_placements.rb +++ b/dfp_api/examples/v201802/placement_service/update_placements.rb @@ -21,63 +21,53 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_placements() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_placements(dfp, placement_id) # Get the PlacementService. placement_service = dfp.service(:PlacementService, API_VERSION) - placement_id = 'INSERT_PLACEMENT_ID_HERE'.to_i - # Create a statement to get a single placement by ID. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [{ - :key => 'id', - :value => {:value => placement_id, :xsi_type => 'NumberValue'} - }], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :placement_id' + sb.with_bind_variable('placement_id', placement_id) + sb.limit = 1 + end # Get placements by statement. - page = placement_service.get_placements_by_statement(statement.toStatement()) - - if page[:results] - placements = page[:results] + response = placement_service.get_placements_by_statement( + statement.to_statement() + ) + raise 'No placements found to update.' if response[:results].to_a.empty? + placement = response[:results].first - # Change the description of the local placement. The server isn't affected - # yet. - placement = placements.first - placement[:description] = 'This placement contains all leaderboards.' + # Change the description of the placement object. + placement[:description] = 'This placement contains all leaderboards.' - # Update the placements on the server. - return_placements = placement_service.update_placements([placement]) + # Update the placements on the server. + updated_placements = placement_service.update_placements([placement]) - if return_placements - return_placements.each do |placement| - puts ("Placement ID: %d, name: %s was updated with AdSense targeting " + - "enabled: %s.") % [placement[:id], placement[:name], - placement[:is_ad_sense_targeting_enabled]] - end - else - raise 'No placements were updated.' + if updated_placements.to_a.size > 0 + updated_placements.each do |placement| + puts 'Placement with ID %d and name "%s" was updated.' % + [placement[:id], placement[:name]] end else - puts 'No placements found to update.' + puts 'No placements were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_placements() + placement_id = 'INSERT_PLACEMENT_ID_HERE'.to_i + update_placements(dfp, placement_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/premium_rate_service/get_all_premium_rates.rb b/dfp_api/examples/v201802/premium_rate_service/get_all_premium_rates.rb new file mode 100755 index 000000000..88bf709b6 --- /dev/null +++ b/dfp_api/examples/v201802/premium_rate_service/get_all_premium_rates.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all premium rates. + +require 'dfp_api' + +def get_all_premium_rates(dfp) + premium_rate_service = dfp.service(:PremiumRateService, API_VERSION) + + # Create a statement to select premium rates. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of premium rates at a time, paging + # through until all premium rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = premium_rate_service.get_premium_rates_by_statement( + statement.to_statement() + ) + + # Print out some information for each premium rate. + unless page[:results].nil? + page[:results].each_with_index do |premium_rate, index| + puts ('%d) Premium rate with ID %d, premium feature "%s", and rate ' + + 'card ID %d was found.') % [index + statement.offset, + premium_rate[:id], premium_rate[:xsi_type], + premium_rate[:rate_card_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of premium rates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_premium_rates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/premium_rate_service/get_premium_rates_for_rate_card.rb b/dfp_api/examples/v201802/premium_rate_service/get_premium_rates_for_rate_card.rb new file mode 100755 index 000000000..11f9885d1 --- /dev/null +++ b/dfp_api/examples/v201802/premium_rate_service/get_premium_rates_for_rate_card.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all premium rates on a specific rate card. + +require 'dfp_api' + +def get_premium_rates_for_rate_card(dfp, rate_card_id) + # Get the PremiumRateService. + premium_rate_service = dfp.service(:PremiumRateService, API_VERSION) + + # Create a statement to select premium rates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'rateCardId = :rate_card_id' + sb.with_bind_variable('rate_card_id', rate_card_id) + end + + # Retrieve a small amount of premium rates at a time, paging + # through until all premium rates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = premium_rate_service.get_premium_rates_by_statement( + statement.to_statement() + ) + + # Print out some information for each premium rate. + unless page[:results].nil? + page[:results].each_with_index do |premium_rate, index| + puts ('%d) Premium rate with ID %d, premium feature "%s", and rate ' + + 'card ID %d was found.') % [index + statement.offset, + premium_rate[:id], premium_rate[:xsi_type], + premium_rate[:rate_card_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of premium rates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + rate_card_id = 'INSERT_RATE_CARD_ID_HERE'.to_i + get_premium_rates_for_rate_card(dfp, rate_card_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_package_item_service/get_all_product_package_items.rb b/dfp_api/examples/v201802/product_package_item_service/get_all_product_package_items.rb new file mode 100755 index 000000000..25a5a9dd8 --- /dev/null +++ b/dfp_api/examples/v201802/product_package_item_service/get_all_product_package_items.rb @@ -0,0 +1,85 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all product package items. + +require 'dfp_api' + +def get_all_product_package_items(dfp) + # Get the ProductPackageItemService. + product_package_item_service = + dfp.service(:ProductPackageItemService, API_VERSION) + + # Create a statement to select product package items. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of product package items at a time, paging + # through until all product package items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_item_service.get_product_package_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each product package item. + unless page[:results].nil? + page[:results].each_with_index do |product_package_item, index| + puts ('%d) Product package item with ID %d, product id %d, and ' + + 'product package id %d was found.') % [index + statement.offset, + product_package_item[:id], product_package_item[:product_id], + product_package_item[:product_package_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product package items: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_product_package_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_package_item_service/get_product_package_items_for_product_package.rb b/dfp_api/examples/v201802/product_package_item_service/get_product_package_items_for_product_package.rb new file mode 100755 index 000000000..6019734d8 --- /dev/null +++ b/dfp_api/examples/v201802/product_package_item_service/get_product_package_items_for_product_package.rb @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all product package items belonging to a product package. + +require 'dfp_api' + +def get_product_package_items_for_product_package(dfp, product_package_id) + # Get the ProductPackageItemService. + product_package_item_service = + dfp.service(:ProductPackageItemService, API_VERSION) + + # Create a statement to select product package items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'productPackageId = :product_package_id' + sb.with_bind_variable('product_package_id', product_package_id) + end + + # Retrieve a small amount of product package items at a time, paging + # through until all product package items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_item_service.get_product_package_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each product package item. + unless page[:results].nil? + page[:results].each_with_index do |product_package_item, index| + puts ('%d) Product package item with ID %d, product ID %d, and ' + + 'product package ID %d was found.') % [index + statement.offset, + product_package_item[:id], product_package_item[:product_id], + product_package_item[:product_package_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product package items: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + product_package_id = 'INSERT_PRODUCT_PACKAGE_ID_HERE'.to_i + get_product_package_items_for_product_package(dfp, product_package_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_package_service/get_active_product_packages.rb b/dfp_api/examples/v201802/product_package_service/get_active_product_packages.rb new file mode 100755 index 000000000..fde3f36d9 --- /dev/null +++ b/dfp_api/examples/v201802/product_package_service/get_active_product_packages.rb @@ -0,0 +1,85 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all active product packages. + +require 'dfp_api' + +def get_active_product_packages(dfp) + # Get the ProductPackageService. + product_package_service = dfp.service(:ProductPackageService, API_VERSION) + + # Create a statement to select product packages. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'ACTIVE') + end + + # Retrieve a small amount of product packages at a time, paging + # through until all product packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_service.get_product_packages_by_statement( + statement.to_statement() + ) + + # Print out some information for each product package. + unless page[:results].nil? + page[:results].each_with_index do |product_package, index| + puts '%d) Product package with ID %d and name "%s" was found.' % + [index + statement.offset, product_package[:id], + product_package[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_active_product_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_package_service/get_all_product_packages.rb b/dfp_api/examples/v201802/product_package_service/get_all_product_packages.rb new file mode 100755 index 000000000..10b614333 --- /dev/null +++ b/dfp_api/examples/v201802/product_package_service/get_all_product_packages.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all product packages. + +require 'dfp_api' + +def get_all_product_packages(dfp) + # Get the ProductPackageService. + product_package_service = dfp.service(:ProductPackageService, API_VERSION) + + # Create a statement to select product packages. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of product packages at a time, paging + # through until all product packages have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_package_service.get_product_packages_by_statement( + statement.to_statement() + ) + + # Print out some information for each product package. + unless page[:results].nil? + page[:results].each_with_index do |product_package, index| + puts '%d) Product package with ID %d and name "%s" was found.' % + [index + statement.offset,product_package[:id], + product_package[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product packages: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_product_packages(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_service/get_all_products.rb b/dfp_api/examples/v201802/product_service/get_all_products.rb new file mode 100755 index 000000000..9e37ecf3c --- /dev/null +++ b/dfp_api/examples/v201802/product_service/get_all_products.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all products. + +require 'dfp_api' + +def get_all_products(dfp) + # Get the ProductService. + product_service = dfp.service(:ProductService, API_VERSION) + + # Create a statement to select products. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of products at a time, paging + # through until all products have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_service.get_products_by_statement( + statement.to_statement() + ) + + # Print out some information for each product. + unless page[:results].nil? + page[:results].each_with_index do |product, index| + puts '%d) Product with ID %d and name "%s" was found.' % + [index + statement.offset, product[:id], product[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of products: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_products(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_service/get_products_for_product_template.rb b/dfp_api/examples/v201802/product_service/get_products_for_product_template.rb new file mode 100755 index 000000000..18264cf1b --- /dev/null +++ b/dfp_api/examples/v201802/product_service/get_products_for_product_template.rb @@ -0,0 +1,84 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all products created from a product template. + +require 'dfp_api' + +def get_products_for_product_template(dfp, product_template_id) + # Get the ProductService. + product_service = dfp.service(:ProductService, API_VERSION) + + # Create a statement to select products. + statement = dfp.new_statement_builder do |sb| + sb.where = 'productTemplateId = :product_template_id' + sb.with_bind_variable('product_template_id', product_template_id) + end + + # Retrieve a small number of products at a time, paging through until all + # products have been retrieved. + page = {:total_result_set_size => 0}; + begin + # Get products by statement. + page = product_service.get_products_by_statement( + statement.to_statement() + ) + + # Display some information about each product. + unless page[:results].nil? + page[:results].each_with_index do |product, index| + puts '%d) Product with ID %d and name "%s" was found.' % + [index + statement.offset, product[:id], product[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of products: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + product_template_id = 'INSERT_PRODUCT_TEMPLATE_ID_HERE'.to_i + get_products_for_product_template(dfp, product_template_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_template_service/get_all_product_templates.rb b/dfp_api/examples/v201802/product_template_service/get_all_product_templates.rb new file mode 100755 index 000000000..94dc108bc --- /dev/null +++ b/dfp_api/examples/v201802/product_template_service/get_all_product_templates.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all product templates. + +require 'dfp_api' + +def get_all_product_templates(dfp) + # Get the ProductTemplateService. + product_template_service = dfp.service(:ProductTemplateService, API_VERSION) + + # Create a statement to select product templates. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of product templates at a time, paging + # through until all product templates have been retrieved. + page = {:total_result_set_size => 0} + begin + page = product_template_service.get_product_templates_by_statement( + statement.to_statement() + ) + + # Print out some information for each product template. + unless page[:results].nil? + page[:results].each_with_index do |product_template, index| + puts '%d) Product template with ID %d and name "%s" was found.' % + [index + statement.offset, product_template[:id], + product_template[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product templates: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_product_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/product_template_service/get_sponsorship_product_templates.rb b/dfp_api/examples/v201802/product_template_service/get_sponsorship_product_templates.rb new file mode 100755 index 000000000..12591bbfb --- /dev/null +++ b/dfp_api/examples/v201802/product_template_service/get_sponsorship_product_templates.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all sponsorship product templates. +require 'dfp_api' + +def get_sponsorship_product_templates(dfp) + # Get the ProductTemplateService. + product_template_service = dfp.service(:ProductTemplateService, API_VERSION) + + # Create a statement to select product templates. + statement = dfp.new_statement_builder do |sb| + sb.where = 'lineItemType = :line_item_type' + sb.with_bind_variable('line_item_type', 'SPONSORSHIP') + end + + # Retrieve a small amount of product templates at a time, paging + # through until all product templates have been retrieved. + total_result_set_size = 0; + begin + page = product_template_service.get_product_templates_by_statement( + statement.to_statement() + ) + + # Print out some information for each product template. + if page[:results] + total_result_set_size = page[:total_result_set_size] + page[:results].each_with_index do |product_template, index| + puts '%d) Product template with ID %d and name "%s" was found.' % + [index + statement.offset, product_template[:id], + product_template[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of product templates: %d' % + total_result_set_size +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_sponsorship_product_templates(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_line_item_service/archive_proposal_line_item.rb b/dfp_api/examples/v201802/proposal_line_item_service/archive_proposal_line_item.rb new file mode 100755 index 000000000..e1a1b9a2a --- /dev/null +++ b/dfp_api/examples/v201802/proposal_line_item_service/archive_proposal_line_item.rb @@ -0,0 +1,100 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example archives a proposal line item. To determine which proposal +# line items exist, run get_all_proposal_line_items.rb. + +require 'dfp_api' + +def archive_proposal_line_item(dfp, proposal_line_item_id) + # Get the ProposalLineItemService. + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Create a statement to select a single proposal line item. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_line_item_id' + sb.with_bind_variable('proposal_line_item_id', proposal_line_item_id) + sb.limit = 1 + end + + # Retrieve a small number of proposal line items at a time, paging through + # until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get proposal line items by statement. + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + + # Display some information about each proposal line item. + unless page[:results].nil? + page[:results].each do |proposal_line_item| + puts ('Proposal line item with ID %d and name "%s", belonging to ' + + 'proposal with ID %d, will be archived.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + # Perform action. + result = proposal_line_item_service.perform_proposal_line_item_action( + {:xsi_type => 'ArchiveProposalLineItems'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of proposal line items archived: %d" % result[:num_changes] + else + puts 'No proposal line items archived.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_line_item_id = 'INSERT_PROPOSAL_LINE_ITEM_ID_HERE'.to_i + archive_proposal_line_item(dfp, proposal_line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_line_item_service/create_proposal_line_item.rb b/dfp_api/examples/v201802/proposal_line_item_service/create_proposal_line_item.rb new file mode 100755 index 000000000..44b27fd5a --- /dev/null +++ b/dfp_api/examples/v201802/proposal_line_item_service/create_proposal_line_item.rb @@ -0,0 +1,129 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates a programmatic proposal line item. This example does not +# work for networks with DFP sales management enabled. + +require 'securerandom' +require 'dfp_api' + +def create_proposal_line_item(dfp, proposal_id) + # Get the NetworkService and ProposalLineItemService. + network_service = dfp.service(:NetworkService, API_VERSION) + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Get the current network's root ad unit ID. + current_network = network_service.get_current_network() + root_ad_unit_id = current_network[:effective_root_ad_unit_id].to_i + + # Specify the start and end times to be set on the proposal line item. + now = dfp.now('America/New_York') + one_year_from_now = now + 365 * 24 * 60 * 60 + + # Create proposal line item configuration object. + proposal_line_item = { + :marketplace_info => { + :ad_exchange_environment => 'DISPLAY' + }, + :name => 'Proposal Line Item %s' % SecureRandom.uuid(), + :proposal_id => proposal_id, + :line_item_type => 'STANDARD', + :targeting => { + :inventory_targeting => { + :targeted_ad_units => [{ + :ad_unit_id => root_ad_unit_id + }] + }, + :technology_targeting => { + :device_capability_targeting => { + # Exclude Mobile Apps (required for Ad Exchange DISPLAY environment). + :excluded_device_capabilities => [{:id => 5005}] + } + } + }, + :start_date_time => now.to_h, + :end_date_time => one_year_from_now.to_h, + :creative_placeholders => [ + {:size => {:width => 300, :height => 250}}, + {:size => {:width => 120, :height => 600}} + ], + :goal => { + :units => 1000, + :unit_type => 'IMPRESSIONS' + }, + :net_cost => { + :currency_code => 'USD', + :micro_amount => 2_000_000 + }, + :net_rate => { + :currency_code => 'USD', + :micro_amount => 2_000_000 + }, + :rate_type => 'CPM', + :delivery_rate_type => 'EVENLY' + } + + # Create the proposal line item on the server. + created_proposal_line_items = proposal_line_item_service. + create_proposal_line_items([proposal_line_item]) + + # Display the results. + if created_proposal_line_items.to_a.size > 0 + created_proposal_line_items.each do |proposal_line_item| + puts ('A programmatic proposal line item with ID %d and name "%s", ' + 'belonging to proposal with ID %d, was created.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + else + puts 'No programmatic proposal line items were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + create_proposal_line_item(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_line_item_service/get_all_proposal_line_items.rb b/dfp_api/examples/v201802/proposal_line_item_service/get_all_proposal_line_items.rb new file mode 100755 index 000000000..d14a7a25a --- /dev/null +++ b/dfp_api/examples/v201802/proposal_line_item_service/get_all_proposal_line_items.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all proposal line items. + +require 'dfp_api' + +def get_all_proposal_line_items(dfp) + # Get the ProposalLineItemService. + proposal_line_item_service = + dfp.service(:ProposalLineItemService, API_VERSION) + + # Create a statement to select proposal line items. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of proposal line items at a time, paging + # through until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each proposal line item. + unless page[:results].nil? + page[:results].each_with_index do |proposal_line_item, index| + puts '%d) Proposal line item with ID %d and name "%s" was found.' % + [index + statement.offset, proposal_line_item[:id], + proposal_line_item[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of proposal line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_proposal_line_items(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_line_item_service/get_proposal_line_items_for_proposal.rb b/dfp_api/examples/v201802/proposal_line_item_service/get_proposal_line_items_for_proposal.rb new file mode 100755 index 000000000..90311bab8 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_line_item_service/get_proposal_line_items_for_proposal.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all proposal line items belonging to a specific proposal. + +require 'dfp_api' + +def get_proposal_line_items_for_proposal(dfp, proposal_id) + proposal_line_item_service = + dfp.service(:ProposalLineItemService, API_VERSION) + + # Create a statement to select proposal line items. + statement = dfp.new_statement_builder do |sb| + sb.where = 'proposalId = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + end + + # Retrieve a small amount of proposal line items at a time, paging + # through until all proposal line items have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + + # Print out some information for each proposal line item. + unless page[:results].nil? + page[:results].each_with_index do |proposal_line_item, index| + puts '%d) Proposal line item with ID %d and name "%s" was found.' % + [index + statement.offset, proposal_line_item[:id], + proposal_line_item[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of proposal line items: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + get_proposal_line_items_for_proposal(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_line_item_service/update_proposal_line_item.rb b/dfp_api/examples/v201802/proposal_line_item_service/update_proposal_line_item.rb new file mode 100755 index 000000000..cd92c7804 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_line_item_service/update_proposal_line_item.rb @@ -0,0 +1,95 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates a proposal line item. To determine which proposal line +# items exist, run get_all_proposal_line_items.rb. + +require 'dfp_api' + +def update_proposal_line_item(dfp, proposal_line_item_id) + # Get the ProposalLineItemService. + proposal_line_item_service = dfp.service( + :ProposalLineItemService, API_VERSION + ) + + # Create a statement to select a single proposal line item. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_line_item_id' + sb.with_bind_variable('proposal_line_item_id', proposal_line_item_id) + sb.limit = 1 + end + + # Get the proposal line item. + response = proposal_line_item_service.get_proposal_line_items_by_statement( + statement.to_statement() + ) + if response[:results].to_a.size < 1 + raise 'No proposal line items found to update.' + end + proposal_line_item = response[:results].first + + # Update proposal line item's notes field + proposal_line_item[:internal_notes] = 'Proposal line item is ready to submit.' + + # Send updated proposal line item to the server. + updated_proposal_line_items = proposal_line_item_service. + update_proposal_line_items([proposal_line_item]) + + # Display the results. + if updated_proposal_line_items.to_a.size > 0 + updated_proposal_line_items.each do |proposal_line_item| + puts ('Proposal line item with ID %d and name "%s", belonging to ' + + 'proposal with ID %d, was updated.') % + [proposal_line_item[:id], proposal_line_item[:name], + proposal_line_item[:proposal_id]] + end + else + puts 'No proposal line items were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_line_item_id = 'INSERT_PROPOSAL_LINE_ITEM_ID_HERE'.to_i + update_proposal_line_item(dfp, proposal_line_item_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/create_proposal.rb b/dfp_api/examples/v201802/proposal_service/create_proposal.rb new file mode 100755 index 000000000..90962cdd5 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/create_proposal.rb @@ -0,0 +1,91 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example creates a programmatic proposal. This example does not work for +# networks with DFP sales management enabled. + +require 'securerandom' +require 'dfp_api' + +def create_proposal(dfp, primary_salesperson_id, primary_trafficker_id, + buyer_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create proposal configuration object. + proposal = { + :marketplace_info => { + :buyer_account_id => buyer_id + }, + :is_programmatic => true, + :name => 'Proposal %s' % SecureRandom.uuid(), + :primary_salesperson => { + :user_id => primary_salesperson_id, + :split => 100_000 + }, + :primary_trafficker_id => primary_trafficker_id + } + + # Create the proposal on the server. + created_proposals = proposal_service.create_proposals([proposal]) + + # Display the results. + if created_proposals.to_a.size > 0 + created_proposals.each do |proposal| + puts 'A programmatic proposal with ID %d and name "%s" was created.' % + [proposal[:id], proposal[:name]] + end + else + puts 'No programmatic proposals were created.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + primary_salesperson_id = 'INSERT_PRIMARY_SALESPERSON_ID_HERE'.to_i + primary_trafficker_id = 'INSERT_PRIMARY_TRAFFICKER_ID_HERE'.to_i + buyer_id = 'INSERT_BUYER_ID_FROM_PQL_TABLE_HERE'.to_i + create_proposal( + dfp, primary_salesperson_id, primary_trafficker_id, buyer_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/get_all_proposals.rb b/dfp_api/examples/v201802/proposal_service/get_all_proposals.rb new file mode 100755 index 000000000..0457876c3 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/get_all_proposals.rb @@ -0,0 +1,79 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all proposals. + +require 'dfp_api' + +def get_all_proposals(dfp) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select proposals. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of proposals at a time, paging through until all + # proposals have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_service.get_proposals_by_statement(statement.to_statement()) + + # Print out some information for each proposal. + unless page[:results].nil? + page[:results].each_with_index do |proposal, index| + puts '%d) Proposal with ID %d and name "%s" was found.' % + [index + statement.offset, proposal[:id], proposal[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size + + puts 'Total number of proposals: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_proposals(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/get_marketplace_comments.rb b/dfp_api/examples/v201802/proposal_service/get_marketplace_comments.rb new file mode 100755 index 000000000..11932c596 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/get_marketplace_comments.rb @@ -0,0 +1,78 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets the Marketplace comments for a programmatic proposal. + +require 'dfp_api' + +def get_marketplace_comments(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select marketplace comments. + statement = dfp.new_statement_builder do |sb| + sb.where = 'proposalId = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + end + + # Retrieve comments. + page = proposal_service.get_marketplace_comments_by_statement( + statement.to_statement() + ) + + # Print out some information for each comment. + unless page[:results].nil? + page[:results].each_with_index do |comment, index| + puts ('%d) Comment Marketplace comment with creation time "%s" and ' + + 'comment "%s" was found.') % [index + statement.offset, + comment[:proposal_id], comment[:creation_time], comment[:comment]] + end + end + puts 'Total number of comments: %d' % (page[:total_result_set_size] || 0) +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + get_marketplace_comments(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/get_proposals_pending_approval.rb b/dfp_api/examples/v201802/proposal_service/get_proposals_pending_approval.rb new file mode 100755 index 000000000..a128d802c --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/get_proposals_pending_approval.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all proposals pending approval. + +require 'dfp_api' + +def get_proposals_pending_approval(dfp) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select proposals. + statement = dfp.new_statement_builder do |sb| + sb.where = 'status = :status' + sb.with_bind_variable('status', 'PENDING_APPROVAL') + end + + # Retrieve a small amount of proposals at a time, paging through until all + # proposals have been retrieved. + page = {:total_result_set_size => 0} + begin + page = proposal_service.get_proposals_by_statement(statement.to_statement()) + + # Print out some information for each proposal. + unless page[:results].nil? + page[:results].each_with_index do |proposal, index| + puts '%d) Proposal with ID %d and name "%s" was found.' % + [index + statement.offset, proposal[:id], proposal[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < total_result_set_size + + puts 'Total number of proposals: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_proposals_pending_approval(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/request_buyer_acceptance.rb b/dfp_api/examples/v201802/proposal_service/request_buyer_acceptance.rb new file mode 100755 index 000000000..f84b0cb91 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/request_buyer_acceptance.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example requests buyer acceptance for a single proposal. To determine +# which proposals exist, run get_all_proposals.rb. + +require 'dfp_api' + +def request_buyer_acceptance(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select a single proposal. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + sb.limit = 1 + end + + # Get the proposal. + response = proposal_service.get_proposals_by_statement( + statement.to_statement() + ) + if response[:results].to_a.size < 1 + raise 'No proposals found to push to Marketplace.' + end + proposal = response[:results].first + + # Display some information about the proposal to be updated. + puts ('Programmatic proposal with ID %d, name "%s", and status "%s" ' + + 'will be pushed to Marketplace.') % [proposal[:id], proposal[:name], + proposal[:status]] + + # Perform action. + result = proposal_service.perform_proposal_action( + {:xsi_type => 'RequestBuyerAcceptance'}, statement.to_statement() + ) + + # Display the results. + if !result.nil? && result[:num_changes].to_i > 0 + puts "Number of programmatic proposals pushed to Marketplace: %d" % + result[:num_changes] + else + puts 'No programmatic proposals were pushed to Marketplace.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + request_buyer_acceptance(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/proposal_service/update_proposal.rb b/dfp_api/examples/v201802/proposal_service/update_proposal.rb new file mode 100755 index 000000000..7a1ac8f04 --- /dev/null +++ b/dfp_api/examples/v201802/proposal_service/update_proposal.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example updates the notes of a single proposal. To determine which +# proposals exist, run get_all_proposals.rb. + +require 'dfp_api' + +def update_proposal(dfp, proposal_id) + # Get the ProposalService. + proposal_service = dfp.service(:ProposalService, API_VERSION) + + # Create a statement to select a single proposal. + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :proposal_id' + sb.with_bind_variable('proposal_id', proposal_id) + sb.limit = 1 + end + + # Get the proposal. + response = proposal_service.get_proposals_by_statement( + statement.to_statement() + ) + raise 'No proposals found to update.' if response[:results].to_a.size < 1 + proposal = response[:results].first + + # Update the proposal by changing its notes. + proposal[:internal_notes] = 'Proposal needs review before approval.' + + # Send update to the server. + updated_proposals = proposal_service.update_proposals([proposal]) + + # Display the results. + if updated_proposals.to_a.size > 0 + updated_proposals.each do |proposal| + puts 'Proposal with ID %d and name "%s" was updated.' % + [proposal[:id], proposal[:name]] + end + else + puts 'No proposals were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + proposal_id = 'INSERT_PROPOSAL_ID_HERE'.to_i + update_proposal(dfp, proposal_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/publisher_query_language_service/fetch_match_tables.rb b/dfp_api/examples/v201802/publisher_query_language_service/fetch_match_tables.rb similarity index 73% rename from dfp_api/examples/v201705/publisher_query_language_service/fetch_match_tables.rb rename to dfp_api/examples/v201802/publisher_query_language_service/fetch_match_tables.rb index aa30721aa..1e83f4e2d 100755 --- a/dfp_api/examples/v201705/publisher_query_language_service/fetch_match_tables.rb +++ b/dfp_api/examples/v201802/publisher_query_language_service/fetch_match_tables.rb @@ -21,25 +21,12 @@ # # A full list of available tables can be found at: # -# https://developers.google.com/doubleclick-publishers/docs/reference/v201705/PublisherQueryLanguageService +# https://developers.google.com/doubleclick-publishers/docs/reference/v201802/PublisherQueryLanguageService require 'tempfile' - require 'dfp_api' - -API_VERSION = :v201705 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = ',' - -def fetch_match_tables() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def fetch_match_tables(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) @@ -47,16 +34,19 @@ def fetch_match_tables() fetch_tables = ['Line_Item', 'Ad_Unit'] fetch_tables.each do |table| - results_file_path = fetch_match_table(table, pql_service) - puts "%s table saved to:\n\t%s" % [table, results_file_path] + results_file_path = fetch_match_table(dfp, table, pql_service) + puts '%s table saved to:\n\t%s' % [table, results_file_path] end end # Fetches a match table from a PQL statement and writes it to a file. -def fetch_match_table(table_name, pql_service) +def fetch_match_table(dfp, table_name, pql_service) # Create a statement to select all items for the table. - statement = DfpApi::FilterStatement.new( - 'SELECT Id, Name, Status FROM %s ' % table_name + 'ORDER BY Id ASC') + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = table_name + sb.order_by = 'Id' + end # Set initial values. file_path = '%s.csv' % table_name @@ -64,30 +54,43 @@ def fetch_match_table(table_name, pql_service) open(file_path, 'wb') do |file| file_path = file.path() begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Only write column names if the first page. - if (offset == 0) + if statement.offset == 0 columns = result_set[:column_types].collect {|col| col[:label_name]} - file.write(columns.join(COLUMN_SEPARATOR) + "\n") + file.write(columns.join(COLUMN_SEPARATOR) + '\n') end # Print out every row. result_set[:rows].each do |row_set| row = row_set[:values].collect {|item| item[:value]} - file.write(row.join(COLUMN_SEPARATOR) + "\n") + file.write(row.join(COLUMN_SEPARATOR) + '\n') end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while result_set[:rows].size == statement.limit end return file_path end if __FILE__ == $0 + API_VERSION = :v201802 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = ',' + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - fetch_match_tables() + fetch_match_tables(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/publisher_query_language_service/get_all_browsers.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_all_browsers.rb new file mode 100755 index 000000000..5f1a155ab --- /dev/null +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_all_browsers.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all browsers available to target from the Browser table. +# The Browser PQL table schema can be found here: +# +# https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService + +require 'dfp_api' + +def get_all_browsers(dfp) + # Get the PublisherQueryLanguageService. + pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) + + # Build a statement to select all line items. + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, BrowserName, MajorVersion, MinorVersion' + sb.from = 'Browser' + sb.order_by = 'BrowserName' + end + + # Set initial values for paging. + result_set, all_rows = nil, 0 + + # Get all line items with paging. + begin + result_set = pql_service.select(statement.to_statement()) + + unless result_set.nil? + # Print out columns header. + columns = result_set[:column_types].collect {|col| col[:label_name]} + puts columns.join(COLUMN_SEPARATOR) + + # Print out every row. + result_set[:rows].each do |row_set| + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) + end + end + + statement.offset += statement.limit + all_rows += result_set[:rows].size + end while result_set[:rows].size == statement.limit + + puts "Total number of rows found: %d" % all_rows +end + +if __FILE__ == $0 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_browsers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/publisher_query_language_service/get_all_line_items.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_all_line_items.rb similarity index 74% rename from dfp_api/examples/v201705/publisher_query_language_service/get_all_line_items.rb rename to dfp_api/examples/v201802/publisher_query_language_service/get_all_line_items.rb index 5eae74a99..8ab1c83ad 100755 --- a/dfp_api/examples/v201705/publisher_query_language_service/get_all_line_items.rb +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_all_line_items.rb @@ -23,59 +23,61 @@ require 'dfp_api' - -API_VERSION = :v201705 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_all_line_items() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_all_line_items(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Statement parts to help build a statement to select all line items. - statement = DfpApi::FilterStatement.new( - 'SELECT Id, Name, Status FROM Line_Item ORDER BY Id ASC') + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = 'Line_Item' + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all line items with paging. begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Print out columns header. columns = result_set[:column_types].collect {|col| col[:label_name]} puts columns.join(COLUMN_SEPARATOR) # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts 'Total number of rows found: %d' % row_count end if __FILE__ == $0 + API_VERSION = :v201802 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = '\t' + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_all_line_items() + get_all_line_items(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/publisher_query_language_service/get_all_programmatic_buyers.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_all_programmatic_buyers.rb new file mode 100755 index 000000000..f938c093c --- /dev/null +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_all_programmatic_buyers.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all programmatic buyer information from the PQL table. The +# Programmatic_Buyer PQL table schema can be found here: +# +# https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService + +require 'dfp_api' + +def get_all_programmatic_buyers(dfp) + # Get the PublisherQueryLanguageService. + pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) + + # Build a statement to select all programmatic buyers. + statement = dfp.new_statement_builder do |sb| + sb.select = 'BuyerAccountId, Name' + sb.from = 'Programmatic_Buyer' + sb.order_by = 'BuyerAccountId' + end + + # Set initial values for paging. + result_set, all_rows = nil, 0 + + # Get all programmatic buyers with paging. + begin + result_set = pql_service.select(statement.to_statement()) + + unless result_set.nil? + # Print out columns header. + columns = result_set[:column_types].collect {|col| col[:label_name]} + puts columns.join(COLUMN_SEPARATOR) + + # Print out every row. + result_set[:rows].each do |row_set| + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) + end + end + + statement.offset += statement.limit + all_rows += result_set[:rows].size + end while result_set[:rows].size == statement.limit + + puts "Total number of rows found: %d" % all_rows +end + +if __FILE__ == $0 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_programmatic_buyers(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/publisher_query_language_service/get_geo_targets.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_geo_targets.rb similarity index 68% rename from dfp_api/examples/v201705/publisher_query_language_service/get_geo_targets.rb rename to dfp_api/examples/v201802/publisher_query_language_service/get_geo_targets.rb index 9b3209146..4babca9f6 100755 --- a/dfp_api/examples/v201705/publisher_query_language_service/get_geo_targets.rb +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_geo_targets.rb @@ -23,62 +23,65 @@ require 'dfp_api' - -API_VERSION = :v201705 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_geo_targets() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_geo_targets(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Create a statement to select all targetable cities. - statement_text = "SELECT Id, Name, CanonicalParentId, ParentIds, " + - "CountryCode, Type, Targetable FROM Geo_Target WHERE Type = 'City' " + - "AND Targetable = true ORDER BY Id ASC" - - statement = DfpApi::FilterStatement.new(statement_text) + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, CanonicalParentId, ParentIds, CountryCode, Type, ' + + 'Targetable' + sb.from = 'Geo_Target' + sb.where = 'Type = :type AND Targetable = :targetable' + sb.with_bind_variable('type', 'City') + sb.with_bind_variable('targetable', true) + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all cities with paging. begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) - if result_set + unless result_set.nil? # Print out columns header. columns = result_set[:column_types].collect {|col| col[:label_name]} puts columns.join(COLUMN_SEPARATOR) # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts "Total number of rows found: %d" % row_count end if __FILE__ == $0 + API_VERSION = :v201802 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_geo_targets() + get_geo_targets(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/publisher_query_language_service/get_line_items_named_like.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_line_items_named_like.rb similarity index 72% rename from dfp_api/examples/v201705/publisher_query_language_service/get_line_items_named_like.rb rename to dfp_api/examples/v201802/publisher_query_language_service/get_line_items_named_like.rb index 7a2ebf9e6..5645d2421 100755 --- a/dfp_api/examples/v201705/publisher_query_language_service/get_line_items_named_like.rb +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_line_items_named_like.rb @@ -21,35 +21,24 @@ require 'dfp_api' - -API_VERSION = :v201705 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_line_items_named_like() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_line_items_named_like(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) # Create a statement to select all line items matching subtext. - statement_text = - "SELECT Id, Name, Status FROM Line_Item WHERE Name LIKE 'line item%%' " + - "ORDER BY Id ASC" - - statement = DfpApi::FilterStatement.new(statement_text) + statement = dfp.new_statement_builder do |sb| + sb.select = 'Id, Name, Status' + sb.from = 'Line_Item' + sb.where = 'Name LIKE \'line item %%\'' + sb.order_by = 'Id' + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 # Get all line items starting with "line item". begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) if result_set # Print out columns header. @@ -58,25 +47,36 @@ def get_line_items_named_like() # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + puts row.join(COLUMN_SEPARATOR) end end # Update the counters. - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT - all_rows += result_set[:rows].size - end while result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + row_count += result_set[:rows].size + end while result_set[:rows].size == statement.limit # Print a footer. - if result_set[:rows] - puts "Total number of rows found: %d" % all_rows - end + puts "Total number of rows found: %d" % row_count end if __FILE__ == $0 + API_VERSION = :v201802 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_line_items_named_like() + get_line_items_named_like(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/publisher_query_language_service/get_recent_changes.rb b/dfp_api/examples/v201802/publisher_query_language_service/get_recent_changes.rb similarity index 57% rename from dfp_api/examples/v201705/publisher_query_language_service/get_recent_changes.rb rename to dfp_api/examples/v201802/publisher_query_language_service/get_recent_changes.rb index 54fc73433..d7c5abb48 100755 --- a/dfp_api/examples/v201705/publisher_query_language_service/get_recent_changes.rb +++ b/dfp_api/examples/v201802/publisher_query_language_service/get_recent_changes.rb @@ -22,41 +22,55 @@ # A full list of available tables can be found at # https://developers.google.com/doubleclick-publishers/docs/reference/latest/PublisherQueryLanguageService -require 'date' - require 'dfp_api' -API_VERSION = :v201705 -# A string to separate columns in output. Use "," to get CSV. -COLUMN_SEPARATOR = "\t" - -def get_recent_changes() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_recent_changes(dfp) # Get the PublisherQueryLanguageService. pql_service = dfp.service(:PublisherQueryLanguageService, API_VERSION) - start_date_time = DateTime.parse(Date.today.to_s). - strftime('%Y-%m-%dT%H:%M:%S') - end_date_time = DateTime.parse((Date.today - 1).to_s). - strftime('%Y-%m-%dT%H:%M:%S') + # Set end_time to the beginning of today. + today = dfp.today() + end_time = dfp.datetime( + today.year, + today.month, + today.day, + 0, + 0, + 0, + 'America/New_York' + ) + + # Set start_time to the beginning of yesterday. + yesterday = today - 1 + start_time = dfp.datetime( + yesterday.year, + yesterday.month, + yesterday.day, + 0, + 0, + 0, + 'America/New_York' + ) # Create a statement to select recent changes. Change_History only supports # ordering by descending ChangeDateTime. To prevent complications from # changes that occur while paging, offset is not supported. Filter for a # specific time range instead. - statement = get_filter_statement(start_date_time, end_date_time) + statement = dfp.new_statement_builder do |sb| + sb.select = 'ChangeDateTime, EntityId, EntityType, Operation' + sb.from = 'Change_History' + sb.where = 'ChangeDateTime > :start_time AND ChangeDateTime < :end_time' + sb.order_by = 'ChangeDateTime' + sb.ascending = false + sb.with_bind_variable('start_time', start_time) + sb.with_bind_variable('end_time', end_time) + end # Set initial values for paging. - result_set, all_rows = nil, 0 + result_set, row_count = {:rows => []}, 0 begin - result_set = pql_service.select(statement.toStatement()) + result_set = pql_service.select(statement.to_statement()) if result_set # Print out columns header. @@ -65,55 +79,40 @@ def get_recent_changes() # Print out every row. result_set[:rows].each do |row_set| - row = row_set[:values].collect {|item| item[:value]} - row[0] = format_date(row[0]) - puts row.join(COLUMN_SEPARATOR) + row = row_set[:values].collect {|item| item[:value]} + change_date_time = dfp.datetime(row[0]) + row[0] = change_date_time.strftime('%Y-%m-%d %H:%M:%S ') + + row[0][:time_zone_id] + puts row.join(COLUMN_SEPARATOR) end # Get the earliest change time in the result set. - last_date_time = - format_date(result_set[:rows][-1][:values][0][:value], false) - statement = get_filter_statement(last_date_time, end_date_time) - all_rows += result_set[:rows].size + last_date_time = result_set[:rows][-1][:values][0][:value] + statement.configure do |sb| + sb.with_bind_variable('start_time', last_date_time) + end + row_count += result_set[:rows].size end end while result_set && result_set[:rows] && - result_set[:rows].size == DfpApi::SUGGESTED_PAGE_LIMIT + result_set[:rows].size == statement.limit - puts 'Total number of rows found: %d' % all_rows + puts 'Total number of rows found: %d' % row_count end -def get_filter_statement(start_date_time, end_date_time) - DfpApi::FilterStatement.new( - 'SELECT ChangeDateTime, EntityId, EntityType, Operation ' + - 'FROM Change_History ' + - 'WHERE ChangeDateTime < :start_date_time ' + - 'AND ChangeDateTime > :end_date_time ' + - 'ORDER BY ChangeDateTime DESC', - [ - { - :key => 'start_date_time', - :value => {:value => start_date_time, :xsi_type => 'TextValue'} - }, - { - :key => 'end_date_time', - :value => {:value => end_date_time, :xsi_type => 'TextValue'} - } - ] - ) -end +if __FILE__ == $0 + API_VERSION = :v201802 + # A string to separate columns in output. Use "," to get CSV. + COLUMN_SEPARATOR = "\t" -def format_date(date_hash, with_time_zone = true) - date_time = '%s-%02d-%02dT%02d:%02d:%02d' % [ - date_hash[:date][:year], date_hash[:date][:month], date_hash[:date][:day], - date_hash[:hour], date_hash[:minute], date_hash[:second] - ] - date_time += ' %s' % date_hash[:time_zone_id] if with_time_zone - return date_time -end + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') -if __FILE__ == $0 begin - get_recent_changes() + get_recent_changes(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/rate_card_service/get_all_rate_cards.rb b/dfp_api/examples/v201802/rate_card_service/get_all_rate_cards.rb new file mode 100755 index 000000000..8d31198c2 --- /dev/null +++ b/dfp_api/examples/v201802/rate_card_service/get_all_rate_cards.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all rate cards. + +require 'dfp_api' + +def get_all_rate_cards(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) + + # Create a statement to select rate cards. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of rate cards at a time, paging + # through until all rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) + + # Print out some information for each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts ('%d) Rate card with ID %d, name "%s", and currency code "%s" ' + + 'was found.') % [index + statement.offset, rate_card[:id], + rate_card[:name], rate_card[:currency_code]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_rate_cards(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/rate_card_service/get_marketplace_rate_cards.rb b/dfp_api/examples/v201802/rate_card_service/get_marketplace_rate_cards.rb new file mode 100755 index 000000000..7d2d4ec0e --- /dev/null +++ b/dfp_api/examples/v201802/rate_card_service/get_marketplace_rate_cards.rb @@ -0,0 +1,85 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all rate cards that can be used for Marketplace products. + +require 'dfp_api' + +def get_marketplace_rate_cards(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) + + # Create a statement to select rate cards. + statement = dfp.new_statement_builder do |sb| + sb.where = 'forMarketplace = :for_marketplace' + sb.with_bind_variable('for_marketplace', true) + end + + # Retrieve a small amount of rate cards at a time, paging + # through until all rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) + + # Print out some information for each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts ('%d) Rate card with ID %d, name "%s", and currency code "%s" ' + + 'was found.') % [index + statement.offset, rate_card[:id], + rate_card[:name], rate_card[:currency_code]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_marketplace_rate_cards(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/rate_card_service/get_rate_cards_by_statement.rb b/dfp_api/examples/v201802/rate_card_service/get_rate_cards_by_statement.rb new file mode 100755 index 000000000..2c829b602 --- /dev/null +++ b/dfp_api/examples/v201802/rate_card_service/get_rate_cards_by_statement.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all rate cards that have a currency in US dollars. + +require 'dfp_api' + +def get_rate_cards_by_statement(dfp) + # Get the RateCardService. + rate_card_service = dfp.service(:RateCardService, API_VERSION) + + # Create a statement to select rate cards. + statement = dfp.new_statement_builder do |sb| + sb.where = 'currencyCode = :currency_code' + sb.with_bind_variable('currency_code', 'USD') + end + + # Retrieve a small number of rate cards at a time, paging through until all + # rate cards have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get rate cards by statement. + page = rate_card_service.get_rate_cards_by_statement( + statement.to_statement() + ) + + # Display some information about each rate card. + unless page[:results].nil? + page[:results].each_with_index do |rate_card, index| + puts "%d) Rate card with ID %d and name '%s' was found." % + [index + statement.offset, rate_card[:id], rate_card[:name]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of rate cards: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_rate_cards_by_statement(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb b/dfp_api/examples/v201802/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb new file mode 100755 index 000000000..5f4a1e030 --- /dev/null +++ b/dfp_api/examples/v201802/reconciliation_line_item_report_service/get_reconciliation_line_item_reports_for_reconciliation_report.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all line item reports for a given reconcilliation report. To +# determine how many reconciliation reports exist, run +# get_all_reconciliation_reports.rb. + +require 'dfp_api' + +def get_reconciliation_line_item_reports_for_reconciliation_report(dfp, + reconciliation_report_id) + # Get the ReconciliationLineItemReportService. + reconciliation_line_item_report_service = + dfp.service(:ReconciliationLineItemReportService, API_VERSION) + + # Create a statement to select reconciliation line item report. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id AND ' + + 'lineItemId != :line_item_id' + sb.with_bind_variable('reconciliation_report_id', reconciliation_report_id) + sb.with_bind_variable('line_item_id', 0) + sb.order_by = 'lineItemId' + end + + # Retrieve a small number of reconciliation line item reports at a time, + # paging through until all reconciliation line item reports have been + # retrieved. + page = {:total_result_set_size => 0} + begin + # Get reconciliation line item reports by statement. + page = reconciliation_line_item_report_service. + get_reconciliation_line_item_reports_by_statement( + statement.to_statement() + ) + + # Display some information about each reconciliation line item report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_line_item_report, index| + puts ('%d) Reconciliation line item report with ID %d and status ' + + '"%s" was found.') % [index + statement.offset, + reconciliation_line_item_report[:id], + reconciliation_line_item_report[:status]] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation line item reports: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_line_item_reports_for_reconciliation_report( + dfp, reconciliation_report_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb b/dfp_api/examples/v201802/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb new file mode 100755 index 000000000..f47c30ffd --- /dev/null +++ b/dfp_api/examples/v201802/reconciliation_order_report_service/get_reconciliation_order_reports_for_reconciliation_report.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all reconciliation order reports for a given reconciliation +# report. + +require 'dfp_api' + +def get_reconciliation_order_reports_for_reconciliation_report(dfp, + reconciliation_report_id) + reconciliation_order_report_service = + dfp.service(:ReconciliationOrderReportService, API_VERSION) + + # Create a statement to select reconciliation order reports. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id' + sb.with_bind_variable( + 'reoconciliation_report_id', reconciliation_report_id + ) + end + + # Retrieve a small amount of reconciliation order reports at a time, paging + # through until all reconciliation order reports have been retrieved. + page = {:total_result_set_size => 0} + begin + page = reconciliation_order_report_service. + get_reconciliation_order_reports_by_statement(statement.to_statement()) + + # Print out some information for each reconciliation order report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_order_report, index| + puts ('%d) Reconciliation order report with ID %d and status "%s" ' + + 'was found.') % [index + statement.offset, + reconciliation_order_report[:id], + reconciliation_order_report[:status]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation order reports: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_order_reports_for_reconciliation_report( + dfp, reconciliation_report_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb b/dfp_api/examples/v201802/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb new file mode 100755 index 000000000..1d905dbf4 --- /dev/null +++ b/dfp_api/examples/v201802/reconciliation_report_row_service/get_reconciliation_report_rows_for_reconciliation_report.rb @@ -0,0 +1,95 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Gets a reconciliation report's rows for line items that served through DFP. + +require 'dfp_api' + +def get_reconciliation_report_rows_for_reconciliation_report(dfp, + reconciliation_report_id) + # Get the ReconciliationReportRowService. + reconciliation_report_row_service = + dfp.service(:ReconciliationReportRowService, API_VERSION) + + # Create a statement to select reconciliation report rows. + statement = dfp.new_statement_builder do |sb| + sb.where = 'reconciliationReportId = :reconciliation_report_id AND ' + + 'lineItemId != :line_item_id' + sb.with_bind_variable('reconciliation_report_id', reconciliation_report_id) + sb.with_bind_variable('line_item_id', 0) + sb.order_by = 'lineItemId' + end + + # Retrieve a small number of reconciliation report rows at a time, paging + # through until all reconciliation report rows have been retrieved. + page = {:total_result_set_size => 0} + begin + # Get reconciliation report rows by statement. + page = reconciliation_report_row_service. + get_reconciliation_report_rows_by_statement(statement.to_statement()) + + # Print out some information for each reconciliation report row. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_report_row, index| + puts ('%d) Reconciliation report row with ID %d, reconciliation ' + + 'source "%s", and reconciled volume %s was found.') % + [index + statement.offset, + reconciliation_report_row[:id], + reconciliation_report_row[:reconciliation_source], + reconciliation_report_row[:reconciled_volume] || 'nil'] + end + end + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation report rows: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + reconciliation_report_id = 'INSERT_RECONCILIATION_REPORT_ID_HERE'.to_i + get_reconciliation_report_rows_for_reconciliation_report( + dfp, reconciliation_report_id + ) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/reconciliation_report_service/get_all_reconciliation_reports.rb b/dfp_api/examples/v201802/reconciliation_report_service/get_all_reconciliation_reports.rb new file mode 100755 index 000000000..f63ae1876 --- /dev/null +++ b/dfp_api/examples/v201802/reconciliation_report_service/get_all_reconciliation_reports.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all reconciliation reports. + +require 'dfp_api' +require 'date' + +def get_all_reconciliation_reports(dfp) + reconciliation_report_service = + dfp.service(:ReconciliationReportService, API_VERSION) + + # Create a statement to select reconciliation reports. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of reconciliation reports at a time, paging + # through until all reconciliation reports have been retrieved. + page = {:total_result_set_size => 0} + begin + page = reconciliation_report_service. + get_reconciliation_reports_by_statement(statement.to_statement()) + + # Print out some information for each reconciliation report. + unless page[:results].nil? + page[:results].each_with_index do |reconciliation_report, index| + start_date = reconciliation_report[:start_date] + start_date_string = Date.new( + start_date[:year], + start_date[:month], + start_date[:day]).to_s + puts ('%d) Reconciliation report with ID %d and start date "%s" was ' + + 'found.') % [index + statement.offset, reconciliation_report[:id], + start_date_string] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of reconciliation reports: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_reconciliation_reports(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb b/dfp_api/examples/v201802/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb new file mode 100755 index 000000000..e0536f587 --- /dev/null +++ b/dfp_api/examples/v201802/reconciliation_report_service/get_reconciliation_report_for_last_billing_period.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets the previous billing period's reconciliation report. + +require 'dfp_api' + +def get_reconciliation_report_for_last_billing_period(dfp) + # Get the ReconciliationReportService. + reconciliation_report_service = + dfp.service(:ReconciliationReportService, API_VERSION) + + # Create a date representing the first day of the previous month. + previous_month = dfp.today() << 1 + first_day_of_previous_month = dfp.date( + previous_month.year, + previous_month.month, + 1 + ) + + # Create a statement to select the last billing period's reconciliation + # report. + statement = dfp.new_statement_builder do |sb| + sb.where = 'startDate = :start_date' + sb.with_bind_variable('start_date', first_day_of_previous_month) + sb.limit = 1 + end + + # Get the reconciliation report. + response = reconciliation_report_service. + get_reconciliation_reports_by_statement(statement.to_statement()) + if response[:results].to_a.size < 1 + raise 'No reconciliation report found for last month.' + end + reconciliation_report = response[:results].first + + # Display the results. + start_date = dfp.date(reconciliation_report[:start_date]) + puts 'Reconciliation report with ID %d and start date "%s" was found.' % + [reconciliation_report[:id], start_date.strftime] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_reconciliation_report_for_last_billing_period(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/report_service/display_report.rb b/dfp_api/examples/v201802/report_service/display_report.rb similarity index 88% rename from dfp_api/examples/v201705/report_service/display_report.rb rename to dfp_api/examples/v201802/report_service/display_report.rb index 7d664576a..002d93855 100755 --- a/dfp_api/examples/v201705/report_service/display_report.rb +++ b/dfp_api/examples/v201802/report_service/display_report.rb @@ -21,25 +21,12 @@ # a report, run run_delivery_report.rb. require 'dfp_api' - require 'open-uri' -API_VERSION = :v201705 - -def display_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def display_report(dfp, report_job_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the completed report. - report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i - # Set the format of the report (e.g. CSV_DUMP) and download without # compression so we can print it. report_download_options = { @@ -49,15 +36,26 @@ def display_report() # Get the report URL. download_url = report_service.get_report_download_url_with_options( - report_job_id, report_download_options); + report_job_id, report_download_options + ) - puts "Downloading report from URL %s.\n" % download_url + puts 'Downloading report from URL %s.\n' % download_url puts open(download_url).read() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - display_report() + report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i + display_report(dfp, report_job_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/download_report.rb b/dfp_api/examples/v201802/report_service/download_report.rb similarity index 73% rename from dfp_api/examples/v201705/report_service/download_report.rb rename to dfp_api/examples/v201802/report_service/download_report.rb index 19c915f12..1406638d9 100755 --- a/dfp_api/examples/v201705/report_service/download_report.rb +++ b/dfp_api/examples/v201802/report_service/download_report.rb @@ -16,48 +16,46 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example downloads a completed report. To run a report, run -# run_delivery_report.rb, run_sales_report.rb or run_inventory_report.rb. +# This example downloads a completed report. By default, downloaded reports +# are compressed to a gzip file. To run a report, run run_delivery_report.rb, +# run_sales_report.rb or run_inventory_report.rb. require 'dfp_api' - require 'open-uri' -API_VERSION = :v201705 - -def download_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def download_report(dfp, report_job_id, file_name) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the completed report. - report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i - - # Set the file path and name to save to. - file_name = 'INSERT_FILE_PATH_AND_NAME_HERE' - - # Change to your preffered export format. + # Set the export format used to generate the report. Other options include, + # TSV, TSV_EXCEL, and XML. export_format = 'CSV_DUMP' # Get the report URL. download_url = report_service.get_report_download_url( - report_job_id, export_format); + report_job_id, export_format + ) - puts "Downloading [%s] to [%s]..." % [download_url, file_name] + puts 'Downloading "%s" to "%s"...' % [download_url, file_name] open(file_name, 'wb') do |local_file| local_file << open(download_url).read() end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - download_report() + report_job_id = 'INSERT_REPORT_JOB_ID_HERE'.to_i + file_name = 'INSERT_FILE_PATH_AND_NAME_HERE' + download_report(dfp, report_job_id, file_name) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/report_service/run_ad_exchange_report.rb b/dfp_api/examples/v201802/report_service/run_ad_exchange_report.rb new file mode 100755 index 000000000..23bfe8fbb --- /dev/null +++ b/dfp_api/examples/v201802/report_service/run_ad_exchange_report.rb @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example runs a report on Ad Exchange data. + +require 'dfp_api' + +def run_ad_exchange_report(dfp) + # Get the ReportService. + report_service = dfp.service(:ReportService, API_VERSION) + + # Create report query. + report_query = { + :date_range_type => 'LAST_WEEK', + :dimensions => ['AD_EXCHANGE_DATE', 'AD_EXCHANGE_COUNTRY_NAME'], + :columns => [ + 'AD_EXCHANGE_AD_REQUESTS', + 'AD_EXCHANGE_IMPRESSIONS', + 'AD_EXCHANGE_ESTIMATED_REVENUE' + ], + :time_zone_type => 'AD_EXCHANGE', # Run in pacific time. + :adx_report_currency => 'EUR' + } + + # Create report job. + report_job = {:report_query => report_query} + + # Run report job. + report_job = report_service.run_report_job(report_job) + + MAX_RETRIES.times do |retry_count| + # Get the report job status. + report_job_status = report_service.get_report_job_status(report_job[:id]) + + break unless report_job_status == 'IN_PROGRESS' + puts 'Report with ID %d is still running.' % report_job[:id] + sleep(RETRY_INTERVAL) + end + + puts 'Polling for report job with ID %d finished with status "%s".' % + [report_job[:id], report_service.get_report_job_status(report_job[:id])] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + run_ad_exchange_report(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/report_service/run_delivery_report.rb b/dfp_api/examples/v201802/report_service/run_delivery_report.rb similarity index 72% rename from dfp_api/examples/v201705/report_service/run_delivery_report.rb rename to dfp_api/examples/v201802/report_service/run_delivery_report.rb index c2446cf85..624911261 100755 --- a/dfp_api/examples/v201705/report_service/run_delivery_report.rb +++ b/dfp_api/examples/v201802/report_service/run_delivery_report.rb @@ -20,53 +20,33 @@ # with additional attributes and can filter to include just one order. # To download the report see download_report.rb. -require 'date' require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_delivery_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_delivery_report(dfp, order_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Specify the order ID to filter by. - order_id = 'INSERT_ORDER_ID_HERE'.to_i - # Specify a report to run for the last 7 days. - report_end_date = DateTime.now + report_end_date = dfp.today() report_start_date = report_end_date - 7 + # Create statement object to filter for an order. + statement = dfp.new_report_statement_builder do |sb| + sb.where = 'ORDER_ID = :order_id' + sb.with_bind_variable('order_id', order_id) + end + # Create report query. report_query = { :date_range_type => 'CUSTOM_DATE', - :start_date => {:year => report_start_date.year, - :month => report_start_date.month, - :day => report_start_date.day}, - :end_date => {:year => report_end_date.year, - :month => report_end_date.month, - :day => report_end_date.day}, + :start_date => report_start_date.to_h, + :end_date => report_end_date.to_h, :dimensions => ['ORDER_ID', 'ORDER_NAME'], :dimension_attributes => ['ORDER_TRAFFICKER', 'ORDER_START_DATE_TIME', 'ORDER_END_DATE_TIME'], :columns => ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS', 'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE', 'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'], - # Create statement object to filter for an order. - :statement => { - :query => 'WHERE ORDER_ID = :order_id', - :values => [ - {:key => 'order_id', - :value => {:value => order_id, :xsi_type => 'NumberValue'}} - ] - } + :statement => statement.to_statement() } # Create report job. @@ -80,18 +60,29 @@ def run_delivery_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_delivery_report() + order_id = 'INSERT_ORDER_ID_HERE'.to_i + run_delivery_report(dfp, order_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/run_inventory_report.rb b/dfp_api/examples/v201802/report_service/run_inventory_report.rb similarity index 79% rename from dfp_api/examples/v201705/report_service/run_inventory_report.rb rename to dfp_api/examples/v201802/report_service/run_inventory_report.rb index 8cac8c129..5e1f0238b 100755 --- a/dfp_api/examples/v201705/report_service/run_inventory_report.rb +++ b/dfp_api/examples/v201802/report_service/run_inventory_report.rb @@ -16,40 +16,26 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example runs a report equal to the "Whole network report" on the DFP -# website. To download the report see download_report.rb. +# This example runs a typical daily inventory report. To download the report +# see download_report.rb. require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_inventory_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_inventory_report(dfp) # Get the ReportService and NetworkService. report_service = dfp.service(:ReportService, API_VERSION) network_service = dfp.service(:NetworkService, API_VERSION) # Get the root ad unit ID to filter on. root_ad_unit_id = - network_service.get_current_network()[:effective_root_ad_unit_id] + network_service.get_current_network()[:effective_root_ad_unit_id].to_i # Create statement to filter on a parent ad unit with the root ad unit ID # to include all ad units in the network. - statement = { - :query => 'WHERE PARENT_AD_UNIT_ID = :parent_ad_unit_id', - :values => [ - {:key => 'parent_ad_unit_id', - :value => {:value => root_ad_unit_id, :xsi_type => 'NumberValue'}} - ] - } + statement = dfp.new_report_statement_builder do |sb| + sb.where = 'PARENT_AD_UNIT_ID = :parent_ad_unit_id' + sb.with_bind_variable('parent_ad_unit_id', root_ad_unit_id) + end # Create report query. report_query = { @@ -64,7 +50,7 @@ def run_inventory_report() 'TOTAL_INVENTORY_LEVEL_IMPRESSIONS', 'TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE' ], - :statement => statement + :statement => statement.to_statement() } # Create report job. @@ -78,18 +64,28 @@ def run_inventory_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_inventory_report() + run_inventory_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/run_reach_report.rb b/dfp_api/examples/v201802/report_service/run_reach_report.rb similarity index 87% rename from dfp_api/examples/v201705/report_service/run_reach_report.rb rename to dfp_api/examples/v201802/report_service/run_reach_report.rb index 17864033d..348bca417 100755 --- a/dfp_api/examples/v201705/report_service/run_reach_report.rb +++ b/dfp_api/examples/v201802/report_service/run_reach_report.rb @@ -21,18 +21,7 @@ require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_reach_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_reach_report(dfp) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) @@ -54,18 +43,28 @@ def run_reach_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_reach_report() + run_reach_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/run_report_with_custom_fields.rb b/dfp_api/examples/v201802/report_service/run_report_with_custom_fields.rb similarity index 83% rename from dfp_api/examples/v201705/report_service/run_report_with_custom_fields.rb rename to dfp_api/examples/v201802/report_service/run_report_with_custom_fields.rb index 3991c495a..f49c43f7d 100755 --- a/dfp_api/examples/v201705/report_service/run_report_with_custom_fields.rb +++ b/dfp_api/examples/v201802/report_service/run_report_with_custom_fields.rb @@ -21,24 +21,10 @@ require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_report_with_custom_fields() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_report_with_custom_fields(dfp, custom_field_id) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) - # Set the ID of the custom field to filter on. - custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i - # Create report query. report_query = { :date_range_type => 'LAST_MONTH', @@ -58,18 +44,29 @@ def run_report_with_custom_fields() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_report_with_custom_fields() + custom_field_id = 'INSERT_CUSTOM_FIELD_ID_HERE'.to_i + run_report_with_custom_fields(dfp, custom_field_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/run_sales_report.rb b/dfp_api/examples/v201802/report_service/run_sales_report.rb similarity index 88% rename from dfp_api/examples/v201705/report_service/run_sales_report.rb rename to dfp_api/examples/v201802/report_service/run_sales_report.rb index f878d9387..20f78cf93 100755 --- a/dfp_api/examples/v201705/report_service/run_sales_report.rb +++ b/dfp_api/examples/v201802/report_service/run_sales_report.rb @@ -21,18 +21,7 @@ require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_sales_report() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_sales_report(dfp) # Get the ReportService. report_service = dfp.service(:ReportService, API_VERSION) @@ -58,18 +47,28 @@ def run_sales_report() report_job_status = report_service.get_report_job_status(report_job[:id]) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s".' % [report_job[:id], + report_service.get_report_job_status(report_job[:id])] end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - run_sales_report() + run_sales_report(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/report_service/run_saved_query.rb b/dfp_api/examples/v201802/report_service/run_saved_query.rb similarity index 76% rename from dfp_api/examples/v201705/report_service/run_saved_query.rb rename to dfp_api/examples/v201802/report_service/run_saved_query.rb index 1ec1f0d0b..704cb00e3 100755 --- a/dfp_api/examples/v201705/report_service/run_saved_query.rb +++ b/dfp_api/examples/v201802/report_service/run_saved_query.rb @@ -21,37 +21,19 @@ require 'dfp_api' -API_VERSION = :v201705 -MAX_RETRIES = 10 -RETRY_INTERVAL = 30 - -def run_saved_query(saved_query_id) - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def run_saved_query(dfp, saved_query_id) # Get the ReportService and NetworkService. report_service = dfp.service(:ReportService, API_VERSION) # Create statement to select a single saved report query. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id', - [ - {:key => 'id', - :value => { - :value => saved_query_id, - :xsi_type => 'NumberValue'} - } - ], - # Limit results to single entity. - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :saved_query_id' + sb.with_bind_variable('saved_query_id', saved_query_id) + end saved_query_page = report_service.get_saved_queries_by_statement( - statement.toStatement()) + statement.to_statement() + ) unless saved_query_page[:results].nil? saved_query = response[:results].first @@ -62,20 +44,21 @@ def run_saved_query(saved_query_id) # Run report job. report_job = report_service.run_report_job(report_job); + report_job_status = 'IN_PROGRESS' MAX_RETRIES.times do |retry_count| # Get the report job status. report_job_status = report_service.get_report_job_status( - report_job[:id]) + report_job[:id] + ) break unless report_job_status == 'IN_PROGRESS' - puts "Report with ID: %d is still running." % report_job[:id] + puts 'Report with ID %d is still running.' % report_job[:id] sleep(RETRY_INTERVAL) end - puts "Report job with ID: %d finished with status %s." % - [report_job[:id], - report_service.get_report_job_status(report_job[:id])] + puts 'Report job with ID %d finished with status "%s."' % + [report_job[:id], report_job_status] else raise StandardError, 'Report query is not compatible with the API' end @@ -83,9 +66,20 @@ def run_saved_query(saved_query_id) end if __FILE__ == $0 + API_VERSION = :v201802 + MAX_RETRIES = 10 + RETRY_INTERVAL = 30 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - SAVED_QUERY_ID = 'INSERT_SAVED_QUERY_ID_HERE'.to_i - run_saved_query(SAVED_QUERY_ID) + saved_query_id = 'INSERT_SAVED_QUERY_ID_HERE'.to_i + run_saved_query(dfp, saved_query_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/suggested_ad_unit_service/approve_all_suggested_ad_units.rb b/dfp_api/examples/v201802/suggested_ad_unit_service/approve_all_suggested_ad_units.rb similarity index 64% rename from dfp_api/examples/v201705/suggested_ad_unit_service/approve_all_suggested_ad_units.rb rename to dfp_api/examples/v201802/suggested_ad_unit_service/approve_all_suggested_ad_units.rb index 7ed1aa5a4..8a956dbc1 100755 --- a/dfp_api/examples/v201705/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +++ b/dfp_api/examples/v201802/suggested_ad_unit_service/approve_all_suggested_ad_units.rb @@ -16,68 +16,65 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This code example approves all suggested ad units with 50 or more requests. +# This code example approves all suggested ad units with more requests than the +# given threshold. # # This feature is only available to DFP premium solution networks. require 'dfp_api' - -API_VERSION = :v201705 -NUMBER_OF_REQUESTS = 50 - -def approve_suggested_ad_units() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def approve_suggested_ad_units(dfp, num_requests) # Get the SuggestedAdUnitService. suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION) - # Create a statement to only select suggested ad units with 50 or more - # requests. - statement = DfpApi::FilterStatement.new( - 'WHERE numRequests >= :num_requests', - [ - {:key => 'num_requests', - :value => {:value => NUMBER_OF_REQUESTS, - :xsi_type => 'NumberValue'}} - ] - ) + # Create a statement to only select suggested ad units with more requests + # than the value of the num_requests parameter. + statement = dfp.new_statement_builder do |sb| + sb.where = 'numRequests >= :num_requests' + sb.with_bind_variable('num_requests', num_requests) + end begin # Get suggested ad units by statement. page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( - statement.toStatement()) + statement.to_statement() + ) unit_count_to_approve = 0 - if page[:results] + unless page[:results].nil? page[:results].each_with_index do |ad_unit, index| - if ad_unit[:num_requests] >= NUMBER_OF_REQUESTS - puts(("%d) Suggested ad unit with ID '%s' and %d requests will be " + - "approved.") % [index + statement.offset, ad_unit[:id], - ad_unit[:num_requests]]) + if ad_unit[:num_requests] >= num_requests + puts ('%d) Suggested ad unit with ID "%s" and %d requests will be ' + + 'approved.') % [index + statement.offset, ad_unit[:id], + ad_unit[:num_requests]] unit_count_to_approve += 1 end end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end puts "Number of suggested ad units to be approved: %d" % unit_count_to_approve if unit_count_to_approve > 0 + # Prepare statement for action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end + # Perform action with the same statement. result = suggested_ad_unit_service.perform_suggested_ad_unit_action( - {:xsi_type => 'ApproveSuggestedAdUnits'}, statement) + {:xsi_type => 'ApproveSuggestedAdUnits'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of ad units approved: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of ad units approved: %d' % result[:num_changes] else puts 'No ad units were approved.' end @@ -87,8 +84,18 @@ def approve_suggested_ad_units() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - approve_suggested_ad_units() + num_requests = 50 + approve_suggested_ad_units(dfp, num_requests) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/suggested_ad_unit_service/get_all_suggested_ad_units.rb b/dfp_api/examples/v201802/suggested_ad_unit_service/get_all_suggested_ad_units.rb new file mode 100755 index 000000000..77ffe49b7 --- /dev/null +++ b/dfp_api/examples/v201802/suggested_ad_unit_service/get_all_suggested_ad_units.rb @@ -0,0 +1,82 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all suggested ad units. + +require 'dfp_api' + +def get_all_suggested_ad_units(dfp) + # Get the SuggestedAdUnitService. + suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION) + + # Create a statement to select suggested ad units. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of suggested ad units at a time, paging + # through until all suggested ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( + statement.to_statement() + ) + + # Print out some information for each suggested ad unit. + unless page[:results].nil? + page[:results].each_with_index do |suggested_ad_unit, index| + puts '%d) Suggested ad unit with ID %d and num requests %d was found.' % + [index + statement.offset, suggested_ad_unit[:id], + suggested_ad_unit[:num_requests]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of suggested ad units: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_suggested_ad_units(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb b/dfp_api/examples/v201802/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb new file mode 100755 index 000000000..9df213c21 --- /dev/null +++ b/dfp_api/examples/v201802/suggested_ad_unit_service/get_highly_requested_suggested_ad_units.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all highly requested suggested ad units. + +require 'dfp_api' + +def get_highly_requested_suggested_ad_units(dfp, num_requests) + # Get the SuggestedAdUnitService. + suggested_ad_unit_service = + dfp.service(:SuggestedAdUnitService, API_VERSION) + + # Create a statement to select suggested ad units. + statement = dfp.new_statement_builder do |sb| + sb.where = 'numRequests >= :num_requests' + sb.with_bind_variable('num_requests', num_requests) + end + + # Retrieve a small amount of suggested ad units at a time, paging + # through until all suggested ad units have been retrieved. + page = {:total_result_set_size => 0} + begin + page = suggested_ad_unit_service.get_suggested_ad_units_by_statement( + statement.to_statement() + ) + + # Print out some information for each suggested ad unit. + unless page[:results].nil? + page[:results].each_with_index do |suggested_ad_unit, index| + puts '%d) Suggested ad unit with ID %d and num requests %d was found.' % + [index + statement.offset, suggested_ad_unit[:id], + suggested_ad_unit[:num_requests]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of suggested ad units: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + num_requests = 50 + get_highly_requested_suggested_ad_units(dfp, num_requests) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/team_service/create_teams.rb b/dfp_api/examples/v201802/team_service/create_teams.rb similarity index 79% rename from dfp_api/examples/v201705/team_service/create_teams.rb rename to dfp_api/examples/v201802/team_service/create_teams.rb index 7b794a881..1dfcd0380 100755 --- a/dfp_api/examples/v201705/team_service/create_teams.rb +++ b/dfp_api/examples/v201802/team_service/create_teams.rb @@ -19,47 +19,48 @@ # This example creates new teams with the logged in user added to each team. To # determine which teams exist, run get_all_teams.rb. +require 'securerandom' require 'dfp_api' -API_VERSION = :v201705 -ITEM_COUNT = 5 - -def create_teams() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_teams(dfp, number_of_teams_to_create) # Get the TeamService. team_service = dfp.service(:TeamService, API_VERSION) # Create an array to store local team objects. - teams = (1..ITEM_COUNT).map do |index| + teams = (1..number_of_teams_to_create).map do |index| { - :name => "Team #%d" % index, + :name => "Team #%d - %d" % [index, SecureRandom.uuid()], :has_all_companies => false, :has_all_inventory => false } end # Create the teams on the server. - return_teams = team_service.create_teams(teams) + created_teams = team_service.create_teams(teams) - if return_teams - return_teams.each do |team| - puts "Team with ID: %d and name: '%s' was created." % + if created_teams.to_a.size > 0 + created_teams.each do |team| + puts 'Team with ID %d and name "%s" was created.' % [team[:id], team[:name]] end else - raise 'No teams were created.' + puts 'No teams were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_teams() + number_of_teams_to_create = 5 + create_teams(dfp, number_of_teams_to_create) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/team_service/get_all_teams.rb b/dfp_api/examples/v201802/team_service/get_all_teams.rb new file mode 100755 index 000000000..6ca73cc4a --- /dev/null +++ b/dfp_api/examples/v201802/team_service/get_all_teams.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all teams. + +require 'dfp_api' + +def get_all_teams(dfp) + # Get the TeamService. + team_service = dfp.service(:TeamService, API_VERSION) + + # Create a statement to select teams. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of teams at a time, paging + # through until all teams have been retrieved. + page = {:total_result_set_size => 0} + begin + page = team_service.get_teams_by_statement( + statement.to_statement() + ) + + # Print out some information for each team. + unless page[:results].nil? + page[:results].each_with_index do |team, index| + puts '%d) Team with ID %d and name "%s" was found.' % + [index + statement.offset, team[:id], team[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of teams: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_teams(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/team_service/update_teams.rb b/dfp_api/examples/v201802/team_service/update_teams.rb similarity index 64% rename from dfp_api/examples/v201705/team_service/update_teams.rb rename to dfp_api/examples/v201802/team_service/update_teams.rb index 3b23c6564..982e0b7f8 100755 --- a/dfp_api/examples/v201705/team_service/update_teams.rb +++ b/dfp_api/examples/v201802/team_service/update_teams.rb @@ -21,57 +21,52 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_teams() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - - # Set the ID of the team to update. - team_id = 'INSERT_TEAM_ID_HERE'.to_i - +def update_teams(dfp, team_id) # Get the TeamService. team_service = dfp.service(:TeamService, API_VERSION) # Create a statement to select the matching team. - query = 'WHERE id = :id' - values = [ - {:key => 'id', :value => {:xsi_type => 'NumberValue', :value => team_id}} - ] - statement = DfpApi::FilterStatement.new(query, values) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :team_id' + sb.with_bind_variable('team_id', team_id) + sb.limit = 1 + end - # Get teams by statement. - page = team_service.get_teams_by_statement(statement.toStatement()) + # Get team by statement. + response = team_service.get_teams_by_statement(statement.to_statement()) + raise 'No teams found to update.' if response[:results].to_a.empty? + team = response[:results].first - if page[:results] - teams = page[:results] + # Change the description of the team. + team[:description] ||= '' + team[:description] += ' - UPDATED' - # Create a local set of teams than need to be updated. We are updating by - # changing the description. - updated_teams = teams.map do |team| - team[:description] ||= '' - team[:description] += ' - UPDATED' - team - end + # Update the teams on the server. + updated_teams = team_service.update_teams(updated_teams) - # Update the teams on the server. - return_teams = team_service.update_teams(updated_teams) - return_teams.each do |team| - puts "Team ID: %d, name: '%s' was updated" % [team[:id], team[:name]] + # Display the results. + if updated_teams.to_a.size > 0 + updated_teams.each do |team| + puts 'Team ID %d and name "%s" was updated' % [team[:id], team[:name]] end else - puts 'No teams found to update.' + puts 'No teams were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_teams() + team_id = 'INSERT_TEAM_ID_HERE'.to_i + update_teams(dfp, team_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/user_service/create_users.rb b/dfp_api/examples/v201802/user_service/create_users.rb similarity index 76% rename from dfp_api/examples/v201705/user_service/create_users.rb rename to dfp_api/examples/v201802/user_service/create_users.rb index 5f3eceecf..cf3748036 100755 --- a/dfp_api/examples/v201705/user_service/create_users.rb +++ b/dfp_api/examples/v201802/user_service/create_users.rb @@ -21,51 +21,51 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_users(dfp, emails_and_names, role_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - # Set the user's email addresses and names. - emails_and_names = [ - {:name => 'INSERT_NAME_HERE', - :email => 'INSERT_EMAIL_ADDRESS_HERE'}, - {:name => 'INSERT_NAME_HERE', - :email => 'INSERT_EMAIL_ADDRESS_HERE'} - ] - - # Set the role ID for new users. - role_id = 'INSERT_ROLE_ID_HERE'.to_i - # Create an array to store local user objects. users = emails_and_names.map do |email_and_name| email_and_name.merge({:role_id => role_id}) end # Create the users on the server. - return_users = user_service.create_users(users) + created_users = user_service.create_users(users) - if return_users - return_users.each do |user| - puts "User with ID: %d, name: %s and email: %s was created." % + if created_users.to_a.size > 0 + created_users.each do |user| + puts 'User with ID %d, name "%s", and email "%s" was created.' % [user[:id], user[:name], user[:email]] end else - raise 'No users were created.' + puts 'No users were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_users() + emails_and_names = [ + { + :name => 'INSERT_NAME_HERE', + :email => 'INSERT_EMAIL_ADDRESS_HERE' + }, + { + :name => 'INSERT_NAME_HERE', + :email => 'INSERT_EMAIL_ADDRESS_HERE' + } + ] + role_id = 'INSERT_ROLE_ID_HERE'.to_i + create_users(dfp, emails_and_names, role_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/user_service/deactivate_users.rb b/dfp_api/examples/v201802/user_service/deactivate_users.rb similarity index 64% rename from dfp_api/examples/v201705/user_service/deactivate_users.rb rename to dfp_api/examples/v201802/user_service/deactivate_users.rb index 92671ed66..825d45d72 100755 --- a/dfp_api/examples/v201705/user_service/deactivate_users.rb +++ b/dfp_api/examples/v201802/user_service/deactivate_users.rb @@ -22,59 +22,58 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def deactivate_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def deactivate_users(dfp, user_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - # Set the ID of the user to deactivate - user_id = 'INSERT_USER_ID_HERE' - # Create filter text to select user by id. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :user_id', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.limit = 1 + end # Get users by statement. - page = user_service.get_users_by_statement(statement.toStatement()) + response = user_service.get_users_by_statement(statement.to_statement()) + raise 'No users found to deactivate.' if response[:results].to_a.empty? + user = response[:results].first - if page[:results] - page[:results].each do |user| - puts "User ID: %d, name: %s and status: %s will be deactivated." % - [user[:id], user[:name], user[:status]] - end + puts "User ID: %d, name: %s and status: %s will be deactivated." % + [user[:id], user[:name], user[:status]] - # Perform action. - result = user_service.perform_user_action( - {:xsi_type => 'DeactivateUsers'}, statement.toStatement()) + # Prepare statement for action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end - # Display results. - if result and result[:num_changes] > 0 - puts "Number of users deactivated: %d" % result[:num_changes] - else - puts 'No users were deactivated.' - end + # Perform action. + result = user_service.perform_user_action( + {:xsi_type => 'DeactivateUsers'}, + statement.to_statement() + ) + + # Display results. + if !result.nil? && result[:num_changes] > 0 + puts 'Number of users deactivated: %d' % result[:num_changes] else - puts 'No user found to deactivate.' + puts 'No users were deactivated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - deactivate_users() + user_id = 'INSERT_USER_ID_HERE'.to_i + deactivate_users(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/user_service/get_all_roles.rb b/dfp_api/examples/v201802/user_service/get_all_roles.rb new file mode 100755 index 000000000..7920adcbd --- /dev/null +++ b/dfp_api/examples/v201802/user_service/get_all_roles.rb @@ -0,0 +1,64 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all roles that are defined for the users of the network. + +require 'dfp_api' + +def get_all_roles(dfp) + # Get the UserService. + user_service = dfp.service(:UserService, API_VERSION) + + # Get all user roles. + roles = user_service.get_all_roles() + + # Display the results. + roles.each do |role| + puts 'Role with ID %d and name "%s" was found.' % [role[:id], role[:name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_roles(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/user_service/get_all_users.rb b/dfp_api/examples/v201802/user_service/get_all_users.rb new file mode 100755 index 000000000..b3a79a9c0 --- /dev/null +++ b/dfp_api/examples/v201802/user_service/get_all_users.rb @@ -0,0 +1,78 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all users. + +require 'dfp_api' + +def get_all_users(dfp) + user_service = dfp.service(:UserService, API_VERSION) + + # Create a statement to select users. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of users at a time, paging + # through until all users have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_service.get_users_by_statement(statement.to_statement()) + + # Print out some information for each user. + unless page[:results].nil? + page[:results].each_with_index do |user, index| + puts '%d) User with ID %d and name "%s" was found.' % + [index + statement.offset, user[:id], user[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of users: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_users(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/user_service/get_current_user.rb b/dfp_api/examples/v201802/user_service/get_current_user.rb similarity index 92% rename from dfp_api/examples/v201705/user_service/get_current_user.rb rename to dfp_api/examples/v201802/user_service/get_current_user.rb index c960010a8..bf87ce14f 100755 --- a/dfp_api/examples/v201705/user_service/get_current_user.rb +++ b/dfp_api/examples/v201802/user_service/get_current_user.rb @@ -20,29 +20,29 @@ require 'dfp_api' -API_VERSION = :v201705 - -def get_current_user() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def get_current_user(dfp) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) # Get the current user. user = user_service.get_current_user() - puts "Current user has ID %d, email %s and role %s." % + puts 'Current user has ID %d, email "%s", and role "%s".' % [user[:id], user[:email], user[:role_name]] end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - get_current_user() + get_current_user(dfp) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/user_service/get_user_by_email_address.rb b/dfp_api/examples/v201802/user_service/get_user_by_email_address.rb new file mode 100755 index 000000000..86b08ec45 --- /dev/null +++ b/dfp_api/examples/v201802/user_service/get_user_by_email_address.rb @@ -0,0 +1,81 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets users by email. + +require 'dfp_api' + +def get_user_by_email_address(dfp, email_address) + # Get the UserService. + user_service = dfp.service(:UserService, :v201802) + + # Create a statement to select users. + statement = dfp.new_statement_builder do |sb| + sb.where = 'email = :email_address' + sb.with_bind_variable('email_address', email_address) + end + + # Retrieve a small amount of users at a time, paging + # through until all users have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_service.get_users_by_statement(statement.to_statement()) + + # Print out some information for each user. + unless page[:results].nil? + page[:results].each_with_index do |user, index| + puts '%d) User with ID %d and name "%s" was found.' % + [index + statement.offset, user[:id], user[:name]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of users: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + email_address = 'INSERT_EMAIL_ADDRESS_HERE'; + get_user_by_email_address(dfp, email_address) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/user_service/update_users.rb b/dfp_api/examples/v201802/user_service/update_users.rb similarity index 61% rename from dfp_api/examples/v201705/user_service/update_users.rb rename to dfp_api/examples/v201802/user_service/update_users.rb index 71fdcca60..b3f8aff34 100755 --- a/dfp_api/examples/v201705/user_service/update_users.rb +++ b/dfp_api/examples/v201802/user_service/update_users.rb @@ -16,65 +16,57 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# This example updates all users by adding "Sr." to the end of a single user. -# To determine which users exist, run get_all_users.rb. +# This example updates a single user's name. To determine which users exist, +# run get_all_users.rb. require 'dfp_api' - -API_VERSION = :v201705 - -def update_users() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_users(dfp, user_id) # Get the UserService. user_service = dfp.service(:UserService, API_VERSION) - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create a statement to get all users. - statement = DfpApi::FilterStatement.new( - 'WHERE id = :id ORDER BY id ASC', - [ - {:key => 'id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ], - 1 - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'id = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.limit = 1 + end # Get users by statement. - page = user_service.get_users_by_statement(statement.toStatement()) + response = user_service.get_users_by_statement(statement.to_statement()) + raise 'No users found to update.' if response[:results].to_a.empty? + user = response[:results].first - if page[:results] - users = page[:results] + # Update the user object's name field. + user[:name] ||= '' + user[:name] += ' Ph.D.' - # Update each local users object by changing its name. - users.each {|user| user[:name] += ' Sr.'} + # Update the users on the server. + updated_users = user_service.update_users(users) - # Update the users on the server. - return_users = user_service.update_users(users) - - if return_users - return_users.each do |user| - puts ("User ID: %d, email: %s was updated with name %s") % - [user[:id], user[:email], user[:name]] - end - else - raise 'No users were updated.' + if updated_users.to_a.size > 0 + updated_users.each do |user| + puts 'User with ID %d and email "%s" was updated with name "%s".' % + [user[:id], user[:email], user[:name]] end else - puts 'No users found to update.' + puts 'No users were updated.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_users() + user_id = 'INSERT_USER_ID_HERE'.to_i + update_users(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/user_team_association_service/create_user_team_associations.rb b/dfp_api/examples/v201802/user_team_association_service/create_user_team_associations.rb similarity index 76% rename from dfp_api/examples/v201705/user_team_association_service/create_user_team_associations.rb rename to dfp_api/examples/v201802/user_team_association_service/create_user_team_associations.rb index 211a41893..c32bed198 100755 --- a/dfp_api/examples/v201705/user_team_association_service/create_user_team_associations.rb +++ b/dfp_api/examples/v201802/user_team_association_service/create_user_team_associations.rb @@ -22,23 +22,10 @@ require 'dfp_api' -API_VERSION = :v201705 - -def create_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def create_user_team_associations(dfp, team_id, user_ids) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the users and team to add them to. - team_id = 'INSERT_TEAM_ID_HERE'.to_i - user_ids = ['INSERT_USER_ID_HERE'.to_i] - # Create an array to store local user team association objects. associations = user_ids.map do |user_id| { @@ -48,21 +35,32 @@ def create_user_team_associations() end # Create the user team associations on the server. - return_associations = uta_service.create_user_team_associations(associations) + created_associations = uta_service.create_user_team_associations(associations) - if return_associations - return_associations.each do |association| - puts ("A user team association between user ID %d and team ID %d was " + - "created.") % [association[:user_id], association[:team_id]] + if created_associations.to_a.size > 0 + created_associations.each do |association| + puts ('A user team association between user ID %d and team ID %d was ' + + 'created.') % [association[:user_id], association[:team_id]] end else - raise 'No user team associations were created.' + puts 'No user team associations were created.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - create_user_team_associations() + team_id = 'INSERT_TEAM_ID_HERE'.to_i + user_ids = ['INSERT_USER_ID_HERE'.to_i, 'INSERT_USER_ID_HERE'.to_i] + create_user_team_associations(dfp, team_id, user_ids) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201705/user_team_association_service/delete_user_team_associations.rb b/dfp_api/examples/v201802/user_team_association_service/delete_user_team_associations.rb similarity index 69% rename from dfp_api/examples/v201705/user_team_association_service/delete_user_team_associations.rb rename to dfp_api/examples/v201802/user_team_association_service/delete_user_team_associations.rb index 4cdbb55b9..9eb2791d8 100755 --- a/dfp_api/examples/v201705/user_team_association_service/delete_user_team_associations.rb +++ b/dfp_api/examples/v201802/user_team_association_service/delete_user_team_associations.rb @@ -21,64 +21,66 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def delete_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def delete_user_team_associations(dfp, user_id) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the user to remove from its teams. - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create filter text to remove association by user ID. - statement = DfpApi::FilterStatement.new( - 'WHERE userId = :user_id', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}} - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + end begin # Get user team associations by statement. page = uta_service.get_user_team_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) - if page[:results] + unless page[:results].nil? page[:results].each do |association| - puts ("User team association of user ID %d with team ID %d will be " + - "deleted.") % [association[:user_id], association[:team_id]] + puts ('User team association of user ID %d with team ID %d will be ' + + 'deleted.') % [association[:user_id], association[:team_id]] end end - statement.offset += DfpApi::SUGGESTED_PAGE_LIMIT + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit end while statement.offset < page[:total_result_set_size] - # Reset offset back to 0 to perform action. - statement.toStatementForAction() + # Configure the statement to perform the delete action. + statement.configure do |sb| + sb.offset = nil + sb.limit = nil + end # Perform the action. result = uta_service.perform_user_team_association_action( - {:xsi_type => 'DeleteUserTeamAssociations'}, statement.toStatement()) + {:xsi_type => 'DeleteUserTeamAssociations'}, + statement.to_statement() + ) # Display results. - if result and result[:num_changes] > 0 - puts "Number of user team associations deleted: %d" % result[:num_changes] + if !result.nil? && result[:num_changes] > 0 + puts 'Number of user team associations deleted: %d' % result[:num_changes] else puts 'No user team associations were deleted.' end end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - delete_user_team_associations() + user_id = 'INSERT_USER_ID_HERE'.to_i + delete_user_team_associations(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/user_team_association_service/get_all_user_team_associations.rb b/dfp_api/examples/v201802/user_team_association_service/get_all_user_team_associations.rb new file mode 100755 index 000000000..70e5638ba --- /dev/null +++ b/dfp_api/examples/v201802/user_team_association_service/get_all_user_team_associations.rb @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all user team associations. + +require 'dfp_api' + +def get_all_user_team_associations(dfp) + # Get the UserTeamAssociationService. + user_team_association_service = + dfp.service(:UserTeamAssociationService, API_VERSION) + + # Create a statement to select user team associations. + statement = dfp.new_statement_builder() + + # Retrieve a small amount of user team associations at a time, paging + # through until all user team associations have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_team_association_service. + get_user_team_associations_by_statement(statement.to_statement()) + + # Print out some information for each user team association. + unless page[:results].nil? + page[:results].each_with_index do |user_team_association, index| + puts ('%d) User team association with team ID %d and user ID %d was ' + + 'found.') % [index + statement.offset, + user_team_association[:team_id], user_team_association[:user_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of user team associations: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_all_user_team_associations(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/user_team_association_service/get_user_team_associations_for_user.rb b/dfp_api/examples/v201802/user_team_association_service/get_user_team_associations_for_user.rb new file mode 100755 index 000000000..79dcee25a --- /dev/null +++ b/dfp_api/examples/v201802/user_team_association_service/get_user_team_associations_for_user.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets all user team associations (i.e. teams) for a given user. + +require 'dfp_api' + +def get_user_team_associations_for_user(dfp, user_id) + # Get the UserTeamAssociationService. + user_team_association_service = + dfp.service(:UserTeamAssociationService, API_VERSION) + + # Create a statement to select user team associations. + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + end + + # Retrieve a small amount of user team associations at a time, paging + # through until all user team associations have been retrieved. + page = {:total_result_set_size => 0} + begin + page = user_team_association_service. + get_user_team_associations_by_statement(statement.to_statement()) + + # Print out some information for each user team association. + unless page[:results].nil? + page[:results].each_with_index do |user_team_association, index| + puts ('%d) User team association with user ID %d and team ID %d was ' + + 'found.') % [index + statement.offset, + user_team_association[:user_id], user_team_association[:team_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of user team associations: %d' % + page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + user_id = 'INSERT_USER_ID_HERE'.to_i + get_user_team_associations_for_user(dfp, user_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201705/user_team_association_service/update_user_team_associations.rb b/dfp_api/examples/v201802/user_team_association_service/update_user_team_associations.rb similarity index 64% rename from dfp_api/examples/v201705/user_team_association_service/update_user_team_associations.rb rename to dfp_api/examples/v201802/user_team_association_service/update_user_team_associations.rb index 85c1e4b21..1379048cf 100755 --- a/dfp_api/examples/v201705/user_team_association_service/update_user_team_associations.rb +++ b/dfp_api/examples/v201802/user_team_association_service/update_user_team_associations.rb @@ -23,53 +23,41 @@ require 'dfp_api' - -API_VERSION = :v201705 - -def update_user_team_associations() - # Get DfpApi instance and load configuration from ~/dfp_api.yml. - dfp = DfpApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # dfp.logger = Logger.new('dfp_xml.log') - +def update_user_team_associations(dfp, user_id) # Get the UserTeamAssociationService. uta_service = dfp.service(:UserTeamAssociationService, API_VERSION) - # Set the user to set to read only access within its teams. - user_id = 'INSERT_USER_ID_HERE'.to_i - # Create filter text to select user team associations by the user ID. - statement = DfpApi::FilterStatement.new( - 'WHERE userId = :user_id ORDER BY id ASC', - [ - {:key => 'user_id', - :value => {:value => user_id, :xsi_type => 'NumberValue'}}, - ] - ) + statement = dfp.new_statement_builder do |sb| + sb.where = 'userId = :user_id' + sb.with_bind_variable('user_id', user_id) + sb.order_by = 'id' + end # Get user team associations by statement. page = uta_service.get_user_team_associations_by_statement( - statement.toStatement()) + statement.to_statement() + ) + if page[:results].to_a.empty? + raise 'No user team assiciations found to update.' + end - if page[:results] and !page[:results].empty? - associations = page[:results] - associations.each do |association| - # Update local user team association to read-only access. - association[:overridden_team_access_type] = 'READ_ONLY' - end + associations = page[:results] + associations.each do |association| + # Update local user team association to read-only access. + association[:overridden_team_access_type] = 'READ_ONLY' + end - # Update the user team association on the server. - return_associations = - uta_service.update_user_team_associations(associations) + # Update the user team association on the server. + updated_associations = + uta_service.update_user_team_associations(associations) - # Display results. - return_associations.each do |association| - puts ("User team association between user ID %d and team ID %d was " + - "updated with access type '%s'") % - [association[:user_id], association[:team_id], - association[:overridden_team_access_type]] + # Display results. + if updated_associations.to_a.size > 0 + updated_associations.each do |association| + puts ('User team association between user ID %d and team ID %d was ' + + 'updated with access type "%s".') % [association[:user_id], + association[:team_id], association[:overridden_team_access_type]] end else puts 'No user team associations were updated.' @@ -77,8 +65,18 @@ def update_user_team_associations() end if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + begin - update_user_team_associations() + user_id = 'INSERT_USER_ID_HERE'.to_i + update_user_team_associations(dfp, user_id) # HTTP errors. rescue AdsCommon::Errors::HttpError => e diff --git a/dfp_api/examples/v201802/workflow_request_service/get_workflow_approval_requests.rb b/dfp_api/examples/v201802/workflow_request_service/get_workflow_approval_requests.rb new file mode 100755 index 000000000..365038027 --- /dev/null +++ b/dfp_api/examples/v201802/workflow_request_service/get_workflow_approval_requests.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets workflow approval requests. Workflow approval requests must +# be approved or rejected for a workflow to finish. + +require 'dfp_api' + +def get_workflow_approval_requests(dfp) + # Get the WorkflowRequestService. + workflow_request_service = dfp.service(:WorkflowRequestService, API_VERSION) + + # Create a statement to select workflow requests. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'WORKFLOW_APPROVAL_REQUEST') + end + + # Retrieve a small amount of workflow requests at a time, paging + # through until all workflow requests have been retrieved. + page = {:total_result_set_size => 0} + begin + page = workflow_request_service.get_workflow_requests_by_statement( + statement.to_statement() + ) + + # Print out some information for each workflow request. + unless page[:results].nil? + page[:results].each_with_index do |workflow_request, index| + puts ('%d) Workflow request with ID %d, entity type "%s", and entity ' + + 'ID %d was found.') % [index + statement.offset, + workflow_request[:id], workflow_request[:entity_type], + workflow_request[:entity_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of workflow requests: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_workflow_approval_requests(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/examples/v201802/workflow_request_service/get_workflow_external_condition_requests.rb b/dfp_api/examples/v201802/workflow_request_service/get_workflow_external_condition_requests.rb new file mode 100755 index 000000000..579bc85e2 --- /dev/null +++ b/dfp_api/examples/v201802/workflow_request_service/get_workflow_external_condition_requests.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2016, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# This example gets workflow external condition requests. Workflow external +# condition requests must be triggered or skipped for a workflow to finish. + +require 'dfp_api' + +def get_workflow_external_condition_requests(dfp) + # Get the WorkflowRequestService. + workflow_request_service = dfp.service(:WorkflowRequestService, API_VERSION) + + # Create a statement to select workflow requests. + statement = dfp.new_statement_builder do |sb| + sb.where = 'type = :type' + sb.with_bind_variable('type', 'WORKFLOW_EXTERNAL_CONDITION_REQUEST') + end + + # Retrieve a small amount of workflow requests at a time, paging + # through until all workflow requests have been retrieved. + page = {:total_result_set_size => 0} + begin + page = workflow_request_service.get_workflow_requests_by_statement( + statement.to_statement() + ) + + # Print out some information for each workflow request. + unless page[:results].nil? + page[:results].each_with_index do |workflow_request, index| + puts ('%d) Workflow request with ID %d, entity type "%s", and entity ' + + 'ID %d was found.') % [index + statement.offset, + workflow_request[:id], workflow_request[:entity_type], + workflow_request[:entity_id]] + end + end + + # Increase the statement offset by the page size to get the next page. + statement.offset += statement.limit + end while statement.offset < page[:total_result_set_size] + + puts 'Total number of workflow requests: %d' % page[:total_result_set_size] +end + +if __FILE__ == $0 + API_VERSION = :v201802 + + # Get DfpApi instance and load configuration from ~/dfp_api.yml. + dfp = DfpApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # dfp.logger = Logger.new('dfp_xml.log') + + begin + get_workflow_external_condition_requests(dfp) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue DfpApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/dfp_api/google-dfp-api.gemspec b/dfp_api/google-dfp-api.gemspec old mode 100755 new mode 100644 index c74ce7055..d90e11c46 --- a/dfp_api/google-dfp-api.gemspec +++ b/dfp_api/google-dfp-api.gemspec @@ -37,4 +37,5 @@ Gem::Specification.new do |s| s.files = Dir.glob('lib/**/*') + %w(COPYING README.md ChangeLog dfp_api.yml) s.add_dependency('google-ads-common', '~> 1.0.0') + s.add_dependency('tzinfo', '~> 1.0') end diff --git a/dfp_api/lib/dfp_api.rb b/dfp_api/lib/dfp_api.rb old mode 100755 new mode 100644 index 489c7a765..94d7ecd6e --- a/dfp_api/lib/dfp_api.rb +++ b/dfp_api/lib/dfp_api.rb @@ -23,6 +23,9 @@ require 'dfp_api/credential_handler' require 'dfp_api/errors' require 'dfp_api/dfp_api_statement' +require 'dfp_api/dfp_api_datetime' +require 'dfp_api/pql_statement_utils' +require 'dfp_api/utils_reporter' # Main namespace for all the client library's modules and classes. module DfpApi @@ -32,10 +35,13 @@ module DfpApi # Holds all the services, as well as login credentials. # class Api < AdsCommon::Api + attr_reader :utils_reporter + # Constructor for API. def initialize(provided_config = nil) super(provided_config) @credential_handler = DfpApi::CredentialHandler.new(@config) + @utils_reporter = DfpApi::UtilsReporter.new(@credential_handler) end # Getter for the API service configurations. @@ -43,6 +49,45 @@ def api_config DfpApi::ApiConfig end + # Returns an instance of StatementBuilder object. + def new_statement_builder(&block) + return DfpApi::StatementBuilder.new(self, &block) + end + + def new_report_statement_builder(&block) + statement = DfpApi::StatementBuilder.new(self) do |sb| + sb.limit = nil + sb.offset = nil + end + statement.configure(&block) + return statement + end + + # Returns an instance of DfpDate. + def date(*args) + return DfpApi::DfpDate.new(self, *args) + end + + # Returns an instance of DfpDate representing the current day. + def today(*args) + return DfpApi::DfpDate.today(self, *args) + end + + # Returns an instance of DfpDateTime. + def datetime(*args) + return DfpApi::DfpDateTime.new(self, *args) + end + + # Returns an instance of DfpDateTime representing the current time. + def now(*args) + return DfpApi::DfpDateTime.now(self, *args) + end + + # Returns an instance of DfpDateTime in the UTC timezone. + def utc(*args) + return DfpApi::DfpDateTime.utc(self, *args) + end + private # Retrieve DFP HeaderHandler per credential. diff --git a/dfp_api/lib/dfp_api/api_config.rb b/dfp_api/lib/dfp_api/api_config.rb old mode 100755 new mode 100644 index ef3ebf3de..623be767f --- a/dfp_api/lib/dfp_api/api_config.rb +++ b/dfp_api/lib/dfp_api/api_config.rb @@ -31,8 +31,8 @@ class << ApiConfig end # Set defaults - DEFAULT_VERSION = :v201711 - LATEST_VERSION = :v201711 + DEFAULT_VERSION = :v201802 + LATEST_VERSION = :v201802 # Set other constants API_NAME = 'DfpApi' @@ -40,30 +40,6 @@ class << ApiConfig # Configure the services available to each version @@service_config = { - :v201702 => [:ActivityGroupService, :ActivityService, - :AdExclusionRuleService, :AdRuleService, - :AudienceSegmentService, :BaseRateService, :CompanyService, - :ContactService, :ContentBundleService, - :ContentMetadataKeyHierarchyService, :ContentService, - :CreativeService, :CreativeSetService, - :CreativeTemplateService, :CreativeWrapperService, - :CustomFieldService, :CustomTargetingService, - :ExchangeRateService, :ForecastService, :InventoryService, - :LabelService, :LineItemCreativeAssociationService, - :LineItemService, :LineItemTemplateService, - :LiveStreamEventService, :MobileApplicationService, - :NativeStyleService, :NetworkService, :OrderService, - :PackageService, :ProductPackageService, - :ProductPackageItemService, :PlacementService, - :PremiumRateService, :ProductService, - :ProductTemplateService, :ProposalLineItemService, - :ProposalService, :PublisherQueryLanguageService, - :RateCardService, :ReconciliationOrderReportService, - :ReconciliationLineItemReportService, - :ReconciliationReportRowService, - :ReconciliationReportService, :ReportService, - :SuggestedAdUnitService, :TeamService, :UserService, - :UserTeamAssociationService, :WorkflowRequestService], :v201705 => [:ActivityGroupService, :ActivityService, :AdExclusionRuleService, :AdRuleService, :AudienceSegmentService, :BaseRateService, :CompanyService, @@ -136,7 +112,7 @@ class << ApiConfig :ReconciliationReportService, :ReportService, :SuggestedAdUnitService, :TeamService, :UserService, :UserTeamAssociationService, :WorkflowRequestService], - :v201711 => [:ActivityGroupService, :ActivityService, + :v201802 => [:ActivityGroupService, :ActivityService, :AdExclusionRuleService, :AdRuleService, :AudienceSegmentService, :BaseRateService, :CompanyService, :CdnConfigurationService, :ContactService, @@ -159,17 +135,17 @@ class << ApiConfig :ReconciliationReportRowService, :ReconciliationReportService, :ReportService, :SuggestedAdUnitService, :TeamService, :UserService, - :UserTeamAssociationService, :WorkflowRequestService], + :UserTeamAssociationService, :WorkflowRequestService] } # Configure the base URL for each version and scope. @@config = { :oauth_scope => 'https://www.googleapis.com/auth/dfp', :header_ns => 'https://www.google.com/apis/ads/publisher/', - :v201702 => 'https://ads.google.com/apis/ads/publisher/', :v201705 => 'https://ads.google.com/apis/ads/publisher/', :v201708 => 'https://ads.google.com/apis/ads/publisher/', - :v201711 => 'https://ads.google.com/apis/ads/publisher/' + :v201711 => 'https://ads.google.com/apis/ads/publisher/', + :v201802 => 'https://ads.google.com/apis/ads/publisher/' } public diff --git a/dfp_api/lib/dfp_api/credential_handler.rb b/dfp_api/lib/dfp_api/credential_handler.rb old mode 100755 new mode 100644 index d44803245..e2031d7d3 --- a/dfp_api/lib/dfp_api/credential_handler.rb +++ b/dfp_api/lib/dfp_api/credential_handler.rb @@ -19,6 +19,7 @@ require 'ads_common/credential_handler' require 'dfp_api/api_config' +require 'dfp_api/utils' module DfpApi @@ -31,17 +32,21 @@ class CredentialHandler < AdsCommon::CredentialHandler def credentials(credentials_override = nil) result = super(credentials_override) validate_headers_for_server(result) + include_utils = @config.read('library.include_utilities_in_user_agent', + true) result[:extra_headers] = { - 'applicationName' => generate_user_agent(), + 'applicationName' => generate_user_agent([], include_utils), 'networkCode' => result[:network_code] } return result end # Generates string to use as user agent in headers. - def generate_user_agent(extra_ids = []) + def generate_user_agent(extra_ids = [], include_utilities = true) agent_app = @config.read('authentication.application_name') extra_ids << ["DfpApi-Ruby/%s" % DfpApi::ApiConfig::CLIENT_LIB_VERSION] + utility_registry = DfpApi::Utils::UtilityRegistry.instance + extra_ids += utility_registry.extract!.to_a if include_utilities super(extra_ids, agent_app) end diff --git a/dfp_api/lib/dfp_api/dfp_api_datetime.rb b/dfp_api/lib/dfp_api/dfp_api_datetime.rb new file mode 100644 index 000000000..3ddbeb7ed --- /dev/null +++ b/dfp_api/lib/dfp_api/dfp_api_datetime.rb @@ -0,0 +1,182 @@ +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# DfpDate and DfpDateTime convert between native ruby Date and Time objects and +# the DFP API's Date and DateTime objects. + +require 'date' +require 'tzinfo' + + +module DfpApi + class DfpDate + # Create a new DfpDate, a utility class that allows for interoperability + # between the DFP API's Date objects and ruby's Date class. + # + # Args: + # - args: + # - ([year, [month, [day]]]), integer values, uses Date defaults + # - (date), a native ruby Date object + # - (dfp_date), a DFP Date hash representation + # Returns: + # - dfp_date: an instance of DfpDate + def initialize(api, *args) + @api = api + @api.utils_reporter.dfp_date_used() + + case args.first + when Hash + hash = args.first + date_args = [hash[:year], hash[:month], hash[:day]] + when Date + date = args.first + date_args = [date.year, date.month, date.day] + else + date_args = args + end + @date = Date.new(*date_args) + end + + # Creates a DfpDate object denoting the present day. + def self.today(api, *args) + self.new(api, Date.today(*args)) + end + + # When an unrecognized method is applied to DfpDate, pass it through to the + # internal ruby Date. + def method_missing(name, *args, &block) + result = @date.send(name, *args, &block) + return self.class.new(@api, result) if result.is_a? Date + return result + end + + # Convert DfpDate into a hash representation which can be consumed by + # the DFP API. E.g., a hash that can be passed as PQL Date variables. + # + # Returns: + # - dfp_datetime: a DFP Date hash representation + def to_h() + return {:year => @date.year, :month => @date.month, :day => @date.day} + end + end + + class DfpDateTime + attr_accessor :timezone + + # Create a new DfpDateTime, a utility class that allows for interoperability + # between the DFP API's DateTime objects and ruby's Time class. The last + # argument must be a valid timezone identifier, e.g. "America/New_York". + # + # Args: + # - args: + # - ([year, [month, [day, [hour, [minute, [second,]]]]]] timezone) + # - (time, timezone), a native Time object and a timezone identifier + # - (dfp_datetime), a DFP DateTime hash representation + # + # Returns: + # - dfp_datetime: an instance of DfpDateTime + def initialize(api, *args) + @api = api + @api.utils_reporter.dfp_date_time_used() + + # Handle special cases when a DFP DateTime hash or ruby Time instance are + # passed as the first argument to the constructor. + case args.first + when Hash + hash = args.first + datetime_args = [hash[:date][:year], hash[:date][:month], + hash[:date][:day], hash[:hour], hash[:minute], hash[:second], + hash[:time_zone_id]] + when DfpDateTime, Time, DateTime + time = args.first + datetime_args = [args.last] + [:sec, :min, :hour, :day, :month, :year].each do |duration| + datetime_args.unshift(time.send(duration)) + end + else + datetime_args = args + end + # Check the validity of the timezone parameter, which is required. + if not TZInfo::Timezone.all_identifiers.include?(datetime_args.last) + raise "Last argument to DfpDateTime constructor must be valid timezone" + end + # Set timezone attribute and pass its utc offset into the Time + # constructor. + @timezone = TZInfo::Timezone.get(datetime_args.pop) + @time = Time.new(*datetime_args, + utc_offset=@timezone.current_period.utc_offset) + end + + # Create a DfpDateTime for the current time in the specified timezone. + # + # Args: + # - timezone: a valid timezone identifier, e.g. "America/New_York" + # + # Returns: + # - dfp_datetime: an instance of DfpDateTime + def self.now(api, timezone) + new(api, TZInfo::Timezone.get(timezone).now, timezone) + end + + # Create a DfpDateTime in the "UTC" timezone. Calls the DfpDateTime + # contstructor with timezone identifier "UTC". + # + # Args: + # - ([year, [month, [day, [hour, [minute, [second]]]]]]) + # + # Returns: + # - dfp_datetime: an instance of DfpDateTime + def self.utc(api, *args) + new(api, *args + ['UTC']) + end + + # Convert DfpDateTime into a hash representation which can be consumed by + # the DFP API. E.g., a hash that can be passed as PQL DateTime variables. + # + # Returns: + # - dfp_datetime_hash: a hash representation of a DfpDateTime + def to_h + { + :date => DfpApi::DfpDate.new( + @api, @time.year, @time.month, @time.day + ).to_h, + :hour => @time.hour, + :minute => @time.min, + :second => @time.sec, + :time_zone_id => @timezone.identifier + } + end + + # When an unrecognized method is applied to DfpDateTime, pass it through to + # the internal ruby Time. + def method_missing(name, *args, &block) + # Restrict time zone related functions from being passed to internal ruby + # Time attribute, since DfpDateTime handles timezones its own way + restricted_functions = [:dst?, :getgm, :getlocal, :getutc, :gmt, + :gmtime, :gmtoff, :isdst, :localtime, :utc] + if restricted_functions.include? name + raise NoMethodError, 'undefined method %s for %s' % [name, self] + end + result = @time.send(name, *args, &block) + if result.is_a? Time + return self.class.new(@api, result, @timezone.identifier) + else + return result + end + end + end +end diff --git a/dfp_api/lib/dfp_api/dfp_api_statement.rb b/dfp_api/lib/dfp_api/dfp_api_statement.rb old mode 100755 new mode 100644 index 025d09a8f..db0aa8524 --- a/dfp_api/lib/dfp_api/dfp_api_statement.rb +++ b/dfp_api/lib/dfp_api/dfp_api_statement.rb @@ -23,6 +23,7 @@ module DfpApi SUGGESTED_PAGE_LIMIT = 500 # A statement object for PQL and get*ByStatement queries. + # Deprecated. Use StatementBuilder instead. class FilterStatement # Constructor for a Filter Statement. def initialize(query_statement='', values=[], limit=SUGGESTED_PAGE_LIMIT, @@ -37,17 +38,25 @@ def initialize(query_statement='', values=[], limit=SUGGESTED_PAGE_LIMIT, attr_accessor :offset def toStatement() + register_filter_statement_util() statement = @query_statement + ' LIMIT %d OFFSET %d' % [@limit, @offset] return {:query => statement, :values => @values} end def toStatementForAction() + register_filter_statement_util() return {:query => @query_statement.dup(), :values => @values} end def toStatementWithoutOffset() + register_filter_statement_util() statement = @query_statement + ' LIMIT %d' % [@limit] return {:query => statement, :values => @values} end + + private + def register_filter_statement_util() + DfpApi::Utils::UtilityRegistry.instance.add('FilterStatement') + end end end diff --git a/dfp_api/lib/dfp_api/errors.rb b/dfp_api/lib/dfp_api/errors.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/pql_statement_utils.rb b/dfp_api/lib/dfp_api/pql_statement_utils.rb new file mode 100644 index 000000000..5df2c7b79 --- /dev/null +++ b/dfp_api/lib/dfp_api/pql_statement_utils.rb @@ -0,0 +1,193 @@ +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# StatementBuilder object to allow for simpler PQL statement generation. + +require 'dfp_api/dfp_api_datetime' + + +module DfpApi + # Default page size to use with the StatementBuilder. + SUGGESTED_PAGE_LIMIT = 500 + + # Query class used by StatementBuilder. + class PQLQuery + # Create a new query. + def initialize(query = nil) + @query = (query.nil?) ? nil : query.dup() + end + + # Concatenate a new clause onto the current query. + def <<(clause) + @query = (@query.nil?) ? clause : @query << ' ' << clause + end + + # Return the query string for a PQLQuery + def to_s() + @query.dup() + end + end + + # Values class used by StatementBuilder. + class PQLValues + VALUE_TYPES = { + Numeric => 'NumberValue', + Integer => 'NumberValue', + Float => 'NumberValue', + String => 'TextValue', + TrueClass => 'BooleanValue', + FalseClass => 'BooleanValue', + Array => 'SetValue', + DfpApi::DfpDate => 'DateValue', + DfpApi::DfpDateTime => 'DateTimeValue' + } + + # Create a new values object. + def initialize(values = {}) + @values = values || {} + end + + # Add a value to the current values object on the provided key. + def add_value(key, value) + @values[key.to_sym] = generate_value_object(value) + end + + # Get values as an array, the format the DFP API expects. + def values() + # values_array is a DFP compliant list of values of the following form: + # [:key => ..., :value => {:xsi_type => ..., :value => ...}] + values_array = @values.map do |key, value| + raise 'Missing value in StatementBuilder.' if value.nil? + raise 'Value cannot be nil on StatementBuilder.' if value[:value].nil? + raise 'Missing value type for %s.' % key if value[:xsi_type].nil? + unless VALUE_TYPES.values.include?(value[:xsi_type]) + raise 'Unknown value type for %s.' % key + end + if value[:xsi_type] == 'SetValue' + if value[:value].map {|v| v.class}.to_set.size > 1 + raise 'Cannot pass more than one type in set variable, %s.' % key + end + end + if value[:xsi_type] == 'DateTimeValue' + unless value[:value][:time_zone_id] + raise 'Missing timezone on DateTimeValue variable, %s.' %key + end + end + {:key => key.to_s(), :value => value} + end + return values_array + end + + # Create an individual value object by inferring the xsi_type. If the value + # type isn't recognized, return the original value parameter. + def generate_value_object(value) + type = VALUE_TYPES[value.class] + if [DfpApi::DfpDate, DfpApi::DfpDateTime].include?(value.class) + value = value.to_h + end + return value if type.nil? + return {:xsi_type => type, :value => value} + end + end + + # A utility class for building PQL statements, used by the + # PublisherQueryLanguageService and other services' get*ByStatement and + # perform*Action requsts. + # + # Example usage: + # sb = DfpApi::StatementBuilder.new do |b| + # b.select = 'ChangeDateTime, EntityId, EntityType, Operation' + # b.from = 'Change_History' + # b.where = 'ChangeDateTime < :start_date_time ' + + # 'AND ChangeDateTime > :end_date_time' + # b.with_bind_variable('start_date_time', DfpApi::DfpDate.today-1) + # b.with_bind_variable('end_date_time', DfpApi::Date.today) + # b.order_by = 'ChangeDateTime' + # b.ascending = false + # end + # sb.to_statement() + # + class StatementBuilder + SELECT = 'SELECT %s' + FROM = 'FROM %s' + WHERE = 'WHERE %s' + ORDER = 'ORDER BY %s %s' + LIMIT = 'LIMIT %d' + OFFSET = 'OFFSET %d' + + attr_accessor :select, :from, :where, :order_by, :ascending, :limit, :offset + + # Create a StatementBuilder object. + def initialize(api, &block) + @api = api + @select = nil + @from = nil + @where = nil + @order_by = nil + @ascending = true + @limit = SUGGESTED_PAGE_LIMIT + @offset = 0 + @pql_values = PQLValues.new + yield self if block_given? + end + + # Edit a StatmentBuilder object with a block. + def configure(&block) + yield self + end + + # Add a value to be matched to bind a variable in WHERE conditions. + def with_bind_variable(key, value) + @pql_values.add_value(key, value) + return self + end + + # Return a list of validation errors. + def validate() + if !@select.to_s.strip.empty? and @from.to_s.strip.empty? + raise 'FROM clause is required with SELECT' + end + if !@from.to_s.strip.empty? and @select.to_s.strip.empty? + raise 'SELECT clause is required with FROM' + end + if !@offset.nil? and @limit.nil? + raise 'LIMIT clause is required with OFFSET' + end + unless @limit.is_a? Integer or @limit.nil? + raise 'LIMIT must be an integer' + end + unless @offset.is_a? Integer or @offset.nil? + raise 'OFFSET must be an integer' + end + end + + # Create a statement object that can be sent in a DFP API request. + def to_statement() + @api.utils_reporter.statement_builder_used() + validate() + ordering = @ascending ? 'ASC' : 'DESC' + pql_query = PQLQuery.new + pql_query << SELECT % @select unless @select.to_s.empty? + pql_query << FROM % @from unless @from.to_s.empty? + pql_query << WHERE % @where unless @where.to_s.empty? + pql_query << ORDER % [@order_by, ordering] unless @order_by.to_s.empty? + pql_query << LIMIT % @limit unless @limit.nil? + pql_query << OFFSET % @offset unless @offset.nil? + return {:query => pql_query.to_s(), :values => @pql_values.values} + end + end +end diff --git a/dfp_api/lib/dfp_api/utils.rb b/dfp_api/lib/dfp_api/utils.rb new file mode 100644 index 000000000..86efd4506 --- /dev/null +++ b/dfp_api/lib/dfp_api/utils.rb @@ -0,0 +1,56 @@ +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Misc DFP utilities. + +require 'set' +require 'thread' +require 'singleton' + + +module DfpApi + module Utils + # Class to keep a list of unique utilities used in order to perform tracking + # of client library features. + class UtilityRegistry + include Singleton + attr_accessor :enabled + + def initialize + @enabled = true + @registry = Set.new + @lock = Mutex.new + end + + def extract! + @lock.synchronize do + registry = @registry.dup + @registry.clear + return registry + end + end + + def length + @lock.synchronize { @registry.length } + end + + def add(util) + @lock.synchronize { @registry.add(util) if @enabled } + end + end + end +end diff --git a/dfp_api/lib/dfp_api/utils_reporter.rb b/dfp_api/lib/dfp_api/utils_reporter.rb new file mode 100644 index 000000000..3c143b80f --- /dev/null +++ b/dfp_api/lib/dfp_api/utils_reporter.rb @@ -0,0 +1,52 @@ +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Contains methods to help configure the user agent string to report on utility +# usage. + +require 'dfp_api/credential_handler' + +module DfpApi + class UtilsReporter + # Default constructor. + # + # Args: + # - credential_handler: The CredentialHandler being used by the current + # DfpApi instance. + def initialize(credential_handler) + @credential_handler = credential_handler + end + + # A callback method for StatementBuilder to indicate that it has been + # used, and that its usage should be recorded in the next user agent string. + def statement_builder_used() + @credential_handler.include_in_user_agent("StatementBuilder") + end + + # A callback method for DfpDate to indicate that it has been + # used, and that its usage should be recorded in the next user agent string. + def dfp_date_used() + @credential_handler.include_in_user_agent("DfpDate") + end + + # A callback method for DfpDateTime to indicate that it has been + # used, and that its usage should be recorded in the next user agent string. + def dfp_date_time_used() + @credential_handler.include_in_user_agent("DfpDateTime") + end + end +end diff --git a/dfp_api/lib/dfp_api/v201702/activity_group_service_registry.rb b/dfp_api/lib/dfp_api/v201702/activity_group_service_registry.rb deleted file mode 100755 index 146b67f87..000000000 --- a/dfp_api/lib/dfp_api/v201702/activity_group_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:47. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ActivityGroupService - class ActivityGroupServiceRegistry - ACTIVITYGROUPSERVICE_METHODS = {:create_activity_groups=>{:input=>[{:name=>:activity_groups, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_activity_groups_response", :fields=>[{:name=>:rval, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_activity_groups_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_activity_groups_by_statement_response", :fields=>[{:name=>:rval, :type=>"ActivityGroupPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_activity_groups=>{:input=>[{:name=>:activity_groups, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_activity_groups_response", :fields=>[{:name=>:rval, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - ACTIVITYGROUPSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivityError=>{:fields=>[{:name=>:reason, :type=>"ActivityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ActivityGroup=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:impressions_lookback, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_lookback, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ActivityGroup.Status", :min_occurs=>0, :max_occurs=>1}]}, :ActivityGroupPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ActivityError.Reason"=>{:fields=>[]}, :"ActivityGroup.Status"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - ACTIVITYGROUPSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return ACTIVITYGROUPSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return ACTIVITYGROUPSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return ACTIVITYGROUPSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ActivityGroupServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/activity_service_registry.rb b/dfp_api/lib/dfp_api/v201702/activity_service_registry.rb deleted file mode 100755 index 64ce761c1..000000000 --- a/dfp_api/lib/dfp_api/v201702/activity_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:48. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ActivityService - class ActivityServiceRegistry - ACTIVITYSERVICE_METHODS = {:create_activities=>{:input=>[{:name=>:activities, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_activities_response", :fields=>[{:name=>:rval, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_activities_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_activities_by_statement_response", :fields=>[{:name=>:rval, :type=>"ActivityPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_activities=>{:input=>[{:name=>:activities, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_activities_response", :fields=>[{:name=>:rval, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - ACTIVITYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :Activity=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:activity_group_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:expected_url, :original_name=>"expectedURL", :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Activity.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Activity.Type", :min_occurs=>0, :max_occurs=>1}]}, :ActivityError=>{:fields=>[{:name=>:reason, :type=>"ActivityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ActivityPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"Activity.Status"=>{:fields=>[]}, :"Activity.Type"=>{:fields=>[]}, :"ActivityError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - ACTIVITYSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return ACTIVITYSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return ACTIVITYSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return ACTIVITYSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ActivityServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service_registry.rb deleted file mode 100755 index cc21ab96d..000000000 --- a/dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:49. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module AdExclusionRuleService - class AdExclusionRuleServiceRegistry - ADEXCLUSIONRULESERVICE_METHODS = {:create_ad_exclusion_rules=>{:input=>[{:name=>:ad_exclusion_rules, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_exclusion_rules_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_exclusion_rules_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_exclusion_rules_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRulePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_exclusion_rule_action=>{:input=>[{:name=>:ad_exclusion_rule_action, :type=>"AdExclusionRuleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_exclusion_rule_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_exclusion_rules=>{:input=>[{:name=>:ad_exclusion_rules, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_exclusion_rules_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - ADEXCLUSIONRULESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdExclusionRules=>{:fields=>[], :base=>"AdExclusionRuleAction"}, :AdExclusionRuleAction=>{:fields=>[], :abstract=>true}, :AdExclusionRule=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_block_all, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:blocked_label_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allowed_label_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:type, :type=>"AdExclusionRuleType", :min_occurs=>0, :max_occurs=>1}]}, :AdExclusionRuleError=>{:fields=>[{:name=>:reason, :type=>"AdExclusionRuleError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdExclusionRulePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAdExclusionRules=>{:fields=>[], :base=>"AdExclusionRuleAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdExclusionRuleError.Reason"=>{:fields=>[]}, :AdExclusionRuleType=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - ADEXCLUSIONRULESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return ADEXCLUSIONRULESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return ADEXCLUSIONRULESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return ADEXCLUSIONRULESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, AdExclusionRuleServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/ad_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201702/ad_rule_service_registry.rb deleted file mode 100755 index ceb7eee6f..000000000 --- a/dfp_api/lib/dfp_api/v201702/ad_rule_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:50. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module AdRuleService - class AdRuleServiceRegistry - ADRULESERVICE_METHODS = {:create_ad_rules=>{:input=>[{:name=>:ad_rules, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_rules_response", :fields=>[{:name=>:rval, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_rules_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_rules_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdRulePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_rule_action=>{:input=>[{:name=>:ad_rule_action, :type=>"AdRuleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_rule_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_rules=>{:input=>[{:name=>:ad_rules, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_rules_response", :fields=>[{:name=>:rval, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - ADRULESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :AdRuleAction=>{:fields=>[], :abstract=>true}, :AdRuleDateError=>{:fields=>[{:name=>:reason, :type=>"AdRuleDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdRule=>{:fields=>[{:name=>:ad_rule_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdRuleStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_cap_behavior, :type=>"FrequencyCapBehavior", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_impressions_per_line_item_per_stream, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_impressions_per_line_item_per_pod, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:preroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}, {:name=>:postroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}]}, :AdRuleFrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"AdRuleFrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NoPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :OptimizedPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :AdRulePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdRulePriorityError=>{:fields=>[{:name=>:reason, :type=>"AdRulePriorityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseAdRuleSlot=>{:fields=>[{:name=>:slot_behavior, :type=>"AdRuleSlotBehavior", :min_occurs=>0, :max_occurs=>1}, {:name=>:min_video_ad_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_video_ad_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_midroll_frequency_type, :type=>"MidrollFrequencyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_midroll_frequency, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bumper, :type=>"AdRuleSlotBumper", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_bumper_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:min_pod_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_pod_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_ads_in_pod, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdRuleSlotError=>{:fields=>[{:name=>:reason, :type=>"AdRuleSlotError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StandardPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :AdRuleTargetingError=>{:fields=>[{:name=>:reason, :type=>"AdRuleTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeactivateAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :DeleteAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PoddingError=>{:fields=>[{:name=>:reason, :type=>"PoddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnknownAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdRuleDateError.Reason"=>{:fields=>[]}, :"AdRuleFrequencyCapError.Reason"=>{:fields=>[]}, :"AdRulePriorityError.Reason"=>{:fields=>[]}, :AdRuleSlotBehavior=>{:fields=>[]}, :AdRuleSlotBumper=>{:fields=>[]}, :"AdRuleSlotError.Reason"=>{:fields=>[]}, :AdRuleStatus=>{:fields=>[]}, :"AdRuleTargetingError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :FrequencyCapBehavior=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :MidrollFrequencyType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PoddingError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} - ADRULESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return ADRULESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return ADRULESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return ADRULESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, AdRuleServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/audience_segment_service_registry.rb b/dfp_api/lib/dfp_api/v201702/audience_segment_service_registry.rb deleted file mode 100755 index 9182be9b1..000000000 --- a/dfp_api/lib/dfp_api/v201702/audience_segment_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:52. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module AudienceSegmentService - class AudienceSegmentServiceRegistry - AUDIENCESEGMENTSERVICE_METHODS = {:create_audience_segments=>{:input=>[{:name=>:segments, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_audience_segments_response", :fields=>[{:name=>:rval, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_audience_segments_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_audience_segments_by_statement_response", :fields=>[{:name=>:rval, :type=>"AudienceSegmentPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_audience_segment_action=>{:input=>[{:name=>:action, :type=>"AudienceSegmentAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_audience_segment_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_audience_segments=>{:input=>[{:name=>:segments, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_audience_segments_response", :fields=>[{:name=>:rval, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - AUDIENCESEGMENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :AudienceSegmentDataProvider=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FirstPartyAudienceSegment=>{:fields=>[], :abstract=>true, :base=>"AudienceSegment"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ThirdPartyAudienceSegment=>{:fields=>[{:name=>:approval_status, :type=>"ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:license_type, :type=>"ThirdPartyAudienceSegment.LicenseType", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"AudienceSegment"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NonRuleBasedFirstPartyAudienceSegment=>{:fields=>[{:name=>:membership_expiration_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"FirstPartyAudienceSegment"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PopulateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FirstPartyAudienceSegmentRule=>{:fields=>[{:name=>:inventory_rule, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_criteria_rule, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}]}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RuleBasedFirstPartyAudienceSegment=>{:fields=>[{:name=>:rule, :type=>"FirstPartyAudienceSegmentRule", :min_occurs=>0, :max_occurs=>1}], :base=>"RuleBasedFirstPartyAudienceSegmentSummary"}, :RuleBasedFirstPartyAudienceSegmentSummary=>{:fields=>[{:name=>:page_views, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:recency_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:membership_expiration_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"FirstPartyAudienceSegment"}, :AudienceSegmentAction=>{:fields=>[], :abstract=>true}, :AudienceSegment=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:category_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AudienceSegment.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_web_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:idfa_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_id_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:data_provider, :type=>"AudienceSegmentDataProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"AudienceSegment.Type", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SharedAudienceSegment=>{:fields=>[], :base=>"AudienceSegment"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus"=>{:fields=>[]}, :"ThirdPartyAudienceSegment.LicenseType"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"AudienceSegment.Type"=>{:fields=>[]}, :"AudienceSegment.Status"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - AUDIENCESEGMENTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return AUDIENCESEGMENTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return AUDIENCESEGMENTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return AUDIENCESEGMENTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, AudienceSegmentServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/base_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201702/base_rate_service_registry.rb deleted file mode 100755 index ba3518952..000000000 --- a/dfp_api/lib/dfp_api/v201702/base_rate_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:53. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module BaseRateService - class BaseRateServiceRegistry - BASERATESERVICE_METHODS = {:create_base_rates=>{:input=>[{:name=>:base_rates, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_base_rates_response", :fields=>[{:name=>:rval, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_base_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_base_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"BaseRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_base_rate_action=>{:input=>[{:name=>:base_rate_action, :type=>"BaseRateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_base_rate_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_base_rates=>{:input=>[{:name=>:base_rates, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_base_rates_response", :fields=>[{:name=>:rval, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - BASERATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRateAction=>{:fields=>[], :abstract=>true}, :BaseRateActionError=>{:fields=>[{:name=>:reason, :type=>"BaseRateActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRate=>{:fields=>[{:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRatePage=>{:fields=>[{:name=>:results, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteBaseRates=>{:fields=>[], :base=>"BaseRateAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductBaseRate=>{:fields=>[{:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :ProductPackageItemBaseRate=>{:fields=>[{:name=>:product_package_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :ProductTemplateBaseRate=>{:fields=>[{:name=>:product_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnknownBaseRate=>{:fields=>[], :base=>"BaseRate"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateActionError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - BASERATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return BASERATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return BASERATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return BASERATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, BaseRateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/company_service_registry.rb b/dfp_api/lib/dfp_api/v201702/company_service_registry.rb deleted file mode 100755 index ede98042e..000000000 --- a/dfp_api/lib/dfp_api/v201702/company_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:54. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CompanyService - class CompanyServiceRegistry - COMPANYSERVICE_METHODS = {:create_companies=>{:input=>[{:name=>:companies, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_companies_response", :fields=>[{:name=>:rval, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_companies_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_companies_by_statement_response", :fields=>[{:name=>:rval, :type=>"CompanyPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_companies=>{:input=>[{:name=>:companies, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_companies_response", :fields=>[{:name=>:rval, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - COMPANYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Company=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Company.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fax_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:credit_status, :type=>"Company.CreditStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"CompanySettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:primary_contact_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:third_party_company_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :CompanyError=>{:fields=>[{:name=>:reason, :type=>"CompanyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CompanySettings=>{:fields=>[{:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_added_tax, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_commission, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NetworkError=>{:fields=>[{:name=>:reason, :type=>"NetworkError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"Company.CreditStatus"=>{:fields=>[]}, :"Company.Type"=>{:fields=>[]}, :"CompanyError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NetworkError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} - COMPANYSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return COMPANYSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return COMPANYSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return COMPANYSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CompanyServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/contact_service_registry.rb b/dfp_api/lib/dfp_api/v201702/contact_service_registry.rb deleted file mode 100755 index d543f67b6..000000000 --- a/dfp_api/lib/dfp_api/v201702/contact_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:56. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ContactService - class ContactServiceRegistry - CONTACTSERVICE_METHODS = {:create_contacts=>{:input=>[{:name=>:contacts, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_contacts_response", :fields=>[{:name=>:rval, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_contacts_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_contacts_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContactPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_contacts=>{:input=>[{:name=>:contacts, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_contacts_response", :fields=>[{:name=>:rval, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CONTACTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Contact=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Contact.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cell_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fax_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:title, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:work_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseContact"}, :ContactError=>{:fields=>[{:name=>:reason, :type=>"ContactError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContactPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseContact=>{:fields=>[]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"Contact.Status"=>{:fields=>[]}, :"ContactError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CONTACTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CONTACTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CONTACTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CONTACTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ContactServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_bundle_service_registry.rb b/dfp_api/lib/dfp_api/v201702/content_bundle_service_registry.rb deleted file mode 100755 index dfb806b23..000000000 --- a/dfp_api/lib/dfp_api/v201702/content_bundle_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:57. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ContentBundleService - class ContentBundleServiceRegistry - CONTENTBUNDLESERVICE_METHODS = {:create_content_bundles=>{:input=>[{:name=>:content_bundles, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_content_bundles_response", :fields=>[{:name=>:rval, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_content_bundles_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_bundles_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentBundlePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_content_bundle_action=>{:input=>[{:name=>:content_bundle_action, :type=>"ContentBundleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_content_bundle_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_content_bundles=>{:input=>[{:name=>:content_bundles, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_content_bundles_response", :fields=>[{:name=>:rval, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CONTENTBUNDLESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateContentBundles=>{:fields=>[], :base=>"ContentBundleAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundleAction=>{:fields=>[], :abstract=>true}, :ContentBundle=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ContentBundleStatus", :min_occurs=>0, :max_occurs=>1}]}, :ContentBundlePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateContentBundles=>{:fields=>[], :base=>"ContentBundleAction"}, :ExcludeContentFromContentBundle=>{:fields=>[{:name=>:content_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :base=>"ContentBundleAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IncludeContentInContentBundle=>{:fields=>[{:name=>:content_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :base=>"ContentBundleAction"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementError=>{:fields=>[{:name=>:reason, :type=>"PlacementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ContentBundleStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PlacementError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CONTENTBUNDLESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CONTENTBUNDLESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CONTENTBUNDLESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CONTENTBUNDLESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ContentBundleServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service_registry.rb b/dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service_registry.rb deleted file mode 100755 index 3ebc24140..000000000 --- a/dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:57. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ContentMetadataKeyHierarchyService - class ContentMetadataKeyHierarchyServiceRegistry - CONTENTMETADATAKEYHIERARCHYSERVICE_METHODS = {:create_content_metadata_key_hierarchies=>{:input=>[{:name=>:content_metadata_key_hierarchies, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_content_metadata_key_hierarchies_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_content_metadata_key_hierarchies_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_metadata_key_hierarchies_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchyPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_content_metadata_key_hierarchy_action=>{:input=>[{:name=>:content_metadata_key_hierarchy_action, :type=>"ContentMetadataKeyHierarchyAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_content_metadata_key_hierarchy_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_content_metadata_key_hierarchies=>{:input=>[{:name=>:content_metadata_key_hierarchies, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_content_metadata_key_hierarchies_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CONTENTMETADATAKEYHIERARCHYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyAction=>{:fields=>[], :abstract=>true}, :ContentMetadataKeyHierarchy=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:hierarchy_levels, :type=>"ContentMetadataKeyHierarchyLevel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"ContentMetadataKeyHierarchyStatus", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataKeyHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyLevel=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:hierarchy_level, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteContentMetadataKeyHierarchies=>{:fields=>[], :base=>"ContentMetadataKeyHierarchyAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ContentMetadataKeyHierarchyError.Reason"=>{:fields=>[]}, :ContentMetadataKeyHierarchyStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CONTENTMETADATAKEYHIERARCHYSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CONTENTMETADATAKEYHIERARCHYSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CONTENTMETADATAKEYHIERARCHYSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CONTENTMETADATAKEYHIERARCHYSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ContentMetadataKeyHierarchyServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_service_registry.rb b/dfp_api/lib/dfp_api/v201702/content_service_registry.rb deleted file mode 100755 index 42d92f352..000000000 --- a/dfp_api/lib/dfp_api/v201702/content_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:59. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ContentService - class ContentServiceRegistry - CONTENTSERVICE_METHODS = {:get_content_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_content_by_statement_and_custom_targeting_value=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_by_statement_and_custom_targeting_value_response", :fields=>[{:name=>:rval, :type=>"ContentPage", :min_occurs=>0, :max_occurs=>1}]}}} - CONTENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CmsContent=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cms_content_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Content=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ContentStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:status_defined_by, :type=>"ContentStatusDefinedBy", :min_occurs=>0, :max_occurs=>1}, {:name=>:dai_ingest_status, :type=>"DaiIngestStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:dai_ingest_errors, :type=>"DaiIngestError", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_dai_ingest_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:import_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_defined_custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mapping_rule_defined_custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:cms_sources, :type=>"CmsContent", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Content", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentPartnerError=>{:fields=>[{:name=>:reason, :type=>"ContentPartnerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DaiIngestError=>{:fields=>[{:name=>:reason, :type=>"DaiIngestErrorReason", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ContentPartnerError.Reason"=>{:fields=>[]}, :ContentStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :ContentStatusDefinedBy=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :DaiIngestErrorReason=>{:fields=>[]}, :DaiIngestStatus=>{:fields=>[]}} - CONTENTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CONTENTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CONTENTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CONTENTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ContentServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_service_registry.rb b/dfp_api/lib/dfp_api/v201702/creative_service_registry.rb deleted file mode 100755 index e4dd38496..000000000 --- a/dfp_api/lib/dfp_api/v201702/creative_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:00. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CreativeService - class CreativeServiceRegistry - CREATIVESERVICE_METHODS = {:create_creatives=>{:input=>[{:name=>:creatives, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_creatives_response", :fields=>[{:name=>:rval, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_creatives_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creatives_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativePage", :min_occurs=>0, :max_occurs=>1}]}}, :update_creatives=>{:input=>[{:name=>:creatives, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_creatives_response", :fields=>[{:name=>:rval, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CREATIVESERVICE_TYPES = {:BaseDynamicAllocationCreative=>{:fields=>[], :abstract=>true, :base=>"Creative"}, :BaseCreativeTemplateVariableValue=>{:fields=>[{:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdExchangeCreative=>{:fields=>[{:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"HasHtmlSnippetDynamicAllocationCreative"}, :AdMobBackfillCreative=>{:fields=>[{:name=>:additional_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:publisher_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseDynamicAllocationCreative"}, :AdSenseCreative=>{:fields=>[], :base=>"HasHtmlSnippetDynamicAllocationCreative"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AspectRatioImageCreative=>{:fields=>[{:name=>:image_assets, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"HasDestinationUrlCreative"}, :AssetCreativeTemplateVariableValue=>{:fields=>[{:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :Asset=>{:fields=>[], :abstract=>true}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseFlashCreative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tag_required, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_image_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseFlashRedirectCreative=>{:fields=>[{:name=>:flash_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseImageCreative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_image_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseImageRedirectCreative=>{:fields=>[{:name=>:image_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseRichMediaStudioCreative=>{:fields=>[{:name=>:studio_creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_format, :type=>"RichMediaStudioCreativeFormat", :min_occurs=>0, :max_occurs=>1}, {:name=>:artwork_type, :type=>"RichMediaStudioCreativeArtworkType", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_tag_keys, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_key_values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:survey_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:all_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:backup_image_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_css, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:required_flash_plugin_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_attribute, :type=>"RichMediaStudioCreativeBillingAttribute", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_studio_child_asset_properties, :type=>"RichMediaStudioChildAssetProperty", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Creative"}, :BaseVideoCreative=>{:fields=>[{:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_duration_override, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTag=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ClickTrackingCreative=>{:fields=>[{:name=>:click_tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConversionEvent_TrackingUrlsMapEntry=>{:fields=>[{:name=>:key, :type=>"ConversionEvent", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"TrackingUrls", :min_occurs=>0, :max_occurs=>1}]}, :CreativeAsset=>{:fields=>[{:name=>:asset_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_byte_array, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tags, :type=>"ClickTag", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:image_density, :type=>"ImageDensity", :min_occurs=>0, :max_occurs=>1}]}, :CustomCreativeAsset=>{:fields=>[{:name=>:macro_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}]}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Creative=>{:fields=>[{:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:policy_violations, :type=>"CreativePolicyViolation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}], :abstract=>true}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreative=>{:fields=>[{:name=>:html_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_creative_assets, :type=>"CustomCreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"HasDestinationUrlCreative"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :LegacyDfpMobileCreative=>{:fields=>[], :base=>"HasDestinationUrlCreative"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FlashCreative=>{:fields=>[{:name=>:swiffy_asset, :type=>"SwiffyFallbackAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:create_swiffy_asset, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tag_overlay_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashCreative"}, :FlashOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:api_framework, :type=>"ApiFramework", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashCreative"}, :FlashRedirectCreative=>{:fields=>[], :base=>"BaseFlashRedirectCreative"}, :FlashRedirectOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:api_framework, :type=>"ApiFramework", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashRedirectCreative"}, :HasDestinationUrlCreative=>{:fields=>[{:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url_type, :type=>"DestinationUrlType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Creative"}, :HasHtmlSnippetDynamicAllocationCreative=>{:fields=>[{:name=>:code_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"BaseDynamicAllocationCreative"}, :Html5Creative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_tracking_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:third_party_click_tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:html5_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageCreative=>{:fields=>[{:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_image_assets, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageCreative"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageCreative"}, :ImageRedirectCreative=>{:fields=>[{:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageRedirectCreative"}, :ImageRedirectOverlayCreative=>{:fields=>[{:name=>:asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageRedirectCreative"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalRedirectCreative=>{:fields=>[{:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_redirect_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LegacyDfpCreative=>{:fields=>[], :base=>"Creative"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LongCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticCreative=>{:fields=>[{:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RedirectAsset=>{:fields=>[{:name=>:redirect_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Asset"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioChildAssetProperty=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"RichMediaStudioChildAssetProperty.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :RichMediaStudioCreative=>{:fields=>[{:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRichMediaStudioCreative"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreative=>{:fields=>[{:name=>:external_asset_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:availability_region_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:license_window_start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:license_window_end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseVideoCreative"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SwiffyFallbackAsset=>{:fields=>[{:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:html5_features, :type=>"Html5Feature", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:localized_info_messages, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TemplateCreative=>{:fields=>[{:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_variable_values, :type=>"BaseCreativeTemplateVariableValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ThirdPartyCreative=>{:fields=>[{:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:expanded_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :TrackingUrls=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnsupportedCreative=>{:fields=>[{:name=>:unsupported_creative_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :UrlCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :Value=>{:fields=>[], :abstract=>true}, :VastRedirectCreative=>{:fields=>[{:name=>:vast_xml_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_redirect_type, :type=>"VastRedirectType", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :VideoCreative=>{:fields=>[], :base=>"BaseVideoCreative"}, :VideoMetadata=>{:fields=>[{:name=>:scalable_type, :type=>"ScalableType", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minimum_bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:maximum_bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:mime_type, :type=>"MimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_type, :type=>"VideoDeliveryType", :min_occurs=>0, :max_occurs=>1}, {:name=>:codecs, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoRedirectAsset=>{:fields=>[{:name=>:metadata, :type=>"VideoMetadata", :min_occurs=>0, :max_occurs=>1}], :base=>"RedirectAsset"}, :VideoRedirectCreative=>{:fields=>[{:name=>:video_assets, :type=>"VideoRedirectAsset", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"BaseVideoCreative"}, :VpaidLinearCreative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"HasDestinationUrlCreative"}, :VpaidLinearRedirectCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :base=>"HasDestinationUrlCreative"}, :ApiFramework=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ConversionEvent=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativePolicyViolation=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :DestinationUrlType=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :Html5Feature=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :ImageDensity=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LockedOrientation=>{:fields=>[]}, :MimeType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioChildAssetProperty.Type"=>{:fields=>[]}, :RichMediaStudioCreativeArtworkType=>{:fields=>[]}, :RichMediaStudioCreativeBillingAttribute=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :RichMediaStudioCreativeFormat=>{:fields=>[]}, :ScalableType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :SslManualOverride=>{:fields=>[]}, :SslScanResult=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}, :VastRedirectType=>{:fields=>[]}, :VideoDeliveryType=>{:fields=>[]}} - CREATIVESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CREATIVESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CREATIVESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CREATIVESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CreativeServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_set_service_registry.rb b/dfp_api/lib/dfp_api/v201702/creative_set_service_registry.rb deleted file mode 100755 index d7ea2e98b..000000000 --- a/dfp_api/lib/dfp_api/v201702/creative_set_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:02. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CreativeSetService - class CreativeSetServiceRegistry - CREATIVESETSERVICE_METHODS = {:create_creative_set=>{:input=>[{:name=>:creative_set, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"create_creative_set_response", :fields=>[{:name=>:rval, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}]}}, :get_creative_sets_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_sets_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeSetPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_creative_set=>{:input=>[{:name=>:creative_set, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"update_creative_set_response", :fields=>[{:name=>:rval, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}]}}} - CREATIVESETSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSet=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:master_creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSetPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}} - CREATIVESETSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CREATIVESETSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CREATIVESETSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CREATIVESETSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CreativeSetServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_template_service_registry.rb b/dfp_api/lib/dfp_api/v201702/creative_template_service_registry.rb deleted file mode 100755 index ef30feedd..000000000 --- a/dfp_api/lib/dfp_api/v201702/creative_template_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:03. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CreativeTemplateService - class CreativeTemplateServiceRegistry - CREATIVETEMPLATESERVICE_METHODS = {:get_creative_templates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}} - CREATIVETEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AssetCreativeTemplateVariable=>{:fields=>[{:name=>:mime_types, :type=>"AssetCreativeTemplateVariable.MimeType", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CreativeTemplateVariable"}, :CreativeTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:variables, :type=>"CreativeTemplateVariable", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CreativeTemplateStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"CreativeTemplateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ListStringCreativeTemplateVariable=>{:fields=>[{:name=>:choices, :type=>"ListStringCreativeTemplateVariable.VariableChoice", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_other_choice, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"StringCreativeTemplateVariable"}, :"ListStringCreativeTemplateVariable.VariableChoice"=>{:fields=>[{:name=>:label, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LongCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StringCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :UrlCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_tracking_url, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :CreativeTemplateVariable=>{:fields=>[{:name=>:label, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_required, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"AssetCreativeTemplateVariable.MimeType"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :CreativeTemplateStatus=>{:fields=>[]}, :CreativeTemplateType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CREATIVETEMPLATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CREATIVETEMPLATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CREATIVETEMPLATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CREATIVETEMPLATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CreativeTemplateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_wrapper_service_registry.rb b/dfp_api/lib/dfp_api/v201702/creative_wrapper_service_registry.rb deleted file mode 100755 index 5227b0f33..000000000 --- a/dfp_api/lib/dfp_api/v201702/creative_wrapper_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:04. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CreativeWrapperService - class CreativeWrapperServiceRegistry - CREATIVEWRAPPERSERVICE_METHODS = {:create_creative_wrappers=>{:input=>[{:name=>:creative_wrappers, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_creative_wrappers_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_creative_wrappers_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_wrappers_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapperPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_creative_wrapper_action=>{:input=>[{:name=>:creative_wrapper_action, :type=>"CreativeWrapperAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_creative_wrapper_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_creative_wrappers=>{:input=>[{:name=>:creative_wrappers, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_creative_wrappers_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CREATIVEWRAPPERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCreativeWrappers=>{:fields=>[], :base=>"CreativeWrapperAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperAction=>{:fields=>[], :abstract=>true}, :CreativeWrapper=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:header, :type=>"CreativeWrapperHtmlSnippet", :min_occurs=>0, :max_occurs=>1}, {:name=>:footer, :type=>"CreativeWrapperHtmlSnippet", :min_occurs=>0, :max_occurs=>1}, {:name=>:ordering, :type=>"CreativeWrapperOrdering", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CreativeWrapperStatus", :min_occurs=>0, :max_occurs=>1}]}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateCreativeWrappers=>{:fields=>[], :base=>"CreativeWrapperAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperHtmlSnippet=>{:fields=>[{:name=>:html_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelError=>{:fields=>[{:name=>:reason, :type=>"LabelError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :CreativeWrapperOrdering=>{:fields=>[]}, :CreativeWrapperStatus=>{:fields=>[]}, :"LabelError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CREATIVEWRAPPERSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CREATIVEWRAPPERSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CREATIVEWRAPPERSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CREATIVEWRAPPERSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CreativeWrapperServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/custom_field_service_registry.rb b/dfp_api/lib/dfp_api/v201702/custom_field_service_registry.rb deleted file mode 100755 index 05e84bc1f..000000000 --- a/dfp_api/lib/dfp_api/v201702/custom_field_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:06. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CustomFieldService - class CustomFieldServiceRegistry - CUSTOMFIELDSERVICE_METHODS = {:create_custom_field_options=>{:input=>[{:name=>:custom_field_options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_field_options_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :create_custom_fields=>{:input=>[{:name=>:custom_fields, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_fields_response", :fields=>[{:name=>:rval, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_custom_field_option=>{:input=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_field_option_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>1}]}}, :get_custom_fields_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_fields_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomFieldPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_field_action=>{:input=>[{:name=>:custom_field_action, :type=>"CustomFieldAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_field_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_custom_field_options=>{:input=>[{:name=>:custom_field_options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_field_options_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_custom_fields=>{:input=>[{:name=>:custom_fields, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_fields_response", :fields=>[{:name=>:rval, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CUSTOMFIELDSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCustomFields=>{:fields=>[], :base=>"CustomFieldAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldAction=>{:fields=>[]}, :CustomField=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_type, :type=>"CustomFieldEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:data_type, :type=>"CustomFieldDataType", :min_occurs=>0, :max_occurs=>1}, {:name=>:visibility, :type=>"CustomFieldVisibility", :min_occurs=>0, :max_occurs=>1}]}, :CustomFieldError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldOption=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomFieldPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateCustomFields=>{:fields=>[], :base=>"CustomFieldAction"}, :DropDownCustomField=>{:fields=>[{:name=>:options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomField"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CustomFieldDataType=>{:fields=>[]}, :CustomFieldEntityType=>{:fields=>[]}, :"CustomFieldError.Reason"=>{:fields=>[]}, :CustomFieldVisibility=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CUSTOMFIELDSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CUSTOMFIELDSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CUSTOMFIELDSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CUSTOMFIELDSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CustomFieldServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/custom_targeting_service_registry.rb b/dfp_api/lib/dfp_api/v201702/custom_targeting_service_registry.rb deleted file mode 100755 index 75f5bbb19..000000000 --- a/dfp_api/lib/dfp_api/v201702/custom_targeting_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:07. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module CustomTargetingService - class CustomTargetingServiceRegistry - CUSTOMTARGETINGSERVICE_METHODS = {:create_custom_targeting_keys=>{:input=>[{:name=>:keys, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_targeting_keys_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :create_custom_targeting_values=>{:input=>[{:name=>:values, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_targeting_values_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_custom_targeting_keys_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_targeting_keys_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKeyPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_custom_targeting_values_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_targeting_values_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValuePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_targeting_key_action=>{:input=>[{:name=>:custom_targeting_key_action, :type=>"CustomTargetingKeyAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_targeting_key_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_targeting_value_action=>{:input=>[{:name=>:custom_targeting_value_action, :type=>"CustomTargetingValueAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_targeting_value_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_custom_targeting_keys=>{:input=>[{:name=>:keys, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_targeting_keys_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_custom_targeting_values=>{:input=>[{:name=>:values, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_targeting_values_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - CUSTOMTARGETINGSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCustomTargetingKeys=>{:fields=>[], :base=>"CustomTargetingKeyAction"}, :ActivateCustomTargetingValues=>{:fields=>[], :base=>"CustomTargetingValueAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingKeyAction=>{:fields=>[], :abstract=>true}, :CustomTargetingKey=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"CustomTargetingKey.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CustomTargetingKey.Status", :min_occurs=>0, :max_occurs=>1}]}, :CustomTargetingKeyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomTargetingValueAction=>{:fields=>[], :abstract=>true}, :CustomTargetingValue=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"CustomTargetingValue.MatchType", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CustomTargetingValue.Status", :min_occurs=>0, :max_occurs=>1}]}, :CustomTargetingValuePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteCustomTargetingKeys=>{:fields=>[], :base=>"CustomTargetingKeyAction"}, :DeleteCustomTargetingValues=>{:fields=>[], :base=>"CustomTargetingValueAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"CustomTargetingKey.Status"=>{:fields=>[]}, :"CustomTargetingKey.Type"=>{:fields=>[]}, :"CustomTargetingValue.MatchType"=>{:fields=>[]}, :"CustomTargetingValue.Status"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - CUSTOMTARGETINGSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return CUSTOMTARGETINGSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return CUSTOMTARGETINGSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return CUSTOMTARGETINGSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, CustomTargetingServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/exchange_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201702/exchange_rate_service_registry.rb deleted file mode 100755 index a9f2540da..000000000 --- a/dfp_api/lib/dfp_api/v201702/exchange_rate_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:09. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ExchangeRateService - class ExchangeRateServiceRegistry - EXCHANGERATESERVICE_METHODS = {:create_exchange_rates=>{:input=>[{:name=>:exchange_rates, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_exchange_rates_response", :fields=>[{:name=>:rval, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_exchange_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_exchange_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"ExchangeRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_exchange_rate_action=>{:input=>[{:name=>:exchange_rate_action, :type=>"ExchangeRateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_exchange_rate_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_exchange_rates=>{:input=>[{:name=>:exchange_rates, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_exchange_rates_response", :fields=>[{:name=>:rval, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - EXCHANGERATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteExchangeRates=>{:fields=>[], :base=>"ExchangeRateAction"}, :ExchangeRateAction=>{:fields=>[], :abstract=>true}, :ExchangeRate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_rate, :type=>"ExchangeRateRefreshRate", :min_occurs=>0, :max_occurs=>1}, {:name=>:direction, :type=>"ExchangeRateDirection", :min_occurs=>0, :max_occurs=>1}, {:name=>:exchange_rate, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRatePage=>{:fields=>[{:name=>:results, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ExchangeRateDirection=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :ExchangeRateRefreshRate=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - EXCHANGERATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return EXCHANGERATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return EXCHANGERATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return EXCHANGERATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ExchangeRateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/forecast_service_registry.rb b/dfp_api/lib/dfp_api/v201702/forecast_service_registry.rb deleted file mode 100755 index 9c2b15218..000000000 --- a/dfp_api/lib/dfp_api/v201702/forecast_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:10. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ForecastService - class ForecastServiceRegistry - FORECASTSERVICE_METHODS = {:get_availability_forecast=>{:input=>[{:name=>:line_item, :type=>"ProspectiveLineItem", :min_occurs=>0, :max_occurs=>1}, {:name=>:forecast_options, :type=>"AvailabilityForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_availability_forecast_response", :fields=>[{:name=>:rval, :type=>"AvailabilityForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_availability_forecast_by_id=>{:input=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:forecast_options, :type=>"AvailabilityForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_availability_forecast_by_id_response", :fields=>[{:name=>:rval, :type=>"AvailabilityForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_delivery_forecast=>{:input=>[{:name=>:line_items, :type=>"ProspectiveLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forecast_options, :type=>"DeliveryForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_delivery_forecast_response", :fields=>[{:name=>:rval, :type=>"DeliveryForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_delivery_forecast_by_ids=>{:input=>[{:name=>:line_item_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forecast_options, :type=>"DeliveryForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_delivery_forecast_by_ids_response", :fields=>[{:name=>:rval, :type=>"DeliveryForecast", :min_occurs=>0, :max_occurs=>1}]}}} - FORECASTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AlternativeUnitTypeForecast=>{:fields=>[{:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:possible_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailabilityForecast=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivered_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:possible_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserved_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_breakdowns, :type=>"TargetingCriteriaBreakdown", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:contending_line_items, :type=>"ContendingLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:alternative_unit_type_forecasts, :type=>"AlternativeUnitTypeForecast", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:demographic_breakdowns, :type=>"GrpDemographicBreakdown", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AvailabilityForecastOptions=>{:fields=>[{:name=>:include_targeting_criteria_breakdown, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_contending_line_items, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContendingLineItem=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contending_impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTargeting=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryForecastOptions=>{:fields=>[{:name=>:ignored_line_item_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryForecast=>{:fields=>[{:name=>:line_item_delivery_forecasts, :type=>"LineItemDeliveryForecast", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpDemographicBreakdown=>{:fields=>[{:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"GrpUnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:gender, :type=>"GrpGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:age, :type=>"GrpAge", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettings=>{:fields=>[{:name=>:min_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_gender, :type=>"GrpTargetGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider, :type=>"GrpProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_impression_goal, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociation=>{:fields=>[{:name=>:activity_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:view_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemDeliveryForecast=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:predicted_delivery_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivered_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :LineItem=>{:fields=>[{:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_targetings, :type=>"CreativeTargeting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"LineItemSummary"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemSummary=>{:fields=>[{:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:auto_extension_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_type, :type=>"CostType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount_type, :type=>"LineItemDiscountType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:activity_associations, :type=>"LineItemActivityAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_persistence_type, :type=>"CreativePersistenceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_cross_selling_rule_warning_checks, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserve_at_creation, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"LineItemSummary.ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:web_property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_prioritized_preferred_deals_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_exchange_auction_opening_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_missing_creatives, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:set_top_box_display_info, :type=>"SetTopBoxInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_goals, :type=>"Goal", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:grp_settings, :type=>"GrpSettings", :min_occurs=>0, :max_occurs=>1}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProspectiveLineItem=>{:fields=>[{:name=>:line_item, :type=>"LineItem", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxInfo=>{:fields=>[{:name=>:sync_status, :type=>"SetTopBoxSyncStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_result, :type=>"CanoeSyncResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_canoe_response_message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:nielsen_product_category_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TargetingCriteriaBreakdown=>{:fields=>[{:name=>:targeting_dimension, :type=>"TargetingDimension", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:excluded, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :CanoeSyncResult=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostType=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :GrpAge=>{:fields=>[]}, :GrpGender=>{:fields=>[]}, :GrpProvider=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :GrpTargetGender=>{:fields=>[]}, :GrpUnitType=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LineItemDiscountType=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"LineItemSummary.ReservationStatus"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :CreativePersistenceType=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :SetTopBoxSyncStatus=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TargetingDimension=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - FORECASTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return FORECASTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return FORECASTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return FORECASTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ForecastServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/inventory_service_registry.rb b/dfp_api/lib/dfp_api/v201702/inventory_service_registry.rb deleted file mode 100755 index 2f28e412f..000000000 --- a/dfp_api/lib/dfp_api/v201702/inventory_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:13. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module InventoryService - class InventoryServiceRegistry - INVENTORYSERVICE_METHODS = {:create_ad_units=>{:input=>[{:name=>:ad_units, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_units_response", :fields=>[{:name=>:rval, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_unit_sizes_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_unit_sizes_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_units_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_units_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdUnitPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_unit_action=>{:input=>[{:name=>:ad_unit_action, :type=>"AdUnitAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_unit_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_units=>{:input=>[{:name=>:ad_units, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_units_response", :fields=>[{:name=>:rval, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - INVENTORYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :AdSenseAccountError=>{:fields=>[{:name=>:reason, :type=>"AdSenseAccountError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdSenseSettings=>{:fields=>[{:name=>:ad_sense_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:border_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:title_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:background_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:text_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_type, :type=>"AdSenseSettings.AdType", :min_occurs=>0, :max_occurs=>1}, {:name=>:border_style, :type=>"AdSenseSettings.BorderStyle", :min_occurs=>0, :max_occurs=>1}, {:name=>:font_family, :type=>"AdSenseSettings.FontFamily", :min_occurs=>0, :max_occurs=>1}, {:name=>:font_size, :type=>"AdSenseSettings.FontSize", :min_occurs=>0, :max_occurs=>1}]}, :AdSenseSettingsInheritedProperty=>{:fields=>[{:name=>:value, :type=>"AdSenseSettings", :min_occurs=>0, :max_occurs=>1}]}, :AdUnitAction=>{:fields=>[], :abstract=>true}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnit=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_children, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_path, :type=>"AdUnitParent", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_window, :type=>"AdUnit.TargetWindow", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"InventoryStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_sizes, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_platform, :type=>"MobilePlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:explicitly_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:inherited_ad_sense_settings, :type=>"AdSenseSettingsInheritedProperty", :min_occurs=>0, :max_occurs=>1}, {:name=>:partner_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_label_frequency_caps, :type=>"LabelFrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_label_frequency_caps, :type=>"LabelFrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:smart_size_mode, :type=>"SmartSizeMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_shared_by_distributor, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:cross_selling_distributor, :type=>"CrossSellingDistributor", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_set_top_box_channel_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AdUnitHierarchyError=>{:fields=>[{:name=>:reason, :type=>"AdUnitHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdUnitParent=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :AssignAdUnitsToPlacement=>{:fields=>[{:name=>:placement_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"AdUnitAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyError=>{:fields=>[{:name=>:reason, :type=>"CompanyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellingDistributor=>{:fields=>[{:name=>:network_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidColorError=>{:fields=>[{:name=>:reason, :type=>"InvalidColorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitPartnerAssociationError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitPartnerAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitRefreshRateError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitRefreshRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitSize=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:full_display_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :InventoryUnitSizesError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitSizesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTypeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitTypeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelFrequencyCap=>{:fields=>[{:name=>:frequency_cap, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RemoveAdUnitsFromPlacement=>{:fields=>[{:name=>:placement_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"AdUnitAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdSenseAccountError.Reason"=>{:fields=>[]}, :"AdSenseSettings.AdType"=>{:fields=>[]}, :"AdSenseSettings.BorderStyle"=>{:fields=>[]}, :"AdSenseSettings.FontFamily"=>{:fields=>[]}, :"AdSenseSettings.FontSize"=>{:fields=>[]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"AdUnit.TargetWindow"=>{:fields=>[]}, :"AdUnitHierarchyError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidColorError.Reason"=>{:fields=>[]}, :InventoryStatus=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"InventoryUnitPartnerAssociationError.Reason"=>{:fields=>[]}, :"InventoryUnitRefreshRateError.Reason"=>{:fields=>[]}, :"InventoryUnitSizesError.Reason"=>{:fields=>[]}, :"AdUnitTypeError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :MobilePlatform=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :SmartSizeMode=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}} - INVENTORYSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return INVENTORYSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return INVENTORYSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return INVENTORYSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, InventoryServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/label_service_registry.rb b/dfp_api/lib/dfp_api/v201702/label_service_registry.rb deleted file mode 100755 index e539edeeb..000000000 --- a/dfp_api/lib/dfp_api/v201702/label_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:15. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module LabelService - class LabelServiceRegistry - LABELSERVICE_METHODS = {:create_labels=>{:input=>[{:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_labels_response", :fields=>[{:name=>:rval, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_labels_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_labels_by_statement_response", :fields=>[{:name=>:rval, :type=>"LabelPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_label_action=>{:input=>[{:name=>:label_action, :type=>"LabelAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_label_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_labels=>{:input=>[{:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_labels_response", :fields=>[{:name=>:rval, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - LABELSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLabels=>{:fields=>[], :base=>"LabelAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateLabels=>{:fields=>[], :base=>"LabelAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelAction=>{:fields=>[], :abstract=>true}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:types, :type=>"LabelType", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LabelError=>{:fields=>[{:name=>:reason, :type=>"LabelError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"LabelError.Reason"=>{:fields=>[]}, :LabelType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - LABELSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return LABELSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return LABELSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return LABELSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, LabelServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201702/line_item_service_registry.rb deleted file mode 100755 index 292bcdc9d..000000000 --- a/dfp_api/lib/dfp_api/v201702/line_item_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:19. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module LineItemService - class LineItemServiceRegistry - LINEITEMSERVICE_METHODS = {:create_line_items=>{:input=>[{:name=>:line_items, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_line_items_response", :fields=>[{:name=>:rval, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_line_items_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_line_item_action=>{:input=>[{:name=>:line_item_action, :type=>"LineItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_line_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_line_items=>{:input=>[{:name=>:line_items, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_line_items_response", :fields=>[{:name=>:rval, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - LINEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLineItems=>{:fields=>[], :base=>"LineItemAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveLineItems=>{:fields=>[], :base=>"LineItemAction"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTargeting=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeleteLineItems=>{:fields=>[], :base=>"LineItemAction"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettings=>{:fields=>[{:name=>:min_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_gender, :type=>"GrpTargetGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider, :type=>"GrpProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_impression_goal, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemAction=>{:fields=>[], :abstract=>true}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociation=>{:fields=>[{:name=>:activity_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:view_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItem=>{:fields=>[{:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_targetings, :type=>"CreativeTargeting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"LineItemSummary"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LineItemSummary=>{:fields=>[{:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:auto_extension_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_type, :type=>"CostType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount_type, :type=>"LineItemDiscountType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:activity_associations, :type=>"LineItemActivityAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_persistence_type, :type=>"CreativePersistenceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_cross_selling_rule_warning_checks, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserve_at_creation, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"LineItemSummary.ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:web_property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_prioritized_preferred_deals_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_exchange_auction_opening_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_missing_creatives, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:set_top_box_display_info, :type=>"SetTopBoxInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_goals, :type=>"Goal", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:grp_settings, :type=>"GrpSettings", :min_occurs=>0, :max_occurs=>1}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseLineItems=>{:fields=>[], :base=>"LineItemAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReleaseLineItems=>{:fields=>[], :base=>"LineItemAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveAndOverbookLineItems=>{:fields=>[], :base=>"ReserveLineItems"}, :ReserveLineItems=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"LineItemAction"}, :ResumeAndOverbookLineItems=>{:fields=>[], :base=>"ResumeLineItems"}, :ResumeLineItems=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"LineItemAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxInfo=>{:fields=>[{:name=>:sync_status, :type=>"SetTopBoxSyncStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_result, :type=>"CanoeSyncResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_canoe_response_message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:nielsen_product_category_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveLineItems=>{:fields=>[], :base=>"LineItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :CanoeSyncResult=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostType=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :GrpProvider=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :GrpTargetGender=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LineItemDiscountType=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"LineItemSummary.ReservationStatus"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :CreativePersistenceType=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :SetTopBoxSyncStatus=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - LINEITEMSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return LINEITEMSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return LINEITEMSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return LINEITEMSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, LineItemServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/line_item_template_service_registry.rb b/dfp_api/lib/dfp_api/v201702/line_item_template_service_registry.rb deleted file mode 100755 index c566ebd60..000000000 --- a/dfp_api/lib/dfp_api/v201702/line_item_template_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:22. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module LineItemTemplateService - class LineItemTemplateServiceRegistry - LINEITEMTEMPLATESERVICE_METHODS = {:get_line_item_templates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_item_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}} - LINEITEMTEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_default, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:enabled_for_same_advertiser_exception, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}]}, :LineItemTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItemTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - LINEITEMTEMPLATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return LINEITEMTEMPLATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return LINEITEMTEMPLATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return LINEITEMTEMPLATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, LineItemTemplateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/live_stream_event_service_registry.rb b/dfp_api/lib/dfp_api/v201702/live_stream_event_service_registry.rb deleted file mode 100755 index d01032853..000000000 --- a/dfp_api/lib/dfp_api/v201702/live_stream_event_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:23. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module LiveStreamEventService - class LiveStreamEventServiceRegistry - LIVESTREAMEVENTSERVICE_METHODS = {:create_live_stream_events=>{:input=>[{:name=>:live_stream_events, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_live_stream_events_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_live_stream_events_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_live_stream_events_by_statement_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEventPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_live_stream_event_action=>{:input=>[{:name=>:live_stream_event_action, :type=>"LiveStreamEventAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_live_stream_event_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :register_sessions_for_monitoring=>{:input=>[{:name=>:session_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"register_sessions_for_monitoring_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_live_stream_events=>{:input=>[{:name=>:live_stream_events, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_live_stream_events_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - LIVESTREAMEVENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEventAction=>{:fields=>[], :abstract=>true}, :LiveStreamEventActionError=>{:fields=>[{:name=>:reason, :type=>"LiveStreamEventActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEventDateTimeError=>{:fields=>[{:name=>:reason, :type=>"LiveStreamEventDateTimeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEvent=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"LiveStreamEventStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_estimated_concurrent_users, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_tags, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:live_stream_event_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:authentication_service, :type=>"AuthenticationService", :min_occurs=>0, :max_occurs=>1}, {:name=>:authentication_key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:token_authentication_unsigned, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:dvr_window_seconds, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_break_fill_type, :type=>"AdBreakFillType", :min_occurs=>0, :max_occurs=>1}]}, :LiveStreamEventPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseLiveStreamEventAds=>{:fields=>[], :base=>"LiveStreamEventAction"}, :PauseLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SamSessionError=>{:fields=>[{:name=>:reason, :type=>"SamSessionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :AdBreakFillType=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :AuthenticationService=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LiveStreamEventActionError.Reason"=>{:fields=>[]}, :"LiveStreamEventDateTimeError.Reason"=>{:fields=>[]}, :LiveStreamEventStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SamSessionError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - LIVESTREAMEVENTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return LIVESTREAMEVENTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return LIVESTREAMEVENTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return LIVESTREAMEVENTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, LiveStreamEventServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/mobile_application_service_registry.rb b/dfp_api/lib/dfp_api/v201702/mobile_application_service_registry.rb deleted file mode 100755 index 2ab3c0156..000000000 --- a/dfp_api/lib/dfp_api/v201702/mobile_application_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:24. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module MobileApplicationService - class MobileApplicationServiceRegistry - MOBILEAPPLICATIONSERVICE_METHODS = {:create_mobile_applications=>{:input=>[{:name=>:mobile_applications, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_mobile_applications_response", :fields=>[{:name=>:rval, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_mobile_applications_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_mobile_applications_by_statement_response", :fields=>[{:name=>:rval, :type=>"MobileApplicationPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_mobile_application_action=>{:input=>[{:name=>:mobile_application_action, :type=>"MobileApplicationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_mobile_application_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_mobile_applications=>{:input=>[{:name=>:mobile_applications, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_mobile_applications_response", :fields=>[{:name=>:rval, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - MOBILEAPPLICATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :UnarchiveMobileApplications=>{:fields=>[], :base=>"MobileApplicationAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ArchiveMobileApplications=>{:fields=>[], :base=>"MobileApplicationAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplicationAction=>{:fields=>[], :abstract=>true}, :MobileApplicationActionError=>{:fields=>[{:name=>:reason, :type=>"MobileApplicationActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplication=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store, :type=>"MobileApplicationStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:developer_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:platform, :type=>"MobileApplicationPlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_free, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:download_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationError=>{:fields=>[{:name=>:reason, :type=>"MobileApplicationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplicationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"MobileApplicationActionError.Reason"=>{:fields=>[]}, :"MobileApplicationError.Reason"=>{:fields=>[]}, :MobileApplicationPlatform=>{:fields=>[]}, :MobileApplicationStore=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - MOBILEAPPLICATIONSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return MOBILEAPPLICATIONSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return MOBILEAPPLICATIONSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return MOBILEAPPLICATIONSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, MobileApplicationServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/native_style_service_registry.rb b/dfp_api/lib/dfp_api/v201702/native_style_service_registry.rb deleted file mode 100755 index 7f53d20c0..000000000 --- a/dfp_api/lib/dfp_api/v201702/native_style_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:25. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module NativeStyleService - class NativeStyleServiceRegistry - NATIVESTYLESERVICE_METHODS = {:create_native_styles=>{:input=>[{:name=>:native_styles, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_native_styles_response", :fields=>[{:name=>:rval, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_native_styles_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_native_styles_by_statement_response", :fields=>[{:name=>:rval, :type=>"NativeStylePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_native_style_action=>{:input=>[{:name=>:native_style_action, :type=>"NativeStyleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_native_style_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_native_styles=>{:input=>[{:name=>:native_styles, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_native_styles_response", :fields=>[{:name=>:rval, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - NATIVESTYLESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveNativeStyles=>{:fields=>[], :base=>"NativeStyleAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NativeStyleAction=>{:fields=>[], :abstract=>true}, :NativeStyle=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:html_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:css_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_fluid, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}]}, :NativeStyleError=>{:fields=>[{:name=>:reason, :type=>"NativeStyleError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NativeStylePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NativeStyleError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} - NATIVESTYLESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return NATIVESTYLESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return NATIVESTYLESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return NATIVESTYLESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, NativeStyleServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/network_service_registry.rb b/dfp_api/lib/dfp_api/v201702/network_service_registry.rb deleted file mode 100755 index a4de72003..000000000 --- a/dfp_api/lib/dfp_api/v201702/network_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:27. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module NetworkService - class NetworkServiceRegistry - NETWORKSERVICE_METHODS = {:get_all_networks=>{:input=>[], :output=>{:name=>"get_all_networks_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_current_network=>{:input=>[], :output=>{:name=>"get_current_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}, :make_test_network=>{:input=>[], :output=>{:name=>"make_test_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}, :update_network=>{:input=>[{:name=>:network, :type=>"Network", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"update_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}} - NETWORKSERVICE_TYPES = {:ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Network=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_currency_codes, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_root_ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_test, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :NetworkError=>{:fields=>[{:name=>:reason, :type=>"NetworkError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NetworkError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - NETWORKSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return NETWORKSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return NETWORKSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return NETWORKSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, NetworkServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/order_service_registry.rb b/dfp_api/lib/dfp_api/v201702/order_service_registry.rb deleted file mode 100755 index dff24ac7e..000000000 --- a/dfp_api/lib/dfp_api/v201702/order_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:28. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module OrderService - class OrderServiceRegistry - ORDERSERVICE_METHODS = {:create_orders=>{:input=>[{:name=>:orders, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_orders_response", :fields=>[{:name=>:rval, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_orders_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_orders_by_statement_response", :fields=>[{:name=>:rval, :type=>"OrderPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_order_action=>{:input=>[{:name=>:order_action, :type=>"OrderAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_order_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_orders=>{:input=>[{:name=>:orders, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_orders_response", :fields=>[{:name=>:rval, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - ORDERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApproveAndOverbookOrders=>{:fields=>[], :base=>"ApproveOrders"}, :ApproveOrders=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :ApproveOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :ArchiveOrders=>{:fields=>[], :base=>"OrderAction"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeleteOrders=>{:fields=>[], :base=>"OrderAction"}, :DisapproveOrders=>{:fields=>[], :base=>"OrderAction"}, :DisapproveOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderAction=>{:fields=>[], :abstract=>true}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Order=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"OrderStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_order_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:agency_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:trafficker_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_trafficker_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:salesperson_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_salesperson_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:total_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseOrders=>{:fields=>[], :base=>"OrderAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ResumeAndOverbookOrders=>{:fields=>[], :base=>"ResumeOrders"}, :ResumeOrders=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :RetractOrders=>{:fields=>[], :base=>"OrderAction"}, :RetractOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SubmitOrdersForApproval=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :SubmitOrdersForApprovalAndOverbook=>{:fields=>[], :base=>"SubmitOrdersForApproval"}, :SubmitOrdersForApprovalWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveOrders=>{:fields=>[], :base=>"OrderAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :OrderStatus=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - ORDERSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return ORDERSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return ORDERSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return ORDERSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, OrderServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/package_service_registry.rb b/dfp_api/lib/dfp_api/v201702/package_service_registry.rb deleted file mode 100755 index f91939152..000000000 --- a/dfp_api/lib/dfp_api/v201702/package_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:31. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module PackageService - class PackageServiceRegistry - PACKAGESERVICE_METHODS = {:create_packages=>{:input=>[{:name=>:packages, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_packages_response", :fields=>[{:name=>:rval, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_packages_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_packages_by_statement_response", :fields=>[{:name=>:rval, :type=>"PackagePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_package_action=>{:input=>[{:name=>:package_action, :type=>"PackageAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_package_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_packages=>{:input=>[{:name=>:packages, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_packages_response", :fields=>[{:name=>:rval, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PACKAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreateProposalLineItemsFromPackages=>{:fields=>[], :base=>"PackageAction"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :PackageAction=>{:fields=>[], :abstract=>true}, :PackageActionError=>{:fields=>[{:name=>:reason, :type=>"PackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Package=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"PackageStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :PackageError=>{:fields=>[{:name=>:reason, :type=>"PackageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PackagePage=>{:fields=>[{:name=>:results, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"PackageActionError.Reason"=>{:fields=>[]}, :"PackageError.Reason"=>{:fields=>[]}, :PackageStatus=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}} - PACKAGESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PACKAGESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PACKAGESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PACKAGESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, PackageServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/placement_service_registry.rb b/dfp_api/lib/dfp_api/v201702/placement_service_registry.rb deleted file mode 100755 index bb2497dab..000000000 --- a/dfp_api/lib/dfp_api/v201702/placement_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:36. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module PlacementService - class PlacementServiceRegistry - PLACEMENTSERVICE_METHODS = {:create_placements=>{:input=>[{:name=>:placements, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_placements_response", :fields=>[{:name=>:rval, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_placements_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_placements_by_statement_response", :fields=>[{:name=>:rval, :type=>"PlacementPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_placement_action=>{:input=>[{:name=>:placement_action, :type=>"PlacementAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_placement_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_placements=>{:input=>[{:name=>:placements, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_placements_response", :fields=>[{:name=>:rval, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PLACEMENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivatePlacements=>{:fields=>[], :base=>"PlacementAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchivePlacements=>{:fields=>[], :base=>"PlacementAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivatePlacements=>{:fields=>[], :base=>"PlacementAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementAction=>{:fields=>[], :abstract=>true}, :Placement=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:placement_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"InventoryStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_ad_sense_targeting_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_sense_targeting_locale, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeted_ad_unit_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"SiteTargetingInfo"}, :PlacementError=>{:fields=>[{:name=>:reason, :type=>"PlacementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SiteTargetingInfo=>{:fields=>[{:name=>:targeting_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_site_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_ad_location, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :InventoryStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PlacementError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - PLACEMENTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PLACEMENTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PLACEMENTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PLACEMENTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, PlacementServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/premium_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201702/premium_rate_service_registry.rb deleted file mode 100755 index e69f8f09e..000000000 --- a/dfp_api/lib/dfp_api/v201702/premium_rate_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:38. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module PremiumRateService - class PremiumRateServiceRegistry - PREMIUMRATESERVICE_METHODS = {:create_premium_rates=>{:input=>[{:name=>:premium_rates, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_premium_rates_response", :fields=>[{:name=>:rval, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_premium_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_premium_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"PremiumRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :update_premium_rates=>{:input=>[{:name=>:premium_rates, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_premium_rates_response", :fields=>[{:name=>:rval, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PREMIUMRATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentPremiumFeature=>{:fields=>[{:name=>:audience_segment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :BrowserPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguagePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundlePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :CustomTargetingPremiumFeature=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DaypartPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCapabilityPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCategoryPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceManufacturerPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :GeographyPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileCarrierPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystemPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :PremiumFeature=>{:fields=>[], :abstract=>true}, :PremiumRate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_method, :type=>"PricingMethod", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_rate_values, :type=>"PremiumRateValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PremiumRateError=>{:fields=>[{:name=>:reason, :type=>"PremiumRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PremiumRatePage=>{:fields=>[{:name=>:results, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PremiumRateValue=>{:fields=>[{:name=>:premium_rate_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_type, :type=>"PremiumAdjustmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnknownPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UserDomainPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PremiumAdjustmentType=>{:fields=>[]}, :"PremiumRateError.Reason"=>{:fields=>[]}, :PricingMethod=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - PREMIUMRATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PREMIUMRATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PREMIUMRATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PREMIUMRATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, PremiumRateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_package_item_service_registry.rb b/dfp_api/lib/dfp_api/v201702/product_package_item_service_registry.rb deleted file mode 100755 index 5b981b470..000000000 --- a/dfp_api/lib/dfp_api/v201702/product_package_item_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:35. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProductPackageItemService - class ProductPackageItemServiceRegistry - PRODUCTPACKAGEITEMSERVICE_METHODS = {:create_product_package_items=>{:input=>[{:name=>:product_package_items, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_package_items_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_package_items_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_package_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_package_item_action=>{:input=>[{:name=>:product_package_item_action, :type=>"ProductPackageItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_package_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_package_items=>{:input=>[{:name=>:product_package_items, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_package_items_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PRODUCTPACKAGEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductPackageItems=>{:fields=>[], :base=>"ProductPackageItemAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItemAction=>{:fields=>[], :abstract=>true}, :ProductPackageItemActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItem=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_mandatory, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:archive_status, :type=>"ArchiveStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProductPackageItemError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItemPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductPackageRateCardAssociationError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageRateCardAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnArchiveProductPackageItems=>{:fields=>[], :base=>"ProductPackageItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :ArchiveStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProductPackageActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemError.Reason"=>{:fields=>[]}, :"ProductPackageRateCardAssociationError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - PRODUCTPACKAGEITEMSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PRODUCTPACKAGEITEMSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PRODUCTPACKAGEITEMSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PRODUCTPACKAGEITEMSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProductPackageItemServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_package_service_registry.rb b/dfp_api/lib/dfp_api/v201702/product_package_service_registry.rb deleted file mode 100755 index 39e50ab69..000000000 --- a/dfp_api/lib/dfp_api/v201702/product_package_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:34. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProductPackageService - class ProductPackageServiceRegistry - PRODUCTPACKAGESERVICE_METHODS = {:create_product_packages=>{:input=>[{:name=>:product_packages, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_packages_response", :fields=>[{:name=>:rval, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_packages_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_packages_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPackagePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_package_action=>{:input=>[{:name=>:action, :type=>"ProductPackageAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_package_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_packages=>{:input=>[{:name=>:product_packages, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_packages_response", :fields=>[{:name=>:rval, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PRODUCTPACKAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageAction=>{:fields=>[], :abstract=>true}, :ProductPackageActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackage=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductPackageStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :ProductPackageItemError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackagePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductPackageRateCardAssociationError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageRateCardAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardError=>{:fields=>[{:name=>:reason, :type=>"RateCardError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnarchiveProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductPackageActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemError.Reason"=>{:fields=>[]}, :"ProductPackageRateCardAssociationError.Reason"=>{:fields=>[]}, :ProductPackageStatus=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateCardError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - PRODUCTPACKAGESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PRODUCTPACKAGESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PRODUCTPACKAGESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PRODUCTPACKAGESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProductPackageServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_service_registry.rb b/dfp_api/lib/dfp_api/v201702/product_service_registry.rb deleted file mode 100755 index b3af1d273..000000000 --- a/dfp_api/lib/dfp_api/v201702/product_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:39. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProductService - class ProductServiceRegistry - PRODUCTSERVICE_METHODS = {:create_products=>{:input=>[{:name=>:products, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_products_response", :fields=>[{:name=>:rval, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_products_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_products_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_action=>{:input=>[{:name=>:product_action, :type=>"ProductAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_products=>{:input=>[{:name=>:products, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_products_response", :fields=>[{:name=>:rval, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PRODUCTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProducts=>{:fields=>[], :base=>"ProductAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeactivateProducts=>{:fields=>[], :base=>"ProductAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NonProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"NonProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductAction=>{:fields=>[], :abstract=>true}, :ProductActionError=>{:fields=>[{:name=>:reason, :type=>"ProductActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Product=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name_source, :type=>"ValueSourceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_type, :type=>"ProductType", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_marketplace_info, :type=>"ProductMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms_source, :type=>"ValueSourceType", :min_occurs=>0, :max_occurs=>1}]}, :ProductPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProgrammaticEntitiesError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticEntitiesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublishProducts=>{:fields=>[], :base=>"ProductAction"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :WithdrawProducts=>{:fields=>[], :base=>"ProductAction"}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NonProgrammaticProductError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductActionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :ProductStatus=>{:fields=>[]}, :ProductType=>{:fields=>[]}, :"ProgrammaticEntitiesError.Reason"=>{:fields=>[]}, :"ProgrammaticProductError.Reason"=>{:fields=>[]}, :ValueSourceType=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - PRODUCTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PRODUCTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PRODUCTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PRODUCTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProductServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_template_service_registry.rb b/dfp_api/lib/dfp_api/v201702/product_template_service_registry.rb deleted file mode 100755 index 19ead250b..000000000 --- a/dfp_api/lib/dfp_api/v201702/product_template_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:41. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProductTemplateService - class ProductTemplateServiceRegistry - PRODUCTTEMPLATESERVICE_METHODS = {:create_product_templates=>{:input=>[{:name=>:product_templates, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_templates_response", :fields=>[{:name=>:rval, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_templates_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_template_action=>{:input=>[{:name=>:action, :type=>"ProductTemplateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_template_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_templates=>{:input=>[{:name=>:product_templates, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_templates_response", :fields=>[{:name=>:rval, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PRODUCTTEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeactivateProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementTargeting=>{:fields=>[{:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductTemplateAction=>{:fields=>[], :abstract=>true}, :ProductTemplateActionError=>{:fields=>[{:name=>:reason, :type=>"ProductTemplateActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name_macro, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductTemplateStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_type, :type=>"ProductType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:product_segmentation, :type=>"ProductSegmentation", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_marketplace_info, :type=>"ProductTemplateMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}]}, :ProductTemplateError=>{:fields=>[{:name=>:reason, :type=>"ProductTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductTemplateMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ProductTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductSegmentation=>{:fields=>[{:name=>:geo_segment, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_segments, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:placement_segment, :type=>"PlacementTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_segment, :type=>"CustomCriteria", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:user_domain_segment, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_segment, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_segment, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_segment, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_segment, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_segment, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_segment, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_segment, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_segment, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_segment, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_segment, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_segment, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ProgrammaticEntitiesError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticEntitiesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductTemplateActionError.Reason"=>{:fields=>[]}, :"ProductTemplateError.Reason"=>{:fields=>[]}, :ProductTemplateStatus=>{:fields=>[]}, :ProductType=>{:fields=>[]}, :"ProgrammaticEntitiesError.Reason"=>{:fields=>[]}, :"ProgrammaticProductError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - PRODUCTTEMPLATESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PRODUCTTEMPLATESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PRODUCTTEMPLATESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PRODUCTTEMPLATESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProductTemplateServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/proposal_line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201702/proposal_line_item_service_registry.rb deleted file mode 100755 index 69136d6df..000000000 --- a/dfp_api/lib/dfp_api/v201702/proposal_line_item_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:43. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProposalLineItemService - class ProposalLineItemServiceRegistry - PROPOSALLINEITEMSERVICE_METHODS = {:create_proposal_line_items=>{:input=>[{:name=>:proposal_line_items, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_proposal_line_items_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_proposal_line_items_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_proposal_line_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_proposal_line_item_action=>{:input=>[{:name=>:proposal_line_item_action, :type=>"ProposalLineItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_proposal_line_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_proposal_line_items=>{:input=>[{:name=>:proposal_line_items, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_proposal_line_items_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PROPOSALLINEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActualizeProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AdUnitPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AudienceSegmentPremiumFeature=>{:fields=>[{:name=>:audience_segment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguagePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundlePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingPremiumFeature=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DaypartPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DealError=>{:fields=>[{:name=>:reason, :type=>"DealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeographyPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PremiumFeature=>{:fields=>[], :abstract=>true}, :PremiumRateValue=>{:fields=>[{:name=>:premium_rate_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_type, :type=>"PremiumAdjustmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemAction=>{:fields=>[], :abstract=>true}, :ProposalLineItemActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemConstraints=>{:fields=>[{:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:built_in_roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:product_built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItem=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_adjustment, :type=>"CostAdjustment", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_quantity_buffer, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduled_quantity, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:dfp_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_constraints, :type=>"ProposalLineItemConstraints", :min_occurs=>0, :max_occurs=>1}, {:name=>:premiums, :type=>"ProposalLineItemPremium", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_sold, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:base_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:computed_status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_base, :type=>"BillingBase", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_reservation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:use_third_party_ad_server_from_proposal, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_ad_server_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_third_party_ad_server_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:link_status, :type=>"LinkStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_info, :type=>"ProposalLineItemMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemPage=>{:fields=>[{:name=>:results, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemPremium=>{:fields=>[{:name=>:premium_rate_value, :type=>"PremiumRateValue", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProposalLineItemPremiumStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReleaseProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveProposalLineItems=>{:fields=>[{:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalLineItemAction"}, :ResumeProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnknownPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UnlinkProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingBase=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostAdjustment=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"DealError.Reason"=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :LinkStatus=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :PremiumAdjustmentType=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemActionError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :ProposalLineItemPremiumStatus=>{:fields=>[]}, :"ProposalLineItemProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :ReservationStatus=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} - PROPOSALLINEITEMSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PROPOSALLINEITEMSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PROPOSALLINEITEMSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PROPOSALLINEITEMSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProposalLineItemServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/proposal_service_registry.rb b/dfp_api/lib/dfp_api/v201702/proposal_service_registry.rb deleted file mode 100755 index 91914a418..000000000 --- a/dfp_api/lib/dfp_api/v201702/proposal_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:46. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ProposalService - class ProposalServiceRegistry - PROPOSALSERVICE_METHODS = {:create_proposals=>{:input=>[{:name=>:proposals, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_proposals_response", :fields=>[{:name=>:rval, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_marketplace_comments_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_marketplace_comments_by_statement_response", :fields=>[{:name=>:rval, :type=>"MarketplaceCommentPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_proposals_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_proposals_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProposalPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_proposal_action=>{:input=>[{:name=>:proposal_action, :type=>"ProposalAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_proposal_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_proposals=>{:input=>[{:name=>:proposals, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_proposals_response", :fields=>[{:name=>:rval, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - PROPOSALSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProposals=>{:fields=>[], :base=>"ProposalAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :BypassProposalWorkflowRules=>{:fields=>[], :base=>"ProposalAction"}, :CancelRetractionForProposals=>{:fields=>[], :base=>"ProposalAction"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DealError=>{:fields=>[{:name=>:reason, :type=>"DealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DiscardLocalVersionEdits=>{:fields=>[], :base=>"ProposalAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EditProposalsForNegotiation=>{:fields=>[], :base=>"ProposalAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MarketplaceComment=>{:fields=>[{:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:created_by_seller, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MarketplaceCommentPage=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"MarketplaceComment", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProposalMarketplaceInfo=>{:fields=>[{:name=>:has_local_version_edits, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:negotiation_status, :type=>"NegotiationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_new_version_from_buyer, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:buyer_account_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OfflineError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:reason, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :PackageActionError=>{:fields=>[{:name=>:reason, :type=>"PackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PackageError=>{:fields=>[{:name=>:reason, :type=>"PackageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalAction=>{:fields=>[], :abstract=>true}, :ProposalActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLink=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :ProposalCompanyAssociation=>{:fields=>[{:name=>:company_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"ProposalCompanyAssociationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Proposal=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProposalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser, :type=>"ProposalCompanyAssociation", :min_occurs=>0, :max_occurs=>1}, {:name=>:agencies, :type=>"ProposalCompanyAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:probability_of_close, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_base, :type=>"BillingBase", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_salesperson, :type=>"SalespersonSplit", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_salespeople, :type=>"SalespersonSplit", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:sales_planner_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:primary_trafficker_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_trafficker_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:seller_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:advertiser_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:exchange_rate, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_exchange_rate, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_commission, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_added_tax, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_sold, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"ProposalApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:workflow_progress, :type=>"WorkflowProgress", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:resources, :type=>"ProposalLink", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:actual_expiry_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:expected_expiry_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_ad_server_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_third_party_ad_server_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:terms_and_conditions, :type=>"ProposalTermsAndConditions", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_retraction_details, :type=>"RetractionDetails", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_info, :type=>"ProposalMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:offline_errors, :type=>"OfflineError", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:has_offline_errors, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProposalTermsAndConditions=>{:fields=>[{:name=>:terms_and_conditions_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:content, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestApprovalProgressAction=>{:fields=>[{:name=>:approver_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:eligible_approver_user_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:eligible_approver_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"WorkflowApprovalRequestStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"ProgressAction"}, :RequestBuyerAcceptance=>{:fields=>[], :base=>"ProposalAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveInventoryProgressAction=>{:fields=>[], :base=>"ProgressAction"}, :ReserveProposals=>{:fields=>[{:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalAction"}, :RetractProposals=>{:fields=>[{:name=>:retraction_details, :type=>"RetractionDetails", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalAction"}, :RetractionDetails=>{:fields=>[{:name=>:retraction_reason_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SalespersonSplit=>{:fields=>[{:name=>:user_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:split, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SendNotificationProgressAction=>{:fields=>[], :base=>"ProgressAction"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SubmitProposalsForApprovalBypassValidation=>{:fields=>[], :base=>"ProposalAction"}, :SubmitProposalsForApproval=>{:fields=>[], :base=>"ProposalAction"}, :SubmitProposalsForArchival=>{:fields=>[], :base=>"ProposalAction"}, :SyncProposalsWithMarketplace=>{:fields=>[], :base=>"ProposalAction"}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TerminateNegotiations=>{:fields=>[], :base=>"ProposalAction"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProposals=>{:fields=>[], :base=>"ProposalAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateOrderWithSellerData=>{:fields=>[], :base=>"ProposalAction"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :WorkflowActionError=>{:fields=>[{:name=>:reason, :type=>"WorkflowActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgressAction=>{:fields=>[{:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :WorkflowProgress=>{:fields=>[{:name=>:steps, :type=>"ProgressStep", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:submitter_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:submission_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_processing, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ProgressStep=>{:fields=>[{:name=>:rules, :type=>"ProgressRule", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProgressRule=>{:fields=>[{:name=>:actions, :type=>"ProgressAction", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"WorkflowEvaluationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_external, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :WorkflowValidationError=>{:fields=>[{:name=>:reason, :type=>"WorkflowValidationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :WorkflowApprovalRequestStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingBase=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :EvaluationStatus=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"DealError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :ProposalApprovalStatus=>{:fields=>[]}, :NegotiationStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"PackageActionError.Reason"=>{:fields=>[]}, :"PackageError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProposalActionError.Reason"=>{:fields=>[]}, :ProposalCompanyAssociationType=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :"ProposalLineItemProgrammaticError.Reason"=>{:fields=>[]}, :ProposalStatus=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"WorkflowActionError.Reason"=>{:fields=>[]}, :WorkflowEvaluationStatus=>{:fields=>[]}, :"WorkflowValidationError.Reason"=>{:fields=>[]}} - PROPOSALSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PROPOSALSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PROPOSALSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PROPOSALSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ProposalServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/publisher_query_language_service_registry.rb b/dfp_api/lib/dfp_api/v201702/publisher_query_language_service_registry.rb deleted file mode 100755 index 03ee47262..000000000 --- a/dfp_api/lib/dfp_api/v201702/publisher_query_language_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:48. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module PublisherQueryLanguageService - class PublisherQueryLanguageServiceRegistry - PUBLISHERQUERYLANGUAGESERVICE_METHODS = {:select=>{:input=>[{:name=>:select_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"select_response", :fields=>[{:name=>:rval, :type=>"ResultSet", :min_occurs=>0, :max_occurs=>1}]}}} - PUBLISHERQUERYLANGUAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitHierarchyError=>{:fields=>[{:name=>:reason, :type=>"AdUnitHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ChangeHistoryValue=>{:fields=>[{:name=>:entity_type, :type=>"ChangeHistoryEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:operation, :type=>"ChangeHistoryOperation", :min_occurs=>0, :max_occurs=>1}], :base=>"ObjectValue"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ColumnType=>{:fields=>[{:name=>:label_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ResultSet=>{:fields=>[{:name=>:column_types, :type=>"ColumnType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rows, :type=>"Row", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Row=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TargetingValue=>{:fields=>[{:name=>:value, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}], :base=>"ObjectValue"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"AdUnitHierarchyError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :ChangeHistoryEntityType=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :ChangeHistoryOperation=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} - PUBLISHERQUERYLANGUAGESERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return PUBLISHERQUERYLANGUAGESERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return PUBLISHERQUERYLANGUAGESERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return PUBLISHERQUERYLANGUAGESERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, PublisherQueryLanguageServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/rate_card_service_registry.rb b/dfp_api/lib/dfp_api/v201702/rate_card_service_registry.rb deleted file mode 100755 index 9bfb8eee8..000000000 --- a/dfp_api/lib/dfp_api/v201702/rate_card_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:50. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module RateCardService - class RateCardServiceRegistry - RATECARDSERVICE_METHODS = {:create_rate_cards=>{:input=>[{:name=>:rate_cards, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_rate_cards_response", :fields=>[{:name=>:rval, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_rate_cards_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_rate_cards_by_statement_response", :fields=>[{:name=>:rval, :type=>"RateCardPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_rate_card_action=>{:input=>[{:name=>:rate_card_action, :type=>"RateCardAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_rate_card_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_rate_cards=>{:input=>[{:name=>:rate_cards, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_rate_cards_response", :fields=>[{:name=>:rval, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - RATECARDSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateRateCards=>{:fields=>[], :base=>"RateCardAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateRateCards=>{:fields=>[], :base=>"RateCardAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardAction=>{:fields=>[], :abstract=>true}, :RateCardActionError=>{:fields=>[{:name=>:reason, :type=>"RateCardActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCard=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"RateCardStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:for_marketplace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :RateCardError=>{:fields=>[{:name=>:reason, :type=>"RateCardError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardPage=>{:fields=>[{:name=>:results, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RateCardActionError.Reason"=>{:fields=>[]}, :"RateCardError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :RateCardStatus=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} - RATECARDSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return RATECARDSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return RATECARDSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return RATECARDSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, RateCardServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service_registry.rb b/dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service_registry.rb deleted file mode 100755 index 44cc831e8..000000000 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:52. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ReconciliationLineItemReportService - class ReconciliationLineItemReportServiceRegistry - RECONCILIATIONLINEITEMREPORTSERVICE_METHODS = {:get_reconciliation_line_item_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_line_item_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationLineItemReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_line_item_reports=>{:input=>[{:name=>:reconciliation_line_item_reports, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_line_item_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - RECONCILIATIONLINEITEMREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BillableRevenueOverrides=>{:fields=>[{:name=>:net_billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationLineItemReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_source, :type=>"BillFrom", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:cap_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rollover_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_billable_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_billable_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_revenue_overrides, :type=>"BillableRevenueOverrides", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationLineItemReportPage=>{:fields=>[{:name=>:results, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :BillFrom=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - RECONCILIATIONLINEITEMREPORTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return RECONCILIATIONLINEITEMREPORTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return RECONCILIATIONLINEITEMREPORTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return RECONCILIATIONLINEITEMREPORTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ReconciliationLineItemReportServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service_registry.rb b/dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service_registry.rb deleted file mode 100755 index 0f9e9f162..000000000 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:51. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ReconciliationOrderReportService - class ReconciliationOrderReportServiceRegistry - RECONCILIATIONORDERREPORTSERVICE_METHODS = {:get_reconciliation_order_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_order_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationOrderReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_reconciliation_order_report_action=>{:input=>[{:name=>:reconciliation_order_report_action, :type=>"ReconciliationOrderReportAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_reconciliation_order_report_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_order_reports=>{:input=>[{:name=>:reconciliation_order_reports, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_order_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - RECONCILIATIONORDERREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ReconciliationOrderReportAction=>{:fields=>[], :abstract=>true}, :ReconciliationOrderReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ReconciliationOrderReportStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:submission_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:submitter_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_net_billable_revenue_manual_adjustment, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_gross_billable_revenue_manual_adjustment, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationOrderReportPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SubmitReconciliationOrderReports=>{:fields=>[], :base=>"ReconciliationOrderReportAction"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RevertReconciliationOrderReports=>{:fields=>[], :base=>"ReconciliationOrderReportAction"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :ReconciliationOrderReportStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - RECONCILIATIONORDERREPORTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return RECONCILIATIONORDERREPORTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return RECONCILIATIONORDERREPORTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return RECONCILIATIONORDERREPORTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ReconciliationOrderReportServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service_registry.rb b/dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service_registry.rb deleted file mode 100755 index d3d9e1016..000000000 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:53. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ReconciliationReportRowService - class ReconciliationReportRowServiceRegistry - RECONCILIATIONREPORTROWSERVICE_METHODS = {:get_reconciliation_report_rows_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_report_rows_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportRowPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_report_rows=>{:input=>[{:name=>:reconciliation_report_rows, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_report_rows_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - RECONCILIATIONREPORTROWSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationImportError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationImportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationReportRow=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_source, :type=>"BillFrom", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationReportRowPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :BillFrom=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"ReconciliationImportError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - RECONCILIATIONREPORTROWSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return RECONCILIATIONREPORTROWSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return RECONCILIATIONREPORTROWSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return RECONCILIATIONREPORTROWSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ReconciliationReportRowServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_report_service_registry.rb b/dfp_api/lib/dfp_api/v201702/reconciliation_report_service_registry.rb deleted file mode 100755 index f13812348..000000000 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_report_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:53. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ReconciliationReportService - class ReconciliationReportServiceRegistry - RECONCILIATIONREPORTSERVICE_METHODS = {:get_reconciliation_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_reports=>{:input=>[{:name=>:reconciliation_reports, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - RECONCILIATIONREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationImportError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationImportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ReconciliationReportStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationReportPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"ReconciliationImportError.Reason"=>{:fields=>[]}, :ReconciliationReportStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - RECONCILIATIONREPORTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return RECONCILIATIONREPORTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return RECONCILIATIONREPORTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return RECONCILIATIONREPORTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ReconciliationReportServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/report_service_registry.rb b/dfp_api/lib/dfp_api/v201702/report_service_registry.rb deleted file mode 100755 index 4264de3e7..000000000 --- a/dfp_api/lib/dfp_api/v201702/report_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:54. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module ReportService - class ReportServiceRegistry - REPORTSERVICE_METHODS = {:get_report_download_url=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:export_format, :type=>"ExportFormat", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_download_url_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :original_name=>"getReportDownloadURL"}, :get_report_download_url_with_options=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_download_options, :type=>"ReportDownloadOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_download_url_with_options_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}}, :get_report_job_status=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_job_status_response", :fields=>[{:name=>:rval, :type=>"ReportJobStatus", :min_occurs=>0, :max_occurs=>1}]}}, :get_saved_queries_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_saved_queries_by_statement_response", :fields=>[{:name=>:rval, :type=>"SavedQueryPage", :min_occurs=>0, :max_occurs=>1}]}}, :run_report_job=>{:input=>[{:name=>:report_job, :type=>"ReportJob", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"run_report_job_response", :fields=>[{:name=>:rval, :type=>"ReportJob", :min_occurs=>0, :max_occurs=>1}]}}} - REPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportDownloadOptions=>{:fields=>[{:name=>:export_format, :type=>"ExportFormat", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_report_properties, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_totals_row, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:use_gzip_compression, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ReportError=>{:fields=>[{:name=>:reason, :type=>"ReportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportJob=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_query, :type=>"ReportQuery", :min_occurs=>0, :max_occurs=>1}]}, :ReportQuery=>{:fields=>[{:name=>:dimensions, :type=>"Dimension", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_unit_view, :type=>"ReportQuery.AdUnitView", :min_occurs=>0, :max_occurs=>1}, {:name=>:columns, :type=>"Column", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:dimension_attributes, :type=>"DimensionAttribute", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:content_metadata_key_hierarchy_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:date_range_type, :type=>"DateRangeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}, {:name=>:use_sales_local_time_zone, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_zero_sales_rows, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SavedQuery=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_query, :type=>"ReportQuery", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_compatible_with_api_version, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SavedQueryPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"SavedQuery", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ReportQuery.AdUnitView"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :Column=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :DateRangeType=>{:fields=>[]}, :Dimension=>{:fields=>[]}, :DimensionAttribute=>{:fields=>[]}, :ExportFormat=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"ReportError.Reason"=>{:fields=>[]}, :ReportJobStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} - REPORTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return REPORTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return REPORTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return REPORTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, ReportServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service_registry.rb b/dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service_registry.rb deleted file mode 100755 index 5306099bd..000000000 --- a/dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:57. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module SuggestedAdUnitService - class SuggestedAdUnitServiceRegistry - SUGGESTEDADUNITSERVICE_METHODS = {:get_suggested_ad_units_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_suggested_ad_units_by_statement_response", :fields=>[{:name=>:rval, :type=>"SuggestedAdUnitPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_suggested_ad_unit_action=>{:input=>[{:name=>:suggested_ad_unit_action, :type=>"SuggestedAdUnitAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_suggested_ad_unit_action_response", :fields=>[{:name=>:rval, :type=>"SuggestedAdUnitUpdateResult", :min_occurs=>0, :max_occurs=>1}]}}} - SUGGESTEDADUNITSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitParent=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveSuggestedAdUnits=>{:fields=>[], :base=>"SuggestedAdUnitAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitSize=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:full_display_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :InventoryUnitSizesError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitSizesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SuggestedAdUnitAction=>{:fields=>[], :abstract=>true}, :SuggestedAdUnit=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_requests, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:parent_path, :type=>"AdUnitParent", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:target_window, :type=>"AdUnit.TargetWindow", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_platform, :type=>"TargetPlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:suggested_ad_unit_sizes, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SuggestedAdUnitPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"SuggestedAdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SuggestedAdUnitUpdateResult=>{:fields=>[{:name=>:new_ad_unit_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"AdUnit.TargetWindow"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryUnitSizesError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TargetPlatform=>{:fields=>[]}} - SUGGESTEDADUNITSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return SUGGESTEDADUNITSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return SUGGESTEDADUNITSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return SUGGESTEDADUNITSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, SuggestedAdUnitServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/team_service_registry.rb b/dfp_api/lib/dfp_api/v201702/team_service_registry.rb deleted file mode 100755 index d9f2813f4..000000000 --- a/dfp_api/lib/dfp_api/v201702/team_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:58. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module TeamService - class TeamServiceRegistry - TEAMSERVICE_METHODS = {:create_teams=>{:input=>[{:name=>:teams, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_teams_response", :fields=>[{:name=>:rval, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_teams_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_teams_by_statement_response", :fields=>[{:name=>:rval, :type=>"TeamPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_teams=>{:input=>[{:name=>:teams, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_teams_response", :fields=>[{:name=>:rval, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - TEAMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Team=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_all_companies, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_all_inventory, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TeamPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TeamAccessType=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} - TEAMSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return TEAMSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return TEAMSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return TEAMSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, TeamServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/user_service_registry.rb b/dfp_api/lib/dfp_api/v201702/user_service_registry.rb deleted file mode 100755 index ef496dcb4..000000000 --- a/dfp_api/lib/dfp_api/v201702/user_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:58. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module UserService - class UserServiceRegistry - USERSERVICE_METHODS = {:create_users=>{:input=>[{:name=>:users, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_users_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_all_roles=>{:input=>[], :output=>{:name=>"get_all_roles_response", :fields=>[{:name=>:rval, :type=>"Role", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_current_user=>{:input=>[], :output=>{:name=>"get_current_user_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>1}]}}, :get_users_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_users_by_statement_response", :fields=>[{:name=>:rval, :type=>"UserPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_user_action=>{:input=>[{:name=>:user_action, :type=>"UserAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_user_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_users=>{:input=>[{:name=>:users, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_users_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - USERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateUsers=>{:fields=>[], :base=>"UserAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateUsers=>{:fields=>[], :base=>"UserAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Role=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TokenError=>{:fields=>[{:name=>:reason, :type=>"TokenError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserAction=>{:fields=>[], :abstract=>true}, :User=>{:fields=>[{:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_email_notification_allowed, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_service_account, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:orders_ui_local_time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"UserRecord"}, :UserPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}, :UserRecord=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:role_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:role_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"TokenError.Reason"=>{:fields=>[]}} - USERSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return USERSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return USERSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return USERSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, UserServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/user_team_association_service_registry.rb b/dfp_api/lib/dfp_api/v201702/user_team_association_service_registry.rb deleted file mode 100755 index 7c7d937d4..000000000 --- a/dfp_api/lib/dfp_api/v201702/user_team_association_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:18:00. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module UserTeamAssociationService - class UserTeamAssociationServiceRegistry - USERTEAMASSOCIATIONSERVICE_METHODS = {:create_user_team_associations=>{:input=>[{:name=>:user_team_associations, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_user_team_associations_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_user_team_associations_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_user_team_associations_by_statement_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociationPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_user_team_association_action=>{:input=>[{:name=>:user_team_association_action, :type=>"UserTeamAssociationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_user_team_association_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_user_team_associations=>{:input=>[{:name=>:user_team_associations, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_user_team_associations_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - USERTEAMASSOCIATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteUserTeamAssociations=>{:fields=>[], :base=>"UserTeamAssociationAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserRecordTeamAssociation=>{:fields=>[{:name=>:team_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:overridden_team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :UserTeamAssociationAction=>{:fields=>[], :abstract=>true}, :UserTeamAssociation=>{:fields=>[{:name=>:user_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"UserRecordTeamAssociation"}, :UserTeamAssociationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TeamAccessType=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} - USERTEAMASSOCIATIONSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return USERTEAMASSOCIATIONSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return USERTEAMASSOCIATIONSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return USERTEAMASSOCIATIONSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, UserTeamAssociationServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/workflow_request_service_registry.rb b/dfp_api/lib/dfp_api/v201702/workflow_request_service_registry.rb deleted file mode 100755 index c681cb372..000000000 --- a/dfp_api/lib/dfp_api/v201702/workflow_request_service_registry.rb +++ /dev/null @@ -1,45 +0,0 @@ -# Encoding: utf-8 -# -# This is auto-generated code, changes will be overwritten. -# -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. -# License:: Licensed under the Apache License, Version 2.0. -# -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:18:01. - -require 'dfp_api/errors' - -module DfpApi; module V201702; module WorkflowRequestService - class WorkflowRequestServiceRegistry - WORKFLOWREQUESTSERVICE_METHODS = {:get_workflow_requests_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_workflow_requests_by_statement_response", :fields=>[{:name=>:rval, :type=>"WorkflowRequestPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_workflow_request_action=>{:input=>[{:name=>:action, :type=>"WorkflowRequestAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_workflow_request_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}} - WORKFLOWREQUESTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveWorkflowApprovalRequests=>{:fields=>[{:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequestAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowRequest=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:workflow_rule_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_type, :type=>"WorkflowEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"WorkflowRequestType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :SkipWorkflowExternalConditionRequests=>{:fields=>[], :base=>"WorkflowRequestAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TriggerWorkflowExternalConditionRequests=>{:fields=>[], :base=>"WorkflowRequestAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectWorkflowApprovalRequests=>{:fields=>[{:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequestAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :WorkflowActionError=>{:fields=>[{:name=>:reason, :type=>"WorkflowActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowApprovalRequest=>{:fields=>[{:name=>:status, :type=>"WorkflowApprovalRequestStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequest"}, :WorkflowExternalConditionRequest=>{:fields=>[{:name=>:status, :type=>"WorkflowEvaluationStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequest"}, :WorkflowRequestAction=>{:fields=>[], :abstract=>true}, :WorkflowRequestError=>{:fields=>[{:name=>:reason, :type=>"WorkflowRequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowRequestPage=>{:fields=>[{:name=>:results, :type=>"WorkflowRequest", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :WorkflowApprovalRequestStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProposalActionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"WorkflowActionError.Reason"=>{:fields=>[]}, :WorkflowEntityType=>{:fields=>[]}, :"WorkflowRequestError.Reason"=>{:fields=>[]}, :WorkflowRequestType=>{:fields=>[]}, :WorkflowEvaluationStatus=>{:fields=>[]}} - WORKFLOWREQUESTSERVICE_NAMESPACES = [] - - def self.get_method_signature(method_name) - return WORKFLOWREQUESTSERVICE_METHODS[method_name.to_sym] - end - - def self.get_type_signature(type_name) - return WORKFLOWREQUESTSERVICE_TYPES[type_name.to_sym] - end - - def self.get_namespace(index) - return WORKFLOWREQUESTSERVICE_NAMESPACES[index] - end - end - - # Base class for exceptions. - class ApplicationException < DfpApi::Errors::ApiException - attr_reader :message # string - end - - # Exception class for holding a list of service errors. - class ApiException < ApplicationException - attr_reader :errors # ApiError - def initialize(exception_fault) - @array_fields ||= [] - @array_fields << 'errors' - super(exception_fault, WorkflowRequestServiceRegistry) - end - end -end; end; end diff --git a/dfp_api/lib/dfp_api/v201705/activity_group_service.rb b/dfp_api/lib/dfp_api/v201705/activity_group_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/activity_group_service_registry.rb b/dfp_api/lib/dfp_api/v201705/activity_group_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/activity_service.rb b/dfp_api/lib/dfp_api/v201705/activity_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/activity_service_registry.rb b/dfp_api/lib/dfp_api/v201705/activity_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/ad_exclusion_rule_service.rb b/dfp_api/lib/dfp_api/v201705/ad_exclusion_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/ad_exclusion_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201705/ad_exclusion_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/ad_rule_service.rb b/dfp_api/lib/dfp_api/v201705/ad_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/ad_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201705/ad_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/audience_segment_service.rb b/dfp_api/lib/dfp_api/v201705/audience_segment_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/audience_segment_service_registry.rb b/dfp_api/lib/dfp_api/v201705/audience_segment_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/base_rate_service.rb b/dfp_api/lib/dfp_api/v201705/base_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/base_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201705/base_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/company_service.rb b/dfp_api/lib/dfp_api/v201705/company_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/company_service_registry.rb b/dfp_api/lib/dfp_api/v201705/company_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/contact_service.rb b/dfp_api/lib/dfp_api/v201705/contact_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/contact_service_registry.rb b/dfp_api/lib/dfp_api/v201705/contact_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_bundle_service.rb b/dfp_api/lib/dfp_api/v201705/content_bundle_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_bundle_service_registry.rb b/dfp_api/lib/dfp_api/v201705/content_bundle_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_metadata_key_hierarchy_service.rb b/dfp_api/lib/dfp_api/v201705/content_metadata_key_hierarchy_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_metadata_key_hierarchy_service_registry.rb b/dfp_api/lib/dfp_api/v201705/content_metadata_key_hierarchy_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_service.rb b/dfp_api/lib/dfp_api/v201705/content_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/content_service_registry.rb b/dfp_api/lib/dfp_api/v201705/content_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_service.rb b/dfp_api/lib/dfp_api/v201705/creative_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_service_registry.rb b/dfp_api/lib/dfp_api/v201705/creative_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_set_service.rb b/dfp_api/lib/dfp_api/v201705/creative_set_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_set_service_registry.rb b/dfp_api/lib/dfp_api/v201705/creative_set_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_template_service.rb b/dfp_api/lib/dfp_api/v201705/creative_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_template_service_registry.rb b/dfp_api/lib/dfp_api/v201705/creative_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_wrapper_service.rb b/dfp_api/lib/dfp_api/v201705/creative_wrapper_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/creative_wrapper_service_registry.rb b/dfp_api/lib/dfp_api/v201705/creative_wrapper_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/custom_field_service.rb b/dfp_api/lib/dfp_api/v201705/custom_field_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/custom_field_service_registry.rb b/dfp_api/lib/dfp_api/v201705/custom_field_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/custom_targeting_service.rb b/dfp_api/lib/dfp_api/v201705/custom_targeting_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/custom_targeting_service_registry.rb b/dfp_api/lib/dfp_api/v201705/custom_targeting_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/exchange_rate_service.rb b/dfp_api/lib/dfp_api/v201705/exchange_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/exchange_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201705/exchange_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/forecast_service.rb b/dfp_api/lib/dfp_api/v201705/forecast_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/forecast_service_registry.rb b/dfp_api/lib/dfp_api/v201705/forecast_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/inventory_service.rb b/dfp_api/lib/dfp_api/v201705/inventory_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/inventory_service_registry.rb b/dfp_api/lib/dfp_api/v201705/inventory_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/label_service.rb b/dfp_api/lib/dfp_api/v201705/label_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/label_service_registry.rb b/dfp_api/lib/dfp_api/v201705/label_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_creative_association_service.rb b/dfp_api/lib/dfp_api/v201705/line_item_creative_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_creative_association_service_registry.rb b/dfp_api/lib/dfp_api/v201705/line_item_creative_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_service.rb b/dfp_api/lib/dfp_api/v201705/line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201705/line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_template_service.rb b/dfp_api/lib/dfp_api/v201705/line_item_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/line_item_template_service_registry.rb b/dfp_api/lib/dfp_api/v201705/line_item_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/live_stream_event_service.rb b/dfp_api/lib/dfp_api/v201705/live_stream_event_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/live_stream_event_service_registry.rb b/dfp_api/lib/dfp_api/v201705/live_stream_event_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/mobile_application_service.rb b/dfp_api/lib/dfp_api/v201705/mobile_application_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/mobile_application_service_registry.rb b/dfp_api/lib/dfp_api/v201705/mobile_application_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/native_style_service.rb b/dfp_api/lib/dfp_api/v201705/native_style_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/native_style_service_registry.rb b/dfp_api/lib/dfp_api/v201705/native_style_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/network_service.rb b/dfp_api/lib/dfp_api/v201705/network_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/network_service_registry.rb b/dfp_api/lib/dfp_api/v201705/network_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/order_service.rb b/dfp_api/lib/dfp_api/v201705/order_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/order_service_registry.rb b/dfp_api/lib/dfp_api/v201705/order_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/package_service.rb b/dfp_api/lib/dfp_api/v201705/package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/package_service_registry.rb b/dfp_api/lib/dfp_api/v201705/package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/placement_service.rb b/dfp_api/lib/dfp_api/v201705/placement_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/placement_service_registry.rb b/dfp_api/lib/dfp_api/v201705/placement_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/premium_rate_service.rb b/dfp_api/lib/dfp_api/v201705/premium_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/premium_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201705/premium_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_package_item_service.rb b/dfp_api/lib/dfp_api/v201705/product_package_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_package_item_service_registry.rb b/dfp_api/lib/dfp_api/v201705/product_package_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_package_service.rb b/dfp_api/lib/dfp_api/v201705/product_package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_package_service_registry.rb b/dfp_api/lib/dfp_api/v201705/product_package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_service.rb b/dfp_api/lib/dfp_api/v201705/product_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_service_registry.rb b/dfp_api/lib/dfp_api/v201705/product_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_template_service.rb b/dfp_api/lib/dfp_api/v201705/product_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/product_template_service_registry.rb b/dfp_api/lib/dfp_api/v201705/product_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/proposal_line_item_service.rb b/dfp_api/lib/dfp_api/v201705/proposal_line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/proposal_line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201705/proposal_line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/proposal_service.rb b/dfp_api/lib/dfp_api/v201705/proposal_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/proposal_service_registry.rb b/dfp_api/lib/dfp_api/v201705/proposal_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/publisher_query_language_service.rb b/dfp_api/lib/dfp_api/v201705/publisher_query_language_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/publisher_query_language_service_registry.rb b/dfp_api/lib/dfp_api/v201705/publisher_query_language_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/rate_card_service.rb b/dfp_api/lib/dfp_api/v201705/rate_card_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/rate_card_service_registry.rb b/dfp_api/lib/dfp_api/v201705/rate_card_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_line_item_report_service.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_line_item_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_line_item_report_service_registry.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_line_item_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_order_report_service.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_order_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_order_report_service_registry.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_order_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_report_row_service.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_report_row_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_report_row_service_registry.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_report_row_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_report_service.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/reconciliation_report_service_registry.rb b/dfp_api/lib/dfp_api/v201705/reconciliation_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/report_service.rb b/dfp_api/lib/dfp_api/v201705/report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/report_service_registry.rb b/dfp_api/lib/dfp_api/v201705/report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/suggested_ad_unit_service.rb b/dfp_api/lib/dfp_api/v201705/suggested_ad_unit_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/suggested_ad_unit_service_registry.rb b/dfp_api/lib/dfp_api/v201705/suggested_ad_unit_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/team_service.rb b/dfp_api/lib/dfp_api/v201705/team_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/team_service_registry.rb b/dfp_api/lib/dfp_api/v201705/team_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/user_service.rb b/dfp_api/lib/dfp_api/v201705/user_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/user_service_registry.rb b/dfp_api/lib/dfp_api/v201705/user_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/user_team_association_service.rb b/dfp_api/lib/dfp_api/v201705/user_team_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/user_team_association_service_registry.rb b/dfp_api/lib/dfp_api/v201705/user_team_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/workflow_request_service.rb b/dfp_api/lib/dfp_api/v201705/workflow_request_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201705/workflow_request_service_registry.rb b/dfp_api/lib/dfp_api/v201705/workflow_request_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/activity_group_service.rb b/dfp_api/lib/dfp_api/v201708/activity_group_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/activity_group_service_registry.rb b/dfp_api/lib/dfp_api/v201708/activity_group_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/activity_service.rb b/dfp_api/lib/dfp_api/v201708/activity_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/activity_service_registry.rb b/dfp_api/lib/dfp_api/v201708/activity_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/ad_exclusion_rule_service.rb b/dfp_api/lib/dfp_api/v201708/ad_exclusion_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/ad_exclusion_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201708/ad_exclusion_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/ad_rule_service.rb b/dfp_api/lib/dfp_api/v201708/ad_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/ad_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201708/ad_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/audience_segment_service.rb b/dfp_api/lib/dfp_api/v201708/audience_segment_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/audience_segment_service_registry.rb b/dfp_api/lib/dfp_api/v201708/audience_segment_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/base_rate_service.rb b/dfp_api/lib/dfp_api/v201708/base_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/base_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201708/base_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/company_service.rb b/dfp_api/lib/dfp_api/v201708/company_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/company_service_registry.rb b/dfp_api/lib/dfp_api/v201708/company_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/contact_service.rb b/dfp_api/lib/dfp_api/v201708/contact_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/contact_service_registry.rb b/dfp_api/lib/dfp_api/v201708/contact_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_bundle_service.rb b/dfp_api/lib/dfp_api/v201708/content_bundle_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_bundle_service_registry.rb b/dfp_api/lib/dfp_api/v201708/content_bundle_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_metadata_key_hierarchy_service.rb b/dfp_api/lib/dfp_api/v201708/content_metadata_key_hierarchy_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_metadata_key_hierarchy_service_registry.rb b/dfp_api/lib/dfp_api/v201708/content_metadata_key_hierarchy_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_service.rb b/dfp_api/lib/dfp_api/v201708/content_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/content_service_registry.rb b/dfp_api/lib/dfp_api/v201708/content_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_service.rb b/dfp_api/lib/dfp_api/v201708/creative_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_service_registry.rb b/dfp_api/lib/dfp_api/v201708/creative_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_set_service.rb b/dfp_api/lib/dfp_api/v201708/creative_set_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_set_service_registry.rb b/dfp_api/lib/dfp_api/v201708/creative_set_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_template_service.rb b/dfp_api/lib/dfp_api/v201708/creative_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_template_service_registry.rb b/dfp_api/lib/dfp_api/v201708/creative_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_wrapper_service.rb b/dfp_api/lib/dfp_api/v201708/creative_wrapper_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/creative_wrapper_service_registry.rb b/dfp_api/lib/dfp_api/v201708/creative_wrapper_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/custom_field_service.rb b/dfp_api/lib/dfp_api/v201708/custom_field_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/custom_field_service_registry.rb b/dfp_api/lib/dfp_api/v201708/custom_field_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/custom_targeting_service.rb b/dfp_api/lib/dfp_api/v201708/custom_targeting_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/custom_targeting_service_registry.rb b/dfp_api/lib/dfp_api/v201708/custom_targeting_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/exchange_rate_service.rb b/dfp_api/lib/dfp_api/v201708/exchange_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/exchange_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201708/exchange_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/forecast_service.rb b/dfp_api/lib/dfp_api/v201708/forecast_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/forecast_service_registry.rb b/dfp_api/lib/dfp_api/v201708/forecast_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/inventory_service.rb b/dfp_api/lib/dfp_api/v201708/inventory_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/inventory_service_registry.rb b/dfp_api/lib/dfp_api/v201708/inventory_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/label_service.rb b/dfp_api/lib/dfp_api/v201708/label_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/label_service_registry.rb b/dfp_api/lib/dfp_api/v201708/label_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_creative_association_service.rb b/dfp_api/lib/dfp_api/v201708/line_item_creative_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_creative_association_service_registry.rb b/dfp_api/lib/dfp_api/v201708/line_item_creative_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_service.rb b/dfp_api/lib/dfp_api/v201708/line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201708/line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_template_service.rb b/dfp_api/lib/dfp_api/v201708/line_item_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/line_item_template_service_registry.rb b/dfp_api/lib/dfp_api/v201708/line_item_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/live_stream_event_service.rb b/dfp_api/lib/dfp_api/v201708/live_stream_event_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/live_stream_event_service_registry.rb b/dfp_api/lib/dfp_api/v201708/live_stream_event_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/mobile_application_service.rb b/dfp_api/lib/dfp_api/v201708/mobile_application_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/mobile_application_service_registry.rb b/dfp_api/lib/dfp_api/v201708/mobile_application_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/native_style_service.rb b/dfp_api/lib/dfp_api/v201708/native_style_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/native_style_service_registry.rb b/dfp_api/lib/dfp_api/v201708/native_style_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/network_service.rb b/dfp_api/lib/dfp_api/v201708/network_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/network_service_registry.rb b/dfp_api/lib/dfp_api/v201708/network_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/order_service.rb b/dfp_api/lib/dfp_api/v201708/order_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/order_service_registry.rb b/dfp_api/lib/dfp_api/v201708/order_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/package_service.rb b/dfp_api/lib/dfp_api/v201708/package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/package_service_registry.rb b/dfp_api/lib/dfp_api/v201708/package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/placement_service.rb b/dfp_api/lib/dfp_api/v201708/placement_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/placement_service_registry.rb b/dfp_api/lib/dfp_api/v201708/placement_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/premium_rate_service.rb b/dfp_api/lib/dfp_api/v201708/premium_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/premium_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201708/premium_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_package_item_service.rb b/dfp_api/lib/dfp_api/v201708/product_package_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_package_item_service_registry.rb b/dfp_api/lib/dfp_api/v201708/product_package_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_package_service.rb b/dfp_api/lib/dfp_api/v201708/product_package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_package_service_registry.rb b/dfp_api/lib/dfp_api/v201708/product_package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_service.rb b/dfp_api/lib/dfp_api/v201708/product_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_service_registry.rb b/dfp_api/lib/dfp_api/v201708/product_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_template_service.rb b/dfp_api/lib/dfp_api/v201708/product_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/product_template_service_registry.rb b/dfp_api/lib/dfp_api/v201708/product_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/proposal_line_item_service.rb b/dfp_api/lib/dfp_api/v201708/proposal_line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/proposal_line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201708/proposal_line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/proposal_service.rb b/dfp_api/lib/dfp_api/v201708/proposal_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/proposal_service_registry.rb b/dfp_api/lib/dfp_api/v201708/proposal_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/publisher_query_language_service.rb b/dfp_api/lib/dfp_api/v201708/publisher_query_language_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/publisher_query_language_service_registry.rb b/dfp_api/lib/dfp_api/v201708/publisher_query_language_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/rate_card_service.rb b/dfp_api/lib/dfp_api/v201708/rate_card_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/rate_card_service_registry.rb b/dfp_api/lib/dfp_api/v201708/rate_card_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_line_item_report_service.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_line_item_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_line_item_report_service_registry.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_line_item_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_order_report_service.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_order_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_order_report_service_registry.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_order_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_report_row_service.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_report_row_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_report_row_service_registry.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_report_row_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_report_service.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/reconciliation_report_service_registry.rb b/dfp_api/lib/dfp_api/v201708/reconciliation_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/report_service.rb b/dfp_api/lib/dfp_api/v201708/report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/report_service_registry.rb b/dfp_api/lib/dfp_api/v201708/report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/suggested_ad_unit_service.rb b/dfp_api/lib/dfp_api/v201708/suggested_ad_unit_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/suggested_ad_unit_service_registry.rb b/dfp_api/lib/dfp_api/v201708/suggested_ad_unit_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/team_service.rb b/dfp_api/lib/dfp_api/v201708/team_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/team_service_registry.rb b/dfp_api/lib/dfp_api/v201708/team_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/user_service.rb b/dfp_api/lib/dfp_api/v201708/user_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/user_service_registry.rb b/dfp_api/lib/dfp_api/v201708/user_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/user_team_association_service.rb b/dfp_api/lib/dfp_api/v201708/user_team_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/user_team_association_service_registry.rb b/dfp_api/lib/dfp_api/v201708/user_team_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/workflow_request_service.rb b/dfp_api/lib/dfp_api/v201708/workflow_request_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201708/workflow_request_service_registry.rb b/dfp_api/lib/dfp_api/v201708/workflow_request_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/activity_group_service.rb b/dfp_api/lib/dfp_api/v201711/activity_group_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/activity_group_service_registry.rb b/dfp_api/lib/dfp_api/v201711/activity_group_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/activity_service.rb b/dfp_api/lib/dfp_api/v201711/activity_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/activity_service_registry.rb b/dfp_api/lib/dfp_api/v201711/activity_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/ad_exclusion_rule_service.rb b/dfp_api/lib/dfp_api/v201711/ad_exclusion_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/ad_exclusion_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201711/ad_exclusion_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/ad_rule_service.rb b/dfp_api/lib/dfp_api/v201711/ad_rule_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/ad_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201711/ad_rule_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/audience_segment_service.rb b/dfp_api/lib/dfp_api/v201711/audience_segment_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/audience_segment_service_registry.rb b/dfp_api/lib/dfp_api/v201711/audience_segment_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/base_rate_service.rb b/dfp_api/lib/dfp_api/v201711/base_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/base_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201711/base_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/cdn_configuration_service.rb b/dfp_api/lib/dfp_api/v201711/cdn_configuration_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/cdn_configuration_service_registry.rb b/dfp_api/lib/dfp_api/v201711/cdn_configuration_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/company_service.rb b/dfp_api/lib/dfp_api/v201711/company_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/company_service_registry.rb b/dfp_api/lib/dfp_api/v201711/company_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/contact_service.rb b/dfp_api/lib/dfp_api/v201711/contact_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/contact_service_registry.rb b/dfp_api/lib/dfp_api/v201711/contact_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_bundle_service.rb b/dfp_api/lib/dfp_api/v201711/content_bundle_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_bundle_service_registry.rb b/dfp_api/lib/dfp_api/v201711/content_bundle_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_metadata_key_hierarchy_service.rb b/dfp_api/lib/dfp_api/v201711/content_metadata_key_hierarchy_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_metadata_key_hierarchy_service_registry.rb b/dfp_api/lib/dfp_api/v201711/content_metadata_key_hierarchy_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_service.rb b/dfp_api/lib/dfp_api/v201711/content_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/content_service_registry.rb b/dfp_api/lib/dfp_api/v201711/content_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_service.rb b/dfp_api/lib/dfp_api/v201711/creative_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_service_registry.rb b/dfp_api/lib/dfp_api/v201711/creative_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_set_service.rb b/dfp_api/lib/dfp_api/v201711/creative_set_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_set_service_registry.rb b/dfp_api/lib/dfp_api/v201711/creative_set_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_template_service.rb b/dfp_api/lib/dfp_api/v201711/creative_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_template_service_registry.rb b/dfp_api/lib/dfp_api/v201711/creative_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_wrapper_service.rb b/dfp_api/lib/dfp_api/v201711/creative_wrapper_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/creative_wrapper_service_registry.rb b/dfp_api/lib/dfp_api/v201711/creative_wrapper_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/custom_field_service.rb b/dfp_api/lib/dfp_api/v201711/custom_field_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/custom_field_service_registry.rb b/dfp_api/lib/dfp_api/v201711/custom_field_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/custom_targeting_service.rb b/dfp_api/lib/dfp_api/v201711/custom_targeting_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/custom_targeting_service_registry.rb b/dfp_api/lib/dfp_api/v201711/custom_targeting_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/exchange_rate_service.rb b/dfp_api/lib/dfp_api/v201711/exchange_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/exchange_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201711/exchange_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/forecast_service.rb b/dfp_api/lib/dfp_api/v201711/forecast_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/forecast_service_registry.rb b/dfp_api/lib/dfp_api/v201711/forecast_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/inventory_service.rb b/dfp_api/lib/dfp_api/v201711/inventory_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/inventory_service_registry.rb b/dfp_api/lib/dfp_api/v201711/inventory_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/label_service.rb b/dfp_api/lib/dfp_api/v201711/label_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/label_service_registry.rb b/dfp_api/lib/dfp_api/v201711/label_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_creative_association_service.rb b/dfp_api/lib/dfp_api/v201711/line_item_creative_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_creative_association_service_registry.rb b/dfp_api/lib/dfp_api/v201711/line_item_creative_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_service.rb b/dfp_api/lib/dfp_api/v201711/line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201711/line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_template_service.rb b/dfp_api/lib/dfp_api/v201711/line_item_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/line_item_template_service_registry.rb b/dfp_api/lib/dfp_api/v201711/line_item_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/live_stream_event_service.rb b/dfp_api/lib/dfp_api/v201711/live_stream_event_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/live_stream_event_service_registry.rb b/dfp_api/lib/dfp_api/v201711/live_stream_event_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/mobile_application_service.rb b/dfp_api/lib/dfp_api/v201711/mobile_application_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/mobile_application_service_registry.rb b/dfp_api/lib/dfp_api/v201711/mobile_application_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/native_style_service.rb b/dfp_api/lib/dfp_api/v201711/native_style_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/native_style_service_registry.rb b/dfp_api/lib/dfp_api/v201711/native_style_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/network_service.rb b/dfp_api/lib/dfp_api/v201711/network_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/network_service_registry.rb b/dfp_api/lib/dfp_api/v201711/network_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/order_service.rb b/dfp_api/lib/dfp_api/v201711/order_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/order_service_registry.rb b/dfp_api/lib/dfp_api/v201711/order_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/package_service.rb b/dfp_api/lib/dfp_api/v201711/package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/package_service_registry.rb b/dfp_api/lib/dfp_api/v201711/package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/placement_service.rb b/dfp_api/lib/dfp_api/v201711/placement_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/placement_service_registry.rb b/dfp_api/lib/dfp_api/v201711/placement_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/premium_rate_service.rb b/dfp_api/lib/dfp_api/v201711/premium_rate_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/premium_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201711/premium_rate_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_package_item_service.rb b/dfp_api/lib/dfp_api/v201711/product_package_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_package_item_service_registry.rb b/dfp_api/lib/dfp_api/v201711/product_package_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_package_service.rb b/dfp_api/lib/dfp_api/v201711/product_package_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_package_service_registry.rb b/dfp_api/lib/dfp_api/v201711/product_package_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_service.rb b/dfp_api/lib/dfp_api/v201711/product_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_service_registry.rb b/dfp_api/lib/dfp_api/v201711/product_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_template_service.rb b/dfp_api/lib/dfp_api/v201711/product_template_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/product_template_service_registry.rb b/dfp_api/lib/dfp_api/v201711/product_template_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/proposal_line_item_service.rb b/dfp_api/lib/dfp_api/v201711/proposal_line_item_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/proposal_line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201711/proposal_line_item_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/proposal_service.rb b/dfp_api/lib/dfp_api/v201711/proposal_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/proposal_service_registry.rb b/dfp_api/lib/dfp_api/v201711/proposal_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/publisher_query_language_service.rb b/dfp_api/lib/dfp_api/v201711/publisher_query_language_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/publisher_query_language_service_registry.rb b/dfp_api/lib/dfp_api/v201711/publisher_query_language_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/rate_card_service.rb b/dfp_api/lib/dfp_api/v201711/rate_card_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/rate_card_service_registry.rb b/dfp_api/lib/dfp_api/v201711/rate_card_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_line_item_report_service.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_line_item_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_line_item_report_service_registry.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_line_item_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_order_report_service.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_order_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_order_report_service_registry.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_order_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_report_row_service.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_report_row_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_report_row_service_registry.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_report_row_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_report_service.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/reconciliation_report_service_registry.rb b/dfp_api/lib/dfp_api/v201711/reconciliation_report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/report_service.rb b/dfp_api/lib/dfp_api/v201711/report_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/report_service_registry.rb b/dfp_api/lib/dfp_api/v201711/report_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/suggested_ad_unit_service.rb b/dfp_api/lib/dfp_api/v201711/suggested_ad_unit_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/suggested_ad_unit_service_registry.rb b/dfp_api/lib/dfp_api/v201711/suggested_ad_unit_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/team_service.rb b/dfp_api/lib/dfp_api/v201711/team_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/team_service_registry.rb b/dfp_api/lib/dfp_api/v201711/team_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/user_service.rb b/dfp_api/lib/dfp_api/v201711/user_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/user_service_registry.rb b/dfp_api/lib/dfp_api/v201711/user_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/user_team_association_service.rb b/dfp_api/lib/dfp_api/v201711/user_team_association_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/user_team_association_service_registry.rb b/dfp_api/lib/dfp_api/v201711/user_team_association_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/workflow_request_service.rb b/dfp_api/lib/dfp_api/v201711/workflow_request_service.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201711/workflow_request_service_registry.rb b/dfp_api/lib/dfp_api/v201711/workflow_request_service_registry.rb old mode 100755 new mode 100644 diff --git a/dfp_api/lib/dfp_api/v201702/activity_group_service.rb b/dfp_api/lib/dfp_api/v201802/activity_group_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/activity_group_service.rb rename to dfp_api/lib/dfp_api/v201802/activity_group_service.rb index d4651b8f6..a86c940ef --- a/dfp_api/lib/dfp_api/v201702/activity_group_service.rb +++ b/dfp_api/lib/dfp_api/v201802/activity_group_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:47. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:35. require 'ads_common/savon_service' -require 'dfp_api/v201702/activity_group_service_registry' +require 'dfp_api/v201802/activity_group_service_registry' -module DfpApi; module V201702; module ActivityGroupService +module DfpApi; module V201802; module ActivityGroupService class ActivityGroupService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_activity_groups(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ActivityGroupService + return DfpApi::V201802::ActivityGroupService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/activity_group_service_registry.rb b/dfp_api/lib/dfp_api/v201802/activity_group_service_registry.rb new file mode 100644 index 000000000..1a71f2ceb --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/activity_group_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:35. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ActivityGroupService + class ActivityGroupServiceRegistry + ACTIVITYGROUPSERVICE_METHODS = {:create_activity_groups=>{:input=>[{:name=>:activity_groups, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_activity_groups_response", :fields=>[{:name=>:rval, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_activity_groups_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_activity_groups_by_statement_response", :fields=>[{:name=>:rval, :type=>"ActivityGroupPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_activity_groups=>{:input=>[{:name=>:activity_groups, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_activity_groups_response", :fields=>[{:name=>:rval, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ACTIVITYGROUPSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivityError=>{:fields=>[{:name=>:reason, :type=>"ActivityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ActivityGroup=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:impressions_lookback, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_lookback, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ActivityGroup.Status", :min_occurs=>0, :max_occurs=>1}]}, :ActivityGroupPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ActivityGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ActivityError.Reason"=>{:fields=>[]}, :"ActivityGroup.Status"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ACTIVITYGROUPSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ACTIVITYGROUPSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ACTIVITYGROUPSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ACTIVITYGROUPSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ActivityGroupServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/activity_service.rb b/dfp_api/lib/dfp_api/v201802/activity_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/activity_service.rb rename to dfp_api/lib/dfp_api/v201802/activity_service.rb index f15bf7792..fc72b54f0 --- a/dfp_api/lib/dfp_api/v201702/activity_service.rb +++ b/dfp_api/lib/dfp_api/v201802/activity_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:48. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:36. require 'ads_common/savon_service' -require 'dfp_api/v201702/activity_service_registry' +require 'dfp_api/v201802/activity_service_registry' -module DfpApi; module V201702; module ActivityService +module DfpApi; module V201802; module ActivityService class ActivityService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_activities(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ActivityService + return DfpApi::V201802::ActivityService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/activity_service_registry.rb b/dfp_api/lib/dfp_api/v201802/activity_service_registry.rb new file mode 100644 index 000000000..e56eb7509 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/activity_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:36. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ActivityService + class ActivityServiceRegistry + ACTIVITYSERVICE_METHODS = {:create_activities=>{:input=>[{:name=>:activities, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_activities_response", :fields=>[{:name=>:rval, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_activities_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_activities_by_statement_response", :fields=>[{:name=>:rval, :type=>"ActivityPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_activities=>{:input=>[{:name=>:activities, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_activities_response", :fields=>[{:name=>:rval, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ACTIVITYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :Activity=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:activity_group_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:expected_url, :original_name=>"expectedURL", :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Activity.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Activity.Type", :min_occurs=>0, :max_occurs=>1}]}, :ActivityError=>{:fields=>[{:name=>:reason, :type=>"ActivityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ActivityPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Activity", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"Activity.Status"=>{:fields=>[]}, :"Activity.Type"=>{:fields=>[]}, :"ActivityError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ACTIVITYSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ACTIVITYSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ACTIVITYSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ACTIVITYSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ActivityServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service.rb b/dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service.rb rename to dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service.rb index a62214a05..09c0904d6 --- a/dfp_api/lib/dfp_api/v201702/ad_exclusion_rule_service.rb +++ b/dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:49. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:36. require 'ads_common/savon_service' -require 'dfp_api/v201702/ad_exclusion_rule_service_registry' +require 'dfp_api/v201802/ad_exclusion_rule_service_registry' -module DfpApi; module V201702; module AdExclusionRuleService +module DfpApi; module V201802; module AdExclusionRuleService class AdExclusionRuleService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_ad_exclusion_rules(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::AdExclusionRuleService + return DfpApi::V201802::AdExclusionRuleService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service_registry.rb new file mode 100644 index 000000000..499aa3979 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/ad_exclusion_rule_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:36. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module AdExclusionRuleService + class AdExclusionRuleServiceRegistry + ADEXCLUSIONRULESERVICE_METHODS = {:create_ad_exclusion_rules=>{:input=>[{:name=>:ad_exclusion_rules, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_exclusion_rules_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_exclusion_rules_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_exclusion_rules_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRulePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_exclusion_rule_action=>{:input=>[{:name=>:ad_exclusion_rule_action, :type=>"AdExclusionRuleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_exclusion_rule_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_exclusion_rules=>{:input=>[{:name=>:ad_exclusion_rules, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_exclusion_rules_response", :fields=>[{:name=>:rval, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ADEXCLUSIONRULESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdExclusionRules=>{:fields=>[], :base=>"AdExclusionRuleAction"}, :AdExclusionRuleAction=>{:fields=>[], :abstract=>true}, :AdExclusionRule=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_block_all, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:blocked_label_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allowed_label_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:type, :type=>"AdExclusionRuleType", :min_occurs=>0, :max_occurs=>1}]}, :AdExclusionRuleError=>{:fields=>[{:name=>:reason, :type=>"AdExclusionRuleError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdExclusionRulePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdExclusionRule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAdExclusionRules=>{:fields=>[], :base=>"AdExclusionRuleAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdExclusionRuleError.Reason"=>{:fields=>[]}, :AdExclusionRuleType=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADEXCLUSIONRULESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADEXCLUSIONRULESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADEXCLUSIONRULESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADEXCLUSIONRULESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdExclusionRuleServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/ad_rule_service.rb b/dfp_api/lib/dfp_api/v201802/ad_rule_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/ad_rule_service.rb rename to dfp_api/lib/dfp_api/v201802/ad_rule_service.rb index 0463c7b1a..22418b147 --- a/dfp_api/lib/dfp_api/v201702/ad_rule_service.rb +++ b/dfp_api/lib/dfp_api/v201802/ad_rule_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:50. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:37. require 'ads_common/savon_service' -require 'dfp_api/v201702/ad_rule_service_registry' +require 'dfp_api/v201802/ad_rule_service_registry' -module DfpApi; module V201702; module AdRuleService +module DfpApi; module V201802; module AdRuleService class AdRuleService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_ad_rules(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::AdRuleService + return DfpApi::V201802::AdRuleService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/ad_rule_service_registry.rb b/dfp_api/lib/dfp_api/v201802/ad_rule_service_registry.rb new file mode 100644 index 000000000..cd406c987 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/ad_rule_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:37. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module AdRuleService + class AdRuleServiceRegistry + ADRULESERVICE_METHODS = {:create_ad_rules=>{:input=>[{:name=>:ad_rules, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_rules_response", :fields=>[{:name=>:rval, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_rules_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_rules_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdRulePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_rule_action=>{:input=>[{:name=>:ad_rule_action, :type=>"AdRuleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_rule_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_rules=>{:input=>[{:name=>:ad_rules, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_rules_response", :fields=>[{:name=>:rval, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ADRULESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :AdRuleAction=>{:fields=>[], :abstract=>true}, :AdRuleDateError=>{:fields=>[{:name=>:reason, :type=>"AdRuleDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdRule=>{:fields=>[{:name=>:ad_rule_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdRuleStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_cap_behavior, :type=>"FrequencyCapBehavior", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_impressions_per_line_item_per_stream, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_impressions_per_line_item_per_pod, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:preroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}, {:name=>:postroll, :type=>"BaseAdRuleSlot", :min_occurs=>0, :max_occurs=>1}]}, :AdRuleFrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"AdRuleFrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NoPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :OptimizedPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :AdRulePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdRule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdRulePriorityError=>{:fields=>[{:name=>:reason, :type=>"AdRulePriorityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseAdRuleSlot=>{:fields=>[{:name=>:slot_behavior, :type=>"AdRuleSlotBehavior", :min_occurs=>0, :max_occurs=>1}, {:name=>:min_video_ad_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_video_ad_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_midroll_frequency_type, :type=>"MidrollFrequencyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_midroll_frequency, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bumper, :type=>"AdRuleSlotBumper", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_bumper_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:min_pod_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_pod_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_ads_in_pod, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdRuleSlotError=>{:fields=>[{:name=>:reason, :type=>"AdRuleSlotError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StandardPoddingAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :AdRuleTargetingError=>{:fields=>[{:name=>:reason, :type=>"AdRuleTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeactivateAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :DeleteAdRules=>{:fields=>[], :base=>"AdRuleAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PoddingError=>{:fields=>[{:name=>:reason, :type=>"PoddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnknownAdRuleSlot=>{:fields=>[], :base=>"BaseAdRuleSlot"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdRuleDateError.Reason"=>{:fields=>[]}, :"AdRuleFrequencyCapError.Reason"=>{:fields=>[]}, :"AdRulePriorityError.Reason"=>{:fields=>[]}, :AdRuleSlotBehavior=>{:fields=>[]}, :AdRuleSlotBumper=>{:fields=>[]}, :"AdRuleSlotError.Reason"=>{:fields=>[]}, :AdRuleStatus=>{:fields=>[]}, :"AdRuleTargetingError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :FrequencyCapBehavior=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :MidrollFrequencyType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PoddingError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} + ADRULESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADRULESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADRULESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADRULESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdRuleServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/audience_segment_service.rb b/dfp_api/lib/dfp_api/v201802/audience_segment_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/audience_segment_service.rb rename to dfp_api/lib/dfp_api/v201802/audience_segment_service.rb index 35d16a2fe..b26cfad89 --- a/dfp_api/lib/dfp_api/v201702/audience_segment_service.rb +++ b/dfp_api/lib/dfp_api/v201802/audience_segment_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:52. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:38. require 'ads_common/savon_service' -require 'dfp_api/v201702/audience_segment_service_registry' +require 'dfp_api/v201802/audience_segment_service_registry' -module DfpApi; module V201702; module AudienceSegmentService +module DfpApi; module V201802; module AudienceSegmentService class AudienceSegmentService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_audience_segments(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::AudienceSegmentService + return DfpApi::V201802::AudienceSegmentService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/audience_segment_service_registry.rb b/dfp_api/lib/dfp_api/v201802/audience_segment_service_registry.rb new file mode 100644 index 000000000..34feb3847 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/audience_segment_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:38. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module AudienceSegmentService + class AudienceSegmentServiceRegistry + AUDIENCESEGMENTSERVICE_METHODS = {:create_audience_segments=>{:input=>[{:name=>:segments, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_audience_segments_response", :fields=>[{:name=>:rval, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_audience_segments_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_audience_segments_by_statement_response", :fields=>[{:name=>:rval, :type=>"AudienceSegmentPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_audience_segment_action=>{:input=>[{:name=>:action, :type=>"AudienceSegmentAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_audience_segment_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_audience_segments=>{:input=>[{:name=>:segments, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_audience_segments_response", :fields=>[{:name=>:rval, :type=>"FirstPartyAudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + AUDIENCESEGMENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :AudienceSegmentDataProvider=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AudienceSegment", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FirstPartyAudienceSegment=>{:fields=>[], :abstract=>true, :base=>"AudienceSegment"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ThirdPartyAudienceSegment=>{:fields=>[{:name=>:approval_status, :type=>"ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:license_type, :type=>"ThirdPartyAudienceSegment.LicenseType", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"AudienceSegment"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NonRuleBasedFirstPartyAudienceSegment=>{:fields=>[{:name=>:membership_expiration_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"FirstPartyAudienceSegment"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PopulateAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FirstPartyAudienceSegmentRule=>{:fields=>[{:name=>:inventory_rule, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_criteria_rule, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}]}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectAudienceSegments=>{:fields=>[], :base=>"AudienceSegmentAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RuleBasedFirstPartyAudienceSegment=>{:fields=>[{:name=>:rule, :type=>"FirstPartyAudienceSegmentRule", :min_occurs=>0, :max_occurs=>1}], :base=>"RuleBasedFirstPartyAudienceSegmentSummary"}, :RuleBasedFirstPartyAudienceSegmentSummary=>{:fields=>[{:name=>:page_views, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:recency_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:membership_expiration_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"FirstPartyAudienceSegment"}, :AudienceSegmentAction=>{:fields=>[], :abstract=>true}, :AudienceSegment=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:category_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AudienceSegment.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_web_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:idfa_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_id_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ppid_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:data_provider, :type=>"AudienceSegmentDataProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"AudienceSegment.Type", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SharedAudienceSegment=>{:fields=>[], :base=>"AudienceSegment"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"ThirdPartyAudienceSegment.AudienceSegmentApprovalStatus"=>{:fields=>[]}, :"ThirdPartyAudienceSegment.LicenseType"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"AudienceSegment.Type"=>{:fields=>[]}, :"AudienceSegment.Status"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + AUDIENCESEGMENTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return AUDIENCESEGMENTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return AUDIENCESEGMENTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return AUDIENCESEGMENTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AudienceSegmentServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/base_rate_service.rb b/dfp_api/lib/dfp_api/v201802/base_rate_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/base_rate_service.rb rename to dfp_api/lib/dfp_api/v201802/base_rate_service.rb index aa19d6c37..40e97cce7 --- a/dfp_api/lib/dfp_api/v201702/base_rate_service.rb +++ b/dfp_api/lib/dfp_api/v201802/base_rate_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:53. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:38. require 'ads_common/savon_service' -require 'dfp_api/v201702/base_rate_service_registry' +require 'dfp_api/v201802/base_rate_service_registry' -module DfpApi; module V201702; module BaseRateService +module DfpApi; module V201802; module BaseRateService class BaseRateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_base_rates(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::BaseRateService + return DfpApi::V201802::BaseRateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/base_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201802/base_rate_service_registry.rb new file mode 100644 index 000000000..709a78734 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/base_rate_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:38. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module BaseRateService + class BaseRateServiceRegistry + BASERATESERVICE_METHODS = {:create_base_rates=>{:input=>[{:name=>:base_rates, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_base_rates_response", :fields=>[{:name=>:rval, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_base_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_base_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"BaseRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_base_rate_action=>{:input=>[{:name=>:base_rate_action, :type=>"BaseRateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_base_rate_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_base_rates=>{:input=>[{:name=>:base_rates, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_base_rates_response", :fields=>[{:name=>:rval, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + BASERATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRateAction=>{:fields=>[], :abstract=>true}, :BaseRateActionError=>{:fields=>[{:name=>:reason, :type=>"BaseRateActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRate=>{:fields=>[{:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseRatePage=>{:fields=>[{:name=>:results, :type=>"BaseRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteBaseRates=>{:fields=>[], :base=>"BaseRateAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductBaseRate=>{:fields=>[{:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :ProductPackageItemBaseRate=>{:fields=>[{:name=>:product_package_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :ProductTemplateBaseRate=>{:fields=>[{:name=>:product_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRate"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnknownBaseRate=>{:fields=>[], :base=>"BaseRate"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateActionError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + BASERATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return BASERATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return BASERATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return BASERATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, BaseRateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/cdn_configuration_service.rb b/dfp_api/lib/dfp_api/v201802/cdn_configuration_service.rb new file mode 100644 index 000000000..7aa0765a3 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/cdn_configuration_service.rb @@ -0,0 +1,54 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:40. + +require 'ads_common/savon_service' +require 'dfp_api/v201802/cdn_configuration_service_registry' + +module DfpApi; module V201802; module CdnConfigurationService + class CdnConfigurationService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) + end + + def create_cdn_configurations(*args, &block) + return execute_action('create_cdn_configurations', args, &block) + end + + def create_cdn_configurations_to_xml(*args) + return get_soap_xml('create_cdn_configurations', args) + end + + def get_cdn_configurations_by_statement(*args, &block) + return execute_action('get_cdn_configurations_by_statement', args, &block) + end + + def get_cdn_configurations_by_statement_to_xml(*args) + return get_soap_xml('get_cdn_configurations_by_statement', args) + end + + def update_cdn_configurations(*args, &block) + return execute_action('update_cdn_configurations', args, &block) + end + + def update_cdn_configurations_to_xml(*args) + return get_soap_xml('update_cdn_configurations', args) + end + + private + + def get_service_registry() + return CdnConfigurationServiceRegistry + end + + def get_module() + return DfpApi::V201802::CdnConfigurationService + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/cdn_configuration_service_registry.rb b/dfp_api/lib/dfp_api/v201802/cdn_configuration_service_registry.rb new file mode 100644 index 000000000..75992f434 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/cdn_configuration_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:40. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CdnConfigurationService + class CdnConfigurationServiceRegistry + CDNCONFIGURATIONSERVICE_METHODS = {:create_cdn_configurations=>{:input=>[{:name=>:cdn_configurations, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_cdn_configurations_response", :fields=>[{:name=>:rval, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_cdn_configurations_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_cdn_configurations_by_statement_response", :fields=>[{:name=>:rval, :type=>"CdnConfigurationPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_cdn_configurations=>{:input=>[{:name=>:cdn_configurations, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_cdn_configurations_response", :fields=>[{:name=>:rval, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CDNCONFIGURATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CdnConfiguration=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cdn_configuration_type, :type=>"CdnConfigurationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_content_configuration, :type=>"SourceContentConfiguration", :min_occurs=>0, :max_occurs=>1}]}, :CdnConfigurationError=>{:fields=>[{:name=>:reason, :type=>"CdnConfigurationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CdnConfigurationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MediaLocationSettings=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_prefix, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:security_policy, :type=>"SecurityPolicySettings", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SecurityPolicySettings=>{:fields=>[{:name=>:security_policy_type, :type=>"SecurityPolicyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:token_authentication_key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:disable_server_side_url_signing, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_forwarding_type, :type=>"OriginForwardingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_path_prefix, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :SourceContentConfiguration=>{:fields=>[{:name=>:ingest_settings, :type=>"MediaLocationSettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_delivery_settings, :type=>"MediaLocationSettings", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CdnConfigurationError.Reason"=>{:fields=>[]}, :CdnConfigurationType=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :OriginForwardingType=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :SecurityPolicyType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CDNCONFIGURATIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CDNCONFIGURATIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CDNCONFIGURATIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CDNCONFIGURATIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CdnConfigurationServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/company_service.rb b/dfp_api/lib/dfp_api/v201802/company_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/company_service.rb rename to dfp_api/lib/dfp_api/v201802/company_service.rb index c8e2a41fc..dfd1553f1 --- a/dfp_api/lib/dfp_api/v201702/company_service.rb +++ b/dfp_api/lib/dfp_api/v201802/company_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:54. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:39. require 'ads_common/savon_service' -require 'dfp_api/v201702/company_service_registry' +require 'dfp_api/v201802/company_service_registry' -module DfpApi; module V201702; module CompanyService +module DfpApi; module V201802; module CompanyService class CompanyService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_companies(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CompanyService + return DfpApi::V201802::CompanyService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/company_service_registry.rb b/dfp_api/lib/dfp_api/v201802/company_service_registry.rb new file mode 100644 index 000000000..5d93509be --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/company_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:39. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CompanyService + class CompanyServiceRegistry + COMPANYSERVICE_METHODS = {:create_companies=>{:input=>[{:name=>:companies, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_companies_response", :fields=>[{:name=>:rval, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_companies_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_companies_by_statement_response", :fields=>[{:name=>:rval, :type=>"CompanyPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_companies=>{:input=>[{:name=>:companies, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_companies_response", :fields=>[{:name=>:rval, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + COMPANYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Company=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Company.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fax_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:credit_status, :type=>"Company.CreditStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"CompanySettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:primary_contact_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:third_party_company_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :CompanyError=>{:fields=>[{:name=>:reason, :type=>"CompanyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CompanySettings=>{:fields=>[{:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_added_tax, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_commission, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NetworkError=>{:fields=>[{:name=>:reason, :type=>"NetworkError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"Company.CreditStatus"=>{:fields=>[]}, :"Company.Type"=>{:fields=>[]}, :"CompanyError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NetworkError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} + COMPANYSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return COMPANYSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return COMPANYSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return COMPANYSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CompanyServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/contact_service.rb b/dfp_api/lib/dfp_api/v201802/contact_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/contact_service.rb rename to dfp_api/lib/dfp_api/v201802/contact_service.rb index 8fa19925f..d8336ab4f --- a/dfp_api/lib/dfp_api/v201702/contact_service.rb +++ b/dfp_api/lib/dfp_api/v201802/contact_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:56. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:40. require 'ads_common/savon_service' -require 'dfp_api/v201702/contact_service_registry' +require 'dfp_api/v201802/contact_service_registry' -module DfpApi; module V201702; module ContactService +module DfpApi; module V201802; module ContactService class ContactService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_contacts(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ContactService + return DfpApi::V201802::ContactService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/contact_service_registry.rb b/dfp_api/lib/dfp_api/v201802/contact_service_registry.rb new file mode 100644 index 000000000..f8f392615 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/contact_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:40. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ContactService + class ContactServiceRegistry + CONTACTSERVICE_METHODS = {:create_contacts=>{:input=>[{:name=>:contacts, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_contacts_response", :fields=>[{:name=>:rval, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_contacts_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_contacts_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContactPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_contacts=>{:input=>[{:name=>:contacts, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_contacts_response", :fields=>[{:name=>:rval, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CONTACTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Contact=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Contact.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cell_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fax_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:title, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:work_phone, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseContact"}, :ContactError=>{:fields=>[{:name=>:reason, :type=>"ContactError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContactPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Contact", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseContact=>{:fields=>[]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"Contact.Status"=>{:fields=>[]}, :"ContactError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CONTACTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONTACTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONTACTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONTACTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ContactServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_bundle_service.rb b/dfp_api/lib/dfp_api/v201802/content_bundle_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/content_bundle_service.rb rename to dfp_api/lib/dfp_api/v201802/content_bundle_service.rb index 00214fd7d..439572d5e --- a/dfp_api/lib/dfp_api/v201702/content_bundle_service.rb +++ b/dfp_api/lib/dfp_api/v201802/content_bundle_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:57. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:41. require 'ads_common/savon_service' -require 'dfp_api/v201702/content_bundle_service_registry' +require 'dfp_api/v201802/content_bundle_service_registry' -module DfpApi; module V201702; module ContentBundleService +module DfpApi; module V201802; module ContentBundleService class ContentBundleService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_content_bundles(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ContentBundleService + return DfpApi::V201802::ContentBundleService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/content_bundle_service_registry.rb b/dfp_api/lib/dfp_api/v201802/content_bundle_service_registry.rb new file mode 100644 index 000000000..7b79b0dad --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/content_bundle_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:41. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ContentBundleService + class ContentBundleServiceRegistry + CONTENTBUNDLESERVICE_METHODS = {:create_content_bundles=>{:input=>[{:name=>:content_bundles, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_content_bundles_response", :fields=>[{:name=>:rval, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_content_bundles_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_bundles_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentBundlePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_content_bundle_action=>{:input=>[{:name=>:content_bundle_action, :type=>"ContentBundleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_content_bundle_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_content_bundles=>{:input=>[{:name=>:content_bundles, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_content_bundles_response", :fields=>[{:name=>:rval, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CONTENTBUNDLESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateContentBundles=>{:fields=>[], :base=>"ContentBundleAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundleAction=>{:fields=>[], :abstract=>true}, :ContentBundle=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ContentBundleStatus", :min_occurs=>0, :max_occurs=>1}]}, :ContentBundlePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ContentBundle", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateContentBundles=>{:fields=>[], :base=>"ContentBundleAction"}, :ExcludeContentFromContentBundle=>{:fields=>[{:name=>:content_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :base=>"ContentBundleAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :IncludeContentInContentBundle=>{:fields=>[{:name=>:content_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :base=>"ContentBundleAction"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementError=>{:fields=>[{:name=>:reason, :type=>"PlacementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ContentBundleStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PlacementError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CONTENTBUNDLESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONTENTBUNDLESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONTENTBUNDLESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONTENTBUNDLESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ContentBundleServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service.rb b/dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service.rb old mode 100755 new mode 100644 similarity index 82% rename from dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service.rb rename to dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service.rb index 86d1418cc..d8ca3ae22 --- a/dfp_api/lib/dfp_api/v201702/content_metadata_key_hierarchy_service.rb +++ b/dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:57. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:41. require 'ads_common/savon_service' -require 'dfp_api/v201702/content_metadata_key_hierarchy_service_registry' +require 'dfp_api/v201802/content_metadata_key_hierarchy_service_registry' -module DfpApi; module V201702; module ContentMetadataKeyHierarchyService +module DfpApi; module V201802; module ContentMetadataKeyHierarchyService class ContentMetadataKeyHierarchyService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_content_metadata_key_hierarchies(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ContentMetadataKeyHierarchyService + return DfpApi::V201802::ContentMetadataKeyHierarchyService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service_registry.rb b/dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service_registry.rb new file mode 100644 index 000000000..396f54a45 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/content_metadata_key_hierarchy_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:41. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ContentMetadataKeyHierarchyService + class ContentMetadataKeyHierarchyServiceRegistry + CONTENTMETADATAKEYHIERARCHYSERVICE_METHODS = {:create_content_metadata_key_hierarchies=>{:input=>[{:name=>:content_metadata_key_hierarchies, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_content_metadata_key_hierarchies_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_content_metadata_key_hierarchies_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_metadata_key_hierarchies_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchyPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_content_metadata_key_hierarchy_action=>{:input=>[{:name=>:content_metadata_key_hierarchy_action, :type=>"ContentMetadataKeyHierarchyAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_content_metadata_key_hierarchy_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_content_metadata_key_hierarchies=>{:input=>[{:name=>:content_metadata_key_hierarchies, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_content_metadata_key_hierarchies_response", :fields=>[{:name=>:rval, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CONTENTMETADATAKEYHIERARCHYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyAction=>{:fields=>[], :abstract=>true}, :ContentMetadataKeyHierarchy=>{:fields=>[{:name=>:id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:hierarchy_levels, :type=>"ContentMetadataKeyHierarchyLevel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"ContentMetadataKeyHierarchyStatus", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataKeyHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyLevel=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:hierarchy_level, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ContentMetadataKeyHierarchy", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteContentMetadataKeyHierarchies=>{:fields=>[], :base=>"ContentMetadataKeyHierarchyAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ContentMetadataKeyHierarchyError.Reason"=>{:fields=>[]}, :ContentMetadataKeyHierarchyStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CONTENTMETADATAKEYHIERARCHYSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONTENTMETADATAKEYHIERARCHYSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONTENTMETADATAKEYHIERARCHYSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONTENTMETADATAKEYHIERARCHYSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ContentMetadataKeyHierarchyServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/content_service.rb b/dfp_api/lib/dfp_api/v201802/content_service.rb old mode 100755 new mode 100644 similarity index 76% rename from dfp_api/lib/dfp_api/v201702/content_service.rb rename to dfp_api/lib/dfp_api/v201802/content_service.rb index 36ab1ee21..2cf38abb7 --- a/dfp_api/lib/dfp_api/v201702/content_service.rb +++ b/dfp_api/lib/dfp_api/v201802/content_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:16:59. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:42. require 'ads_common/savon_service' -require 'dfp_api/v201702/content_service_registry' +require 'dfp_api/v201802/content_service_registry' -module DfpApi; module V201702; module ContentService +module DfpApi; module V201802; module ContentService class ContentService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_content_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ContentService + return DfpApi::V201802::ContentService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/content_service_registry.rb b/dfp_api/lib/dfp_api/v201802/content_service_registry.rb new file mode 100644 index 000000000..b93bf8436 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/content_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:42. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ContentService + class ContentServiceRegistry + CONTENTSERVICE_METHODS = {:get_content_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_by_statement_response", :fields=>[{:name=>:rval, :type=>"ContentPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_content_by_statement_and_custom_targeting_value=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_content_by_statement_and_custom_targeting_value_response", :fields=>[{:name=>:rval, :type=>"ContentPage", :min_occurs=>0, :max_occurs=>1}]}}} + CONTENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CmsContent=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cms_content_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Content=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ContentStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:status_defined_by, :type=>"ContentStatusDefinedBy", :min_occurs=>0, :max_occurs=>1}, {:name=>:hls_ingest_status, :type=>"DaiIngestStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:hls_ingest_errors, :type=>"DaiIngestError", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_hls_ingest_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:dash_ingest_status, :type=>"DaiIngestStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:dash_ingest_errors, :type=>"DaiIngestError", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_dash_ingest_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:import_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_defined_custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mapping_rule_defined_custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:cms_sources, :type=>"CmsContent", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Content", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DaiIngestError=>{:fields=>[{:name=>:reason, :type=>"DaiIngestErrorReason", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ContentStatus=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :ContentStatusDefinedBy=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :DaiIngestErrorReason=>{:fields=>[]}, :DaiIngestStatus=>{:fields=>[]}} + CONTENTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONTENTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONTENTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONTENTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ContentServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_service.rb b/dfp_api/lib/dfp_api/v201802/creative_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/creative_service.rb rename to dfp_api/lib/dfp_api/v201802/creative_service.rb index 4a7e562a1..4123f9cc4 --- a/dfp_api/lib/dfp_api/v201702/creative_service.rb +++ b/dfp_api/lib/dfp_api/v201802/creative_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:00. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:43. require 'ads_common/savon_service' -require 'dfp_api/v201702/creative_service_registry' +require 'dfp_api/v201802/creative_service_registry' -module DfpApi; module V201702; module CreativeService +module DfpApi; module V201802; module CreativeService class CreativeService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_creatives(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CreativeService + return DfpApi::V201802::CreativeService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/creative_service_registry.rb b/dfp_api/lib/dfp_api/v201802/creative_service_registry.rb new file mode 100644 index 000000000..4053cc093 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/creative_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:43. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CreativeService + class CreativeServiceRegistry + CREATIVESERVICE_METHODS = {:create_creatives=>{:input=>[{:name=>:creatives, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_creatives_response", :fields=>[{:name=>:rval, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_creatives_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creatives_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativePage", :min_occurs=>0, :max_occurs=>1}]}}, :update_creatives=>{:input=>[{:name=>:creatives, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_creatives_response", :fields=>[{:name=>:rval, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CREATIVESERVICE_TYPES = {:BaseDynamicAllocationCreative=>{:fields=>[], :abstract=>true, :base=>"Creative"}, :BaseCreativeTemplateVariableValue=>{:fields=>[{:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdExchangeCreative=>{:fields=>[{:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"HasHtmlSnippetDynamicAllocationCreative"}, :AdMobBackfillCreative=>{:fields=>[{:name=>:additional_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:publisher_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseDynamicAllocationCreative"}, :AdSenseCreative=>{:fields=>[], :base=>"HasHtmlSnippetDynamicAllocationCreative"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AspectRatioImageCreative=>{:fields=>[{:name=>:image_assets, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"HasDestinationUrlCreative"}, :AssetCreativeTemplateVariableValue=>{:fields=>[{:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :Asset=>{:fields=>[], :abstract=>true}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseFlashCreative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tag_required, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_image_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseFlashRedirectCreative=>{:fields=>[{:name=>:flash_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fallback_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseImageCreative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_image_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseImageRedirectCreative=>{:fields=>[{:name=>:image_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BaseRichMediaStudioCreative=>{:fields=>[{:name=>:studio_creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_format, :type=>"RichMediaStudioCreativeFormat", :min_occurs=>0, :max_occurs=>1}, {:name=>:artwork_type, :type=>"RichMediaStudioCreativeArtworkType", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_tag_keys, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_key_values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:survey_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:all_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:backup_image_impressions_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_css, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:required_flash_plugin_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_attribute, :type=>"RichMediaStudioCreativeBillingAttribute", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_studio_child_asset_properties, :type=>"RichMediaStudioChildAssetProperty", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Creative"}, :BaseVideoCreative=>{:fields=>[{:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_duration_override, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:skippable_ad_type, :type=>"SkippableAdType", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTag=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ClickTrackingCreative=>{:fields=>[{:name=>:click_tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConversionEvent_TrackingUrlsMapEntry=>{:fields=>[{:name=>:key, :type=>"ConversionEvent", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"TrackingUrls", :min_occurs=>0, :max_occurs=>1}]}, :CreativeAsset=>{:fields=>[{:name=>:asset_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_byte_array, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tags, :type=>"ClickTag", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:image_density, :type=>"ImageDensity", :min_occurs=>0, :max_occurs=>1}]}, :CustomCreativeAsset=>{:fields=>[{:name=>:macro_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}]}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Creative=>{:fields=>[{:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:policy_violations, :type=>"CreativePolicyViolation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}], :abstract=>true}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreative=>{:fields=>[{:name=>:html_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_creative_assets, :type=>"CustomCreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_tracking_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"HasDestinationUrlCreative"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FlashCreative=>{:fields=>[{:name=>:swiffy_asset, :type=>"SwiffyFallbackAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:create_swiffy_asset, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_tag_overlay_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashCreative"}, :FlashOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:api_framework, :type=>"ApiFramework", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashCreative"}, :FlashRedirectCreative=>{:fields=>[], :base=>"BaseFlashRedirectCreative"}, :FlashRedirectOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:api_framework, :type=>"ApiFramework", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:flash_asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseFlashRedirectCreative"}, :HasDestinationUrlCreative=>{:fields=>[{:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url_type, :type=>"DestinationUrlType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Creative"}, :HasHtmlSnippetDynamicAllocationCreative=>{:fields=>[{:name=>:code_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"BaseDynamicAllocationCreative"}, :Html5Creative=>{:fields=>[{:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_tracking_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:third_party_click_tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:html5_asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageCreative=>{:fields=>[{:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_image_assets, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageCreative"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageOverlayCreative=>{:fields=>[{:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageCreative"}, :ImageRedirectCreative=>{:fields=>[{:name=>:alt_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageRedirectCreative"}, :ImageRedirectOverlayCreative=>{:fields=>[{:name=>:asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_parameters, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseImageRedirectCreative"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalRedirectCreative=>{:fields=>[{:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:asset_size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_redirect_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:override_size, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_tracking_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Creative"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LegacyDfpCreative=>{:fields=>[], :base=>"Creative"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LongCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticCreative=>{:fields=>[{:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RedirectAsset=>{:fields=>[{:name=>:redirect_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"Asset"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioChildAssetProperty=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"RichMediaStudioChildAssetProperty.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :RichMediaStudioCreative=>{:fields=>[{:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseRichMediaStudioCreative"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreative=>{:fields=>[{:name=>:external_asset_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:availability_region_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:license_window_start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:license_window_end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseVideoCreative"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SwiffyFallbackAsset=>{:fields=>[{:name=>:asset, :type=>"CreativeAsset", :min_occurs=>0, :max_occurs=>1}, {:name=>:html5_features, :type=>"Html5Feature", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:localized_info_messages, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TemplateCreative=>{:fields=>[{:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_variable_values, :type=>"BaseCreativeTemplateVariableValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ThirdPartyCreative=>{:fields=>[{:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:expanded_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}, {:name=>:locked_orientation, :type=>"LockedOrientation", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_impression_tracking_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Creative"}, :TrackingUrls=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnsupportedCreative=>{:fields=>[{:name=>:unsupported_creative_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :UrlCreativeTemplateVariableValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCreativeTemplateVariableValue"}, :Value=>{:fields=>[], :abstract=>true}, :VastRedirectCreative=>{:fields=>[{:name=>:vast_xml_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:vast_redirect_type, :type=>"VastRedirectType", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_urls, :type=>"ConversionEvent_TrackingUrlsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:vast_preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_scan_result, :type=>"SslScanResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:ssl_manual_override, :type=>"SslManualOverride", :min_occurs=>0, :max_occurs=>1}], :base=>"Creative"}, :VideoCreative=>{:fields=>[], :base=>"BaseVideoCreative"}, :VideoMetadata=>{:fields=>[{:name=>:scalable_type, :type=>"ScalableType", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minimum_bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:maximum_bit_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:mime_type, :type=>"MimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_type, :type=>"VideoDeliveryType", :min_occurs=>0, :max_occurs=>1}, {:name=>:codecs, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoRedirectAsset=>{:fields=>[{:name=>:metadata, :type=>"VideoMetadata", :min_occurs=>0, :max_occurs=>1}], :base=>"RedirectAsset"}, :VideoRedirectCreative=>{:fields=>[{:name=>:video_assets, :type=>"VideoRedirectAsset", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mezzanine_file, :type=>"VideoRedirectAsset", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseVideoCreative"}, :ApiFramework=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ConversionEvent=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativePolicyViolation=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :DestinationUrlType=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :Html5Feature=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :ImageDensity=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LockedOrientation=>{:fields=>[]}, :MimeType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioChildAssetProperty.Type"=>{:fields=>[]}, :RichMediaStudioCreativeArtworkType=>{:fields=>[]}, :RichMediaStudioCreativeBillingAttribute=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :RichMediaStudioCreativeFormat=>{:fields=>[]}, :ScalableType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :SkippableAdType=>{:fields=>[]}, :SslManualOverride=>{:fields=>[]}, :SslScanResult=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}, :VastRedirectType=>{:fields=>[]}, :VideoDeliveryType=>{:fields=>[]}} + CREATIVESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CREATIVESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CREATIVESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CREATIVESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CreativeServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_set_service.rb b/dfp_api/lib/dfp_api/v201802/creative_set_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/creative_set_service.rb rename to dfp_api/lib/dfp_api/v201802/creative_set_service.rb index 8916166a8..508f4fb17 --- a/dfp_api/lib/dfp_api/v201702/creative_set_service.rb +++ b/dfp_api/lib/dfp_api/v201802/creative_set_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:02. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:44. require 'ads_common/savon_service' -require 'dfp_api/v201702/creative_set_service_registry' +require 'dfp_api/v201802/creative_set_service_registry' -module DfpApi; module V201702; module CreativeSetService +module DfpApi; module V201802; module CreativeSetService class CreativeSetService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_creative_set(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CreativeSetService + return DfpApi::V201802::CreativeSetService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/creative_set_service_registry.rb b/dfp_api/lib/dfp_api/v201802/creative_set_service_registry.rb new file mode 100644 index 000000000..8174fcac3 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/creative_set_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:44. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CreativeSetService + class CreativeSetServiceRegistry + CREATIVESETSERVICE_METHODS = {:create_creative_set=>{:input=>[{:name=>:creative_set, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"create_creative_set_response", :fields=>[{:name=>:rval, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}]}}, :get_creative_sets_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_sets_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeSetPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_creative_set=>{:input=>[{:name=>:creative_set, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"update_creative_set_response", :fields=>[{:name=>:rval, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>1}]}}} + CREATIVESETSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSet=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:master_creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_creative_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSetPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeSet", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}} + CREATIVESETSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CREATIVESETSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CREATIVESETSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CREATIVESETSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CreativeSetServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_template_service.rb b/dfp_api/lib/dfp_api/v201802/creative_template_service.rb old mode 100755 new mode 100644 similarity index 68% rename from dfp_api/lib/dfp_api/v201702/creative_template_service.rb rename to dfp_api/lib/dfp_api/v201802/creative_template_service.rb index fccb470d9..e506c3228 --- a/dfp_api/lib/dfp_api/v201702/creative_template_service.rb +++ b/dfp_api/lib/dfp_api/v201802/creative_template_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:03. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:45. require 'ads_common/savon_service' -require 'dfp_api/v201702/creative_template_service_registry' +require 'dfp_api/v201802/creative_template_service_registry' -module DfpApi; module V201702; module CreativeTemplateService +module DfpApi; module V201802; module CreativeTemplateService class CreativeTemplateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_creative_templates_by_statement(*args, &block) @@ -32,7 +32,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CreativeTemplateService + return DfpApi::V201802::CreativeTemplateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/creative_template_service_registry.rb b/dfp_api/lib/dfp_api/v201802/creative_template_service_registry.rb new file mode 100644 index 000000000..deac5f2d1 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/creative_template_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:45. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CreativeTemplateService + class CreativeTemplateServiceRegistry + CREATIVETEMPLATESERVICE_METHODS = {:get_creative_templates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}} + CREATIVETEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AssetCreativeTemplateVariable=>{:fields=>[{:name=>:mime_types, :type=>"AssetCreativeTemplateVariable.MimeType", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CreativeTemplateVariable"}, :CreativeTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:variables, :type=>"CreativeTemplateVariable", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CreativeTemplateStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"CreativeTemplateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_interstitial, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_native_eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_safe_frame_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ListStringCreativeTemplateVariable=>{:fields=>[{:name=>:choices, :type=>"ListStringCreativeTemplateVariable.VariableChoice", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_other_choice, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"StringCreativeTemplateVariable"}, :"ListStringCreativeTemplateVariable.VariableChoice"=>{:fields=>[{:name=>:label, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LongCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StringCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :UrlCreativeTemplateVariable=>{:fields=>[{:name=>:default_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_tracking_url, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"CreativeTemplateVariable"}, :CreativeTemplateVariable=>{:fields=>[{:name=>:label, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_required, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"AssetCreativeTemplateVariable.MimeType"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :CreativeTemplateStatus=>{:fields=>[]}, :CreativeTemplateType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CREATIVETEMPLATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CREATIVETEMPLATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CREATIVETEMPLATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CREATIVETEMPLATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CreativeTemplateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/creative_wrapper_service.rb b/dfp_api/lib/dfp_api/v201802/creative_wrapper_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/creative_wrapper_service.rb rename to dfp_api/lib/dfp_api/v201802/creative_wrapper_service.rb index 44f5adda7..1a0d364b9 --- a/dfp_api/lib/dfp_api/v201702/creative_wrapper_service.rb +++ b/dfp_api/lib/dfp_api/v201802/creative_wrapper_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:04. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:45. require 'ads_common/savon_service' -require 'dfp_api/v201702/creative_wrapper_service_registry' +require 'dfp_api/v201802/creative_wrapper_service_registry' -module DfpApi; module V201702; module CreativeWrapperService +module DfpApi; module V201802; module CreativeWrapperService class CreativeWrapperService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_creative_wrappers(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CreativeWrapperService + return DfpApi::V201802::CreativeWrapperService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/creative_wrapper_service_registry.rb b/dfp_api/lib/dfp_api/v201802/creative_wrapper_service_registry.rb new file mode 100644 index 000000000..d6fc7bb11 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/creative_wrapper_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:45. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CreativeWrapperService + class CreativeWrapperServiceRegistry + CREATIVEWRAPPERSERVICE_METHODS = {:create_creative_wrappers=>{:input=>[{:name=>:creative_wrappers, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_creative_wrappers_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_creative_wrappers_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_creative_wrappers_by_statement_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapperPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_creative_wrapper_action=>{:input=>[{:name=>:creative_wrapper_action, :type=>"CreativeWrapperAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_creative_wrapper_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_creative_wrappers=>{:input=>[{:name=>:creative_wrappers, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_creative_wrappers_response", :fields=>[{:name=>:rval, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CREATIVEWRAPPERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCreativeWrappers=>{:fields=>[], :base=>"CreativeWrapperAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperAction=>{:fields=>[], :abstract=>true}, :CreativeWrapper=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:html_header, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:html_footer, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:amp_head, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:amp_body, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ordering, :type=>"CreativeWrapperOrdering", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CreativeWrapperStatus", :min_occurs=>0, :max_occurs=>1}]}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CreativeWrapper", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateCreativeWrappers=>{:fields=>[], :base=>"CreativeWrapperAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelError=>{:fields=>[{:name=>:reason, :type=>"LabelError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :CreativeWrapperOrdering=>{:fields=>[]}, :CreativeWrapperStatus=>{:fields=>[]}, :"LabelError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CREATIVEWRAPPERSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CREATIVEWRAPPERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CREATIVEWRAPPERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CREATIVEWRAPPERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CreativeWrapperServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/custom_field_service.rb b/dfp_api/lib/dfp_api/v201802/custom_field_service.rb old mode 100755 new mode 100644 similarity index 86% rename from dfp_api/lib/dfp_api/v201702/custom_field_service.rb rename to dfp_api/lib/dfp_api/v201802/custom_field_service.rb index fb1e7334d..195a19d37 --- a/dfp_api/lib/dfp_api/v201702/custom_field_service.rb +++ b/dfp_api/lib/dfp_api/v201802/custom_field_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:06. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:46. require 'ads_common/savon_service' -require 'dfp_api/v201702/custom_field_service_registry' +require 'dfp_api/v201802/custom_field_service_registry' -module DfpApi; module V201702; module CustomFieldService +module DfpApi; module V201802; module CustomFieldService class CustomFieldService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_custom_field_options(*args, &block) @@ -80,7 +80,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CustomFieldService + return DfpApi::V201802::CustomFieldService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/custom_field_service_registry.rb b/dfp_api/lib/dfp_api/v201802/custom_field_service_registry.rb new file mode 100644 index 000000000..7eec2f774 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/custom_field_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:46. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CustomFieldService + class CustomFieldServiceRegistry + CUSTOMFIELDSERVICE_METHODS = {:create_custom_field_options=>{:input=>[{:name=>:custom_field_options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_field_options_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :create_custom_fields=>{:input=>[{:name=>:custom_fields, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_fields_response", :fields=>[{:name=>:rval, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_custom_field_option=>{:input=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_field_option_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>1}]}}, :get_custom_fields_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_fields_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomFieldPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_field_action=>{:input=>[{:name=>:custom_field_action, :type=>"CustomFieldAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_field_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_custom_field_options=>{:input=>[{:name=>:custom_field_options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_field_options_response", :fields=>[{:name=>:rval, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_custom_fields=>{:input=>[{:name=>:custom_fields, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_fields_response", :fields=>[{:name=>:rval, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CUSTOMFIELDSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCustomFields=>{:fields=>[], :base=>"CustomFieldAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldAction=>{:fields=>[]}, :CustomField=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_type, :type=>"CustomFieldEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:data_type, :type=>"CustomFieldDataType", :min_occurs=>0, :max_occurs=>1}, {:name=>:visibility, :type=>"CustomFieldVisibility", :min_occurs=>0, :max_occurs=>1}]}, :CustomFieldError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldOption=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomFieldPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomField", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateCustomFields=>{:fields=>[], :base=>"CustomFieldAction"}, :DropDownCustomField=>{:fields=>[{:name=>:options, :type=>"CustomFieldOption", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomField"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CustomFieldDataType=>{:fields=>[]}, :CustomFieldEntityType=>{:fields=>[]}, :"CustomFieldError.Reason"=>{:fields=>[]}, :CustomFieldVisibility=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CUSTOMFIELDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CUSTOMFIELDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMFIELDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMFIELDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomFieldServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/custom_targeting_service.rb b/dfp_api/lib/dfp_api/v201802/custom_targeting_service.rb old mode 100755 new mode 100644 similarity index 88% rename from dfp_api/lib/dfp_api/v201702/custom_targeting_service.rb rename to dfp_api/lib/dfp_api/v201802/custom_targeting_service.rb index 81802ccf6..8f388c519 --- a/dfp_api/lib/dfp_api/v201702/custom_targeting_service.rb +++ b/dfp_api/lib/dfp_api/v201802/custom_targeting_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:07. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:46. require 'ads_common/savon_service' -require 'dfp_api/v201702/custom_targeting_service_registry' +require 'dfp_api/v201802/custom_targeting_service_registry' -module DfpApi; module V201702; module CustomTargetingService +module DfpApi; module V201802; module CustomTargetingService class CustomTargetingService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_custom_targeting_keys(*args, &block) @@ -88,7 +88,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::CustomTargetingService + return DfpApi::V201802::CustomTargetingService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/custom_targeting_service_registry.rb b/dfp_api/lib/dfp_api/v201802/custom_targeting_service_registry.rb new file mode 100644 index 000000000..616532436 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/custom_targeting_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:46. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module CustomTargetingService + class CustomTargetingServiceRegistry + CUSTOMTARGETINGSERVICE_METHODS = {:create_custom_targeting_keys=>{:input=>[{:name=>:keys, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_targeting_keys_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :create_custom_targeting_values=>{:input=>[{:name=>:values, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_custom_targeting_values_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_custom_targeting_keys_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_targeting_keys_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKeyPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_custom_targeting_values_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_custom_targeting_values_by_statement_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValuePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_targeting_key_action=>{:input=>[{:name=>:custom_targeting_key_action, :type=>"CustomTargetingKeyAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_targeting_key_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :perform_custom_targeting_value_action=>{:input=>[{:name=>:custom_targeting_value_action, :type=>"CustomTargetingValueAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_custom_targeting_value_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_custom_targeting_keys=>{:input=>[{:name=>:keys, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_targeting_keys_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_custom_targeting_values=>{:input=>[{:name=>:values, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_custom_targeting_values_response", :fields=>[{:name=>:rval, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CUSTOMTARGETINGSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateCustomTargetingKeys=>{:fields=>[], :base=>"CustomTargetingKeyAction"}, :ActivateCustomTargetingValues=>{:fields=>[], :base=>"CustomTargetingValueAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingKeyAction=>{:fields=>[], :abstract=>true}, :CustomTargetingKey=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"CustomTargetingKey.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CustomTargetingKey.Status", :min_occurs=>0, :max_occurs=>1}]}, :CustomTargetingKeyPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomTargetingKey", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomTargetingValueAction=>{:fields=>[], :abstract=>true}, :CustomTargetingValue=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"CustomTargetingValue.MatchType", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CustomTargetingValue.Status", :min_occurs=>0, :max_occurs=>1}]}, :CustomTargetingValuePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"CustomTargetingValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteCustomTargetingKeys=>{:fields=>[], :base=>"CustomTargetingKeyAction"}, :DeleteCustomTargetingValues=>{:fields=>[], :base=>"CustomTargetingValueAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"CustomTargetingKey.Status"=>{:fields=>[]}, :"CustomTargetingKey.Type"=>{:fields=>[]}, :"CustomTargetingValue.MatchType"=>{:fields=>[]}, :"CustomTargetingValue.Status"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CUSTOMTARGETINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CUSTOMTARGETINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMTARGETINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMTARGETINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomTargetingServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/exchange_rate_service.rb b/dfp_api/lib/dfp_api/v201802/exchange_rate_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/exchange_rate_service.rb rename to dfp_api/lib/dfp_api/v201802/exchange_rate_service.rb index aa21e2d39..f6a062a43 --- a/dfp_api/lib/dfp_api/v201702/exchange_rate_service.rb +++ b/dfp_api/lib/dfp_api/v201802/exchange_rate_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:09. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:47. require 'ads_common/savon_service' -require 'dfp_api/v201702/exchange_rate_service_registry' +require 'dfp_api/v201802/exchange_rate_service_registry' -module DfpApi; module V201702; module ExchangeRateService +module DfpApi; module V201802; module ExchangeRateService class ExchangeRateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_exchange_rates(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ExchangeRateService + return DfpApi::V201802::ExchangeRateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/exchange_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201802/exchange_rate_service_registry.rb new file mode 100644 index 000000000..1c9e219dc --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/exchange_rate_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:47. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ExchangeRateService + class ExchangeRateServiceRegistry + EXCHANGERATESERVICE_METHODS = {:create_exchange_rates=>{:input=>[{:name=>:exchange_rates, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_exchange_rates_response", :fields=>[{:name=>:rval, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_exchange_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_exchange_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"ExchangeRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_exchange_rate_action=>{:input=>[{:name=>:exchange_rate_action, :type=>"ExchangeRateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_exchange_rate_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_exchange_rates=>{:input=>[{:name=>:exchange_rates, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_exchange_rates_response", :fields=>[{:name=>:rval, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + EXCHANGERATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteExchangeRates=>{:fields=>[], :base=>"ExchangeRateAction"}, :ExchangeRateAction=>{:fields=>[], :abstract=>true}, :ExchangeRate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_rate, :type=>"ExchangeRateRefreshRate", :min_occurs=>0, :max_occurs=>1}, {:name=>:direction, :type=>"ExchangeRateDirection", :min_occurs=>0, :max_occurs=>1}, {:name=>:exchange_rate, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRatePage=>{:fields=>[{:name=>:results, :type=>"ExchangeRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :ExchangeRateDirection=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :ExchangeRateRefreshRate=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + EXCHANGERATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return EXCHANGERATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return EXCHANGERATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return EXCHANGERATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ExchangeRateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/forecast_service.rb b/dfp_api/lib/dfp_api/v201802/forecast_service.rb old mode 100755 new mode 100644 similarity index 81% rename from dfp_api/lib/dfp_api/v201702/forecast_service.rb rename to dfp_api/lib/dfp_api/v201802/forecast_service.rb index dff00bd2a..7eab47b95 --- a/dfp_api/lib/dfp_api/v201702/forecast_service.rb +++ b/dfp_api/lib/dfp_api/v201802/forecast_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:10. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:48. require 'ads_common/savon_service' -require 'dfp_api/v201702/forecast_service_registry' +require 'dfp_api/v201802/forecast_service_registry' -module DfpApi; module V201702; module ForecastService +module DfpApi; module V201802; module ForecastService class ForecastService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_availability_forecast(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ForecastService + return DfpApi::V201802::ForecastService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/forecast_service_registry.rb b/dfp_api/lib/dfp_api/v201802/forecast_service_registry.rb new file mode 100644 index 000000000..73117184f --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/forecast_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:48. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ForecastService + class ForecastServiceRegistry + FORECASTSERVICE_METHODS = {:get_availability_forecast=>{:input=>[{:name=>:line_item, :type=>"ProspectiveLineItem", :min_occurs=>0, :max_occurs=>1}, {:name=>:forecast_options, :type=>"AvailabilityForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_availability_forecast_response", :fields=>[{:name=>:rval, :type=>"AvailabilityForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_availability_forecast_by_id=>{:input=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:forecast_options, :type=>"AvailabilityForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_availability_forecast_by_id_response", :fields=>[{:name=>:rval, :type=>"AvailabilityForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_delivery_forecast=>{:input=>[{:name=>:line_items, :type=>"ProspectiveLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forecast_options, :type=>"DeliveryForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_delivery_forecast_response", :fields=>[{:name=>:rval, :type=>"DeliveryForecast", :min_occurs=>0, :max_occurs=>1}]}}, :get_delivery_forecast_by_ids=>{:input=>[{:name=>:line_item_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forecast_options, :type=>"DeliveryForecastOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_delivery_forecast_by_ids_response", :fields=>[{:name=>:rval, :type=>"DeliveryForecast", :min_occurs=>0, :max_occurs=>1}]}}} + FORECASTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdRuleSlotError=>{:fields=>[{:name=>:reason, :type=>"AdRuleSlotError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AlternativeUnitTypeForecast=>{:fields=>[{:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:possible_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailabilityForecast=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivered_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:possible_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserved_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_breakdowns, :type=>"TargetingCriteriaBreakdown", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:contending_line_items, :type=>"ContendingLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:alternative_unit_type_forecasts, :type=>"AlternativeUnitTypeForecast", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:demographic_breakdowns, :type=>"GrpDemographicBreakdown", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AvailabilityForecastOptions=>{:fields=>[{:name=>:include_targeting_criteria_breakdown, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_contending_line_items, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContendingLineItem=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contending_impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTargeting=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryForecastOptions=>{:fields=>[{:name=>:ignored_line_item_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryForecast=>{:fields=>[{:name=>:line_item_delivery_forecasts, :type=>"LineItemDeliveryForecast", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpDemographicBreakdown=>{:fields=>[{:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"GrpUnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:gender, :type=>"GrpGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:age, :type=>"GrpAge", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettings=>{:fields=>[{:name=>:min_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_gender, :type=>"GrpTargetGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider, :type=>"GrpProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_impression_goal, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociation=>{:fields=>[{:name=>:activity_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:view_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemDeliveryForecast=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:predicted_delivery_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivered_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :LineItem=>{:fields=>[{:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_targetings, :type=>"CreativeTargeting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"LineItemSummary"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemSummary=>{:fields=>[{:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:auto_extension_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_type, :type=>"CostType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount_type, :type=>"LineItemDiscountType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:activity_associations, :type=>"LineItemActivityAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_cross_selling_rule_warning_checks, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserve_at_creation, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"LineItemSummary.ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:web_property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_prioritized_preferred_deals_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_exchange_auction_opening_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_missing_creatives, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:set_top_box_display_info, :type=>"SetTopBoxInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:programmatic_creative_source, :type=>"ProgrammaticCreativeSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_goals, :type=>"Goal", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:grp_settings, :type=>"GrpSettings", :min_occurs=>0, :max_occurs=>1}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProspectiveLineItem=>{:fields=>[{:name=>:line_item, :type=>"LineItem", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxInfo=>{:fields=>[{:name=>:sync_status, :type=>"SetTopBoxSyncStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_result, :type=>"CanoeSyncResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_canoe_response_message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:nielsen_product_category_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TargetingCriteriaBreakdown=>{:fields=>[{:name=>:targeting_dimension, :type=>"TargetingDimension", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_criteria_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:excluded, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:available_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matched_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdRuleSlotError.Reason"=>{:fields=>[]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :CanoeSyncResult=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostType=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :GrpAge=>{:fields=>[]}, :GrpGender=>{:fields=>[]}, :GrpProvider=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :GrpTargetGender=>{:fields=>[]}, :GrpUnitType=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LineItemDiscountType=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"LineItemSummary.ReservationStatus"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :ProgrammaticCreativeSource=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :SetTopBoxSyncStatus=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TargetingDimension=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + FORECASTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return FORECASTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return FORECASTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return FORECASTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ForecastServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/inventory_service.rb b/dfp_api/lib/dfp_api/v201802/inventory_service.rb old mode 100755 new mode 100644 similarity index 82% rename from dfp_api/lib/dfp_api/v201702/inventory_service.rb rename to dfp_api/lib/dfp_api/v201802/inventory_service.rb index c7ad87cc7..da1feacda --- a/dfp_api/lib/dfp_api/v201702/inventory_service.rb +++ b/dfp_api/lib/dfp_api/v201802/inventory_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:13. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:50. require 'ads_common/savon_service' -require 'dfp_api/v201702/inventory_service_registry' +require 'dfp_api/v201802/inventory_service_registry' -module DfpApi; module V201702; module InventoryService +module DfpApi; module V201802; module InventoryService class InventoryService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_ad_units(*args, &block) @@ -64,7 +64,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::InventoryService + return DfpApi::V201802::InventoryService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/inventory_service_registry.rb b/dfp_api/lib/dfp_api/v201802/inventory_service_registry.rb new file mode 100644 index 000000000..d14f12763 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/inventory_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:50. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module InventoryService + class InventoryServiceRegistry + INVENTORYSERVICE_METHODS = {:create_ad_units=>{:input=>[{:name=>:ad_units, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_ad_units_response", :fields=>[{:name=>:rval, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_unit_sizes_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_unit_sizes_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_ad_units_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_units_by_statement_response", :fields=>[{:name=>:rval, :type=>"AdUnitPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_ad_unit_action=>{:input=>[{:name=>:ad_unit_action, :type=>"AdUnitAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_ad_unit_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_ad_units=>{:input=>[{:name=>:ad_units, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_ad_units_response", :fields=>[{:name=>:rval, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + INVENTORYSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :AdSenseAccountError=>{:fields=>[{:name=>:reason, :type=>"AdSenseAccountError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdSenseSettings=>{:fields=>[{:name=>:ad_sense_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:border_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:title_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:background_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:text_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_type, :type=>"AdSenseSettings.AdType", :min_occurs=>0, :max_occurs=>1}, {:name=>:border_style, :type=>"AdSenseSettings.BorderStyle", :min_occurs=>0, :max_occurs=>1}, {:name=>:font_family, :type=>"AdSenseSettings.FontFamily", :min_occurs=>0, :max_occurs=>1}, {:name=>:font_size, :type=>"AdSenseSettings.FontSize", :min_occurs=>0, :max_occurs=>1}]}, :AdUnitAction=>{:fields=>[], :abstract=>true}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnit=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_children, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_path, :type=>"AdUnitParent", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_window, :type=>"AdUnit.TargetWindow", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"InventoryStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_sizes, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_fluid, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:explicitly_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_sense_settings, :type=>"AdSenseSettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_sense_settings_source, :type=>"ValueSourceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_label_frequency_caps, :type=>"LabelFrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_label_frequency_caps, :type=>"LabelFrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:smart_size_mode, :type=>"SmartSizeMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_rate, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_set_top_box_channel_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AdUnitHierarchyError=>{:fields=>[{:name=>:reason, :type=>"AdUnitHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"AdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdUnitParent=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyError=>{:fields=>[{:name=>:reason, :type=>"CompanyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateAdUnits=>{:fields=>[], :base=>"AdUnitAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidColorError=>{:fields=>[{:name=>:reason, :type=>"InvalidColorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitRefreshRateError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitRefreshRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitSize=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:full_display_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :InventoryUnitSizesError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitSizesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelFrequencyCap=>{:fields=>[{:name=>:frequency_cap, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdSenseAccountError.Reason"=>{:fields=>[]}, :"AdSenseSettings.AdType"=>{:fields=>[]}, :"AdSenseSettings.BorderStyle"=>{:fields=>[]}, :"AdSenseSettings.FontFamily"=>{:fields=>[]}, :"AdSenseSettings.FontSize"=>{:fields=>[]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"AdUnit.TargetWindow"=>{:fields=>[]}, :"AdUnitHierarchyError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidColorError.Reason"=>{:fields=>[]}, :InventoryStatus=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"InventoryUnitRefreshRateError.Reason"=>{:fields=>[]}, :"InventoryUnitSizesError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :ValueSourceType=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :SmartSizeMode=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}} + INVENTORYSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return INVENTORYSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return INVENTORYSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return INVENTORYSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, InventoryServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/label_service.rb b/dfp_api/lib/dfp_api/v201802/label_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/label_service.rb rename to dfp_api/lib/dfp_api/v201802/label_service.rb index 0a34ec8a0..8ea20dba0 --- a/dfp_api/lib/dfp_api/v201702/label_service.rb +++ b/dfp_api/lib/dfp_api/v201802/label_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:15. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:51. require 'ads_common/savon_service' -require 'dfp_api/v201702/label_service_registry' +require 'dfp_api/v201802/label_service_registry' -module DfpApi; module V201702; module LabelService +module DfpApi; module V201802; module LabelService class LabelService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_labels(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::LabelService + return DfpApi::V201802::LabelService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/label_service_registry.rb b/dfp_api/lib/dfp_api/v201802/label_service_registry.rb new file mode 100644 index 000000000..9df6a1dd5 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/label_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:51. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module LabelService + class LabelServiceRegistry + LABELSERVICE_METHODS = {:create_labels=>{:input=>[{:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_labels_response", :fields=>[{:name=>:rval, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_labels_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_labels_by_statement_response", :fields=>[{:name=>:rval, :type=>"LabelPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_label_action=>{:input=>[{:name=>:label_action, :type=>"LabelAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_label_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_labels=>{:input=>[{:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_labels_response", :fields=>[{:name=>:rval, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + LABELSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLabels=>{:fields=>[], :base=>"LabelAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeWrapperError=>{:fields=>[{:name=>:reason, :type=>"CreativeWrapperError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateLabels=>{:fields=>[], :base=>"LabelAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelAction=>{:fields=>[], :abstract=>true}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:types, :type=>"LabelType", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LabelError=>{:fields=>[{:name=>:reason, :type=>"LabelError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeWrapperError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"LabelError.Reason"=>{:fields=>[]}, :LabelType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + LABELSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LABELSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LABELSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LABELSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LabelServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/line_item_creative_association_service.rb b/dfp_api/lib/dfp_api/v201802/line_item_creative_association_service.rb old mode 100755 new mode 100644 similarity index 75% rename from dfp_api/lib/dfp_api/v201702/line_item_creative_association_service.rb rename to dfp_api/lib/dfp_api/v201802/line_item_creative_association_service.rb index c339befd1..a48242d1b --- a/dfp_api/lib/dfp_api/v201702/line_item_creative_association_service.rb +++ b/dfp_api/lib/dfp_api/v201802/line_item_creative_association_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:16. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:52. require 'ads_common/savon_service' -require 'dfp_api/v201702/line_item_creative_association_service_registry' +require 'dfp_api/v201802/line_item_creative_association_service_registry' -module DfpApi; module V201702; module LineItemCreativeAssociationService +module DfpApi; module V201802; module LineItemCreativeAssociationService class LineItemCreativeAssociationService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_line_item_creative_associations(*args, &block) @@ -41,6 +41,14 @@ def get_preview_url_to_xml(*args) return get_soap_xml('get_preview_url', args) end + def get_preview_urls_for_native_styles(*args, &block) + return execute_action('get_preview_urls_for_native_styles', args, &block) + end + + def get_preview_urls_for_native_styles_to_xml(*args) + return get_soap_xml('get_preview_urls_for_native_styles', args) + end + def perform_line_item_creative_association_action(*args, &block) return execute_action('perform_line_item_creative_association_action', args, &block) end @@ -64,7 +72,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::LineItemCreativeAssociationService + return DfpApi::V201802::LineItemCreativeAssociationService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/line_item_creative_association_service_registry.rb b/dfp_api/lib/dfp_api/v201802/line_item_creative_association_service_registry.rb old mode 100755 new mode 100644 similarity index 52% rename from dfp_api/lib/dfp_api/v201702/line_item_creative_association_service_registry.rb rename to dfp_api/lib/dfp_api/v201802/line_item_creative_association_service_registry.rb index 572a6daae..36fdc6361 --- a/dfp_api/lib/dfp_api/v201702/line_item_creative_association_service_registry.rb +++ b/dfp_api/lib/dfp_api/v201802/line_item_creative_association_service_registry.rb @@ -2,17 +2,17 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:16. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:52. require 'dfp_api/errors' -module DfpApi; module V201702; module LineItemCreativeAssociationService +module DfpApi; module V201802; module LineItemCreativeAssociationService class LineItemCreativeAssociationServiceRegistry - LINEITEMCREATIVEASSOCIATIONSERVICE_METHODS = {:create_line_item_creative_associations=>{:input=>[{:name=>:line_item_creative_associations, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_line_item_creative_associations_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_line_item_creative_associations_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_item_creative_associations_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociationPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_preview_url=>{:input=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:site_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_preview_url_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}}, :perform_line_item_creative_association_action=>{:input=>[{:name=>:line_item_creative_association_action, :type=>"LineItemCreativeAssociationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_line_item_creative_association_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_line_item_creative_associations=>{:input=>[{:name=>:line_item_creative_associations, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_line_item_creative_associations_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}} - LINEITEMCREATIVEASSOCIATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :AdSenseAccountError=>{:fields=>[{:name=>:reason, :type=>"AdSenseAccountError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePreviewError=>{:fields=>[{:name=>:reason, :type=>"CreativePreviewError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :DeleteLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationAction=>{:fields=>[], :abstract=>true}, :LineItemCreativeAssociation=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_creative_rotation_weight, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:sequential_creative_rotation_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sizes, :type=>"Size", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"LineItemCreativeAssociation.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"LineItemCreativeAssociationStats", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LineItemCreativeAssociationStats=>{:fields=>[{:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_set_stats, :type=>"Long_StatsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:cost_in_order_currency, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Long_StatsMapEntry=>{:fields=>[{:name=>:key, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdSenseAccountError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CreativePreviewError.Reason"=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociation.Status"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationOperationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}} + LINEITEMCREATIVEASSOCIATIONSERVICE_METHODS = {:create_line_item_creative_associations=>{:input=>[{:name=>:line_item_creative_associations, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_line_item_creative_associations_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_line_item_creative_associations_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_item_creative_associations_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociationPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_preview_url=>{:input=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:site_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_preview_url_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}}, :get_preview_urls_for_native_styles=>{:input=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:site_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_preview_urls_for_native_styles_response", :fields=>[{:name=>:rval, :type=>"CreativeNativeStylePreview", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :perform_line_item_creative_association_action=>{:input=>[{:name=>:line_item_creative_association_action, :type=>"LineItemCreativeAssociationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_line_item_creative_association_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_line_item_creative_associations=>{:input=>[{:name=>:line_item_creative_associations, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_line_item_creative_associations_response", :fields=>[{:name=>:rval, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + LINEITEMCREATIVEASSOCIATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :AdSenseAccountError=>{:fields=>[{:name=>:reason, :type=>"AdSenseAccountError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AssetError=>{:fields=>[{:name=>:reason, :type=>"AssetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeAssetMacroError=>{:fields=>[{:name=>:reason, :type=>"CreativeAssetMacroError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeNativeStylePreview=>{:fields=>[{:name=>:native_style_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:preview_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CreativePreviewError=>{:fields=>[{:name=>:reason, :type=>"CreativePreviewError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeSetError=>{:fields=>[{:name=>:reason, :type=>"CreativeSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeTemplateOperationError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCreativeError=>{:fields=>[{:name=>:reason, :type=>"CustomCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :DeleteLineItemCreativeAssociations=>{:fields=>[], :base=>"LineItemCreativeAssociationAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :HtmlBundleProcessorError=>{:fields=>[{:name=>:reason, :type=>"HtmlBundleProcessorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidPhoneNumberError=>{:fields=>[{:name=>:reason, :type=>"InvalidPhoneNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationAction=>{:fields=>[], :abstract=>true}, :LineItemCreativeAssociation=>{:fields=>[{:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_creative_rotation_weight, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:sequential_creative_rotation_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sizes, :type=>"Size", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"LineItemCreativeAssociation.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"LineItemCreativeAssociationStats", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItemCreativeAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LineItemCreativeAssociationStats=>{:fields=>[{:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_set_stats, :type=>"Long_StatsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:cost_in_order_currency, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Long_StatsMapEntry=>{:fields=>[{:name=>:key, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RichMediaStudioCreativeError=>{:fields=>[{:name=>:reason, :type=>"RichMediaStudioCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SwiffyConversionError=>{:fields=>[{:name=>:reason, :type=>"SwiffyConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"AdSenseAccountError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AssetError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeAssetMacroError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CreativePreviewError.Reason"=>{:fields=>[]}, :"CreativeSetError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CreativeTemplateOperationError.Reason"=>{:fields=>[]}, :"CustomCreativeError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"HtmlBundleProcessorError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidPhoneNumberError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociation.Status"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationOperationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"RichMediaStudioCreativeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"SwiffyConversionError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}} LINEITEMCREATIVEASSOCIATIONSERVICE_NAMESPACES = [] def self.get_method_signature(method_name) diff --git a/dfp_api/lib/dfp_api/v201702/line_item_service.rb b/dfp_api/lib/dfp_api/v201802/line_item_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/line_item_service.rb rename to dfp_api/lib/dfp_api/v201802/line_item_service.rb index ded4c56b0..65a63e2c5 --- a/dfp_api/lib/dfp_api/v201702/line_item_service.rb +++ b/dfp_api/lib/dfp_api/v201802/line_item_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:19. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:53. require 'ads_common/savon_service' -require 'dfp_api/v201702/line_item_service_registry' +require 'dfp_api/v201802/line_item_service_registry' -module DfpApi; module V201702; module LineItemService +module DfpApi; module V201802; module LineItemService class LineItemService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_line_items(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::LineItemService + return DfpApi::V201802::LineItemService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201802/line_item_service_registry.rb new file mode 100644 index 000000000..5e8413330 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/line_item_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:53. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module LineItemService + class LineItemServiceRegistry + LINEITEMSERVICE_METHODS = {:create_line_items=>{:input=>[{:name=>:line_items, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_line_items_response", :fields=>[{:name=>:rval, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_line_items_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_line_item_action=>{:input=>[{:name=>:line_item_action, :type=>"LineItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_line_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_line_items=>{:input=>[{:name=>:line_items, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_line_items_response", :fields=>[{:name=>:rval, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + LINEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLineItems=>{:fields=>[], :base=>"LineItemAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveLineItems=>{:fields=>[], :base=>"LineItemAction"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CreativeTargeting=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}]}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeleteLineItems=>{:fields=>[], :base=>"LineItemAction"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettings=>{:fields=>[{:name=>:min_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_target_age, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_gender, :type=>"GrpTargetGender", :min_occurs=>0, :max_occurs=>1}, {:name=>:provider, :type=>"GrpProvider", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_impression_goal, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemAction=>{:fields=>[], :abstract=>true}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociation=>{:fields=>[{:name=>:activity_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:view_through_conversion_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItem=>{:fields=>[{:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_targetings, :type=>"CreativeTargeting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"LineItemSummary"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LineItemSummary=>{:fields=>[{:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:auto_extension_days, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_type, :type=>"CostType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount_type, :type=>"LineItemDiscountType", :min_occurs=>0, :max_occurs=>1}, {:name=>:discount, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:activity_associations, :type=>"LineItemActivityAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:skip_cross_selling_rule_warning_checks, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:reserve_at_creation, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"Stats", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"LineItemSummary.ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:web_property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_prioritized_preferred_deals_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_exchange_auction_opening_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_set_top_box_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_missing_creatives, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:set_top_box_display_info, :type=>"SetTopBoxInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:programmatic_creative_source, :type=>"ProgrammaticCreativeSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_goals, :type=>"Goal", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:grp_settings, :type=>"GrpSettings", :min_occurs=>0, :max_occurs=>1}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseLineItems=>{:fields=>[], :base=>"LineItemAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReleaseLineItems=>{:fields=>[], :base=>"LineItemAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveAndOverbookLineItems=>{:fields=>[], :base=>"ReserveLineItems"}, :ReserveLineItems=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"LineItemAction"}, :ResumeAndOverbookLineItems=>{:fields=>[], :base=>"ResumeLineItems"}, :ResumeLineItems=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"LineItemAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxInfo=>{:fields=>[{:name=>:sync_status, :type=>"SetTopBoxSyncStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_result, :type=>"CanoeSyncResult", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_sync_canoe_response_message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:nielsen_product_category_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Stats=>{:fields=>[{:name=>:impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_completions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_starts_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveLineItems=>{:fields=>[], :base=>"LineItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :CanoeSyncResult=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostType=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :GrpProvider=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :GrpTargetGender=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :LineItemDiscountType=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"LineItemSummary.ReservationStatus"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :ProgrammaticCreativeSource=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :SetTopBoxSyncStatus=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + LINEITEMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LINEITEMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LINEITEMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LINEITEMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LineItemServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/line_item_template_service.rb b/dfp_api/lib/dfp_api/v201802/line_item_template_service.rb old mode 100755 new mode 100644 similarity index 68% rename from dfp_api/lib/dfp_api/v201702/line_item_template_service.rb rename to dfp_api/lib/dfp_api/v201802/line_item_template_service.rb index 402b0aac1..724930867 --- a/dfp_api/lib/dfp_api/v201702/line_item_template_service.rb +++ b/dfp_api/lib/dfp_api/v201802/line_item_template_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:22. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:55. require 'ads_common/savon_service' -require 'dfp_api/v201702/line_item_template_service_registry' +require 'dfp_api/v201802/line_item_template_service_registry' -module DfpApi; module V201702; module LineItemTemplateService +module DfpApi; module V201802; module LineItemTemplateService class LineItemTemplateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_line_item_templates_by_statement(*args, &block) @@ -32,7 +32,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::LineItemTemplateService + return DfpApi::V201802::LineItemTemplateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/line_item_template_service_registry.rb b/dfp_api/lib/dfp_api/v201802/line_item_template_service_registry.rb new file mode 100644 index 000000000..8aa522f06 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/line_item_template_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:55. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module LineItemTemplateService + class LineItemTemplateServiceRegistry + LINEITEMTEMPLATESERVICE_METHODS = {:get_line_item_templates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_line_item_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"LineItemTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}} + LINEITEMTEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_default, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:enabled_for_same_advertiser_exception, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}]}, :LineItemTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LineItemTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + LINEITEMTEMPLATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LINEITEMTEMPLATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LINEITEMTEMPLATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LINEITEMTEMPLATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LineItemTemplateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/live_stream_event_service.rb b/dfp_api/lib/dfp_api/v201802/live_stream_event_service.rb old mode 100755 new mode 100644 similarity index 83% rename from dfp_api/lib/dfp_api/v201702/live_stream_event_service.rb rename to dfp_api/lib/dfp_api/v201802/live_stream_event_service.rb index bf08ca9f5..e39cc2d64 --- a/dfp_api/lib/dfp_api/v201702/live_stream_event_service.rb +++ b/dfp_api/lib/dfp_api/v201802/live_stream_event_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:23. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:56. require 'ads_common/savon_service' -require 'dfp_api/v201702/live_stream_event_service_registry' +require 'dfp_api/v201802/live_stream_event_service_registry' -module DfpApi; module V201702; module LiveStreamEventService +module DfpApi; module V201802; module LiveStreamEventService class LiveStreamEventService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_live_stream_events(*args, &block) @@ -64,7 +64,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::LiveStreamEventService + return DfpApi::V201802::LiveStreamEventService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/live_stream_event_service_registry.rb b/dfp_api/lib/dfp_api/v201802/live_stream_event_service_registry.rb new file mode 100644 index 000000000..882ab27f3 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/live_stream_event_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:56. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module LiveStreamEventService + class LiveStreamEventServiceRegistry + LIVESTREAMEVENTSERVICE_METHODS = {:create_live_stream_events=>{:input=>[{:name=>:live_stream_events, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_live_stream_events_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_live_stream_events_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_live_stream_events_by_statement_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEventPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_live_stream_event_action=>{:input=>[{:name=>:live_stream_event_action, :type=>"LiveStreamEventAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_live_stream_event_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :register_sessions_for_monitoring=>{:input=>[{:name=>:session_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"register_sessions_for_monitoring_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :update_live_stream_events=>{:input=>[{:name=>:live_stream_events, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_live_stream_events_response", :fields=>[{:name=>:rval, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + LIVESTREAMEVENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CdnConfiguration=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cdn_configuration_type, :type=>"CdnConfigurationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_content_configuration, :type=>"SourceContentConfiguration", :min_occurs=>0, :max_occurs=>1}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :HlsSettings=>{:fields=>[{:name=>:playlist_type, :type=>"PlaylistType", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEventAction=>{:fields=>[], :abstract=>true}, :LiveStreamEventActionError=>{:fields=>[{:name=>:reason, :type=>"LiveStreamEventActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEventCdnSettingsError=>{:fields=>[{:name=>:reason, :type=>"LiveStreamEventCdnSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEventDateTimeError=>{:fields=>[{:name=>:reason, :type=>"LiveStreamEventDateTimeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LiveStreamEvent=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"LiveStreamEventStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time_type, :type=>"StartDateTimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_estimated_concurrent_users, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_tags, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:live_stream_event_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:dvr_window_seconds, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_break_fill_type, :type=>"AdBreakFillType", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_holiday_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:enable_durationless_ad_breaks, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_ad_break_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_content_configurations, :type=>"CdnConfiguration", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:hls_settings, :type=>"HlsSettings", :min_occurs=>0, :max_occurs=>1}]}, :LiveStreamEventPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"LiveStreamEvent", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MediaLocationSettings=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_prefix, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:security_policy, :type=>"SecurityPolicySettings", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseLiveStreamEventAds=>{:fields=>[], :base=>"LiveStreamEventAction"}, :PauseLiveStreamEvents=>{:fields=>[], :base=>"LiveStreamEventAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SamSessionError=>{:fields=>[{:name=>:reason, :type=>"SamSessionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SecurityPolicySettings=>{:fields=>[{:name=>:security_policy_type, :type=>"SecurityPolicyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:token_authentication_key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:disable_server_side_url_signing, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_forwarding_type, :type=>"OriginForwardingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_path_prefix, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :SourceContentConfiguration=>{:fields=>[{:name=>:ingest_settings, :type=>"MediaLocationSettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_delivery_settings, :type=>"MediaLocationSettings", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :AdBreakFillType=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :CdnConfigurationType=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LiveStreamEventActionError.Reason"=>{:fields=>[]}, :"LiveStreamEventCdnSettingsError.Reason"=>{:fields=>[]}, :"LiveStreamEventDateTimeError.Reason"=>{:fields=>[]}, :LiveStreamEventStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :OriginForwardingType=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PlaylistType=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SamSessionError.Reason"=>{:fields=>[]}, :SecurityPolicyType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :StartDateTimeType=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + LIVESTREAMEVENTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LIVESTREAMEVENTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LIVESTREAMEVENTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LIVESTREAMEVENTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LiveStreamEventServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/mobile_application_service.rb b/dfp_api/lib/dfp_api/v201802/mobile_application_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/mobile_application_service.rb rename to dfp_api/lib/dfp_api/v201802/mobile_application_service.rb index 9798d16c9..b5c009dfc --- a/dfp_api/lib/dfp_api/v201702/mobile_application_service.rb +++ b/dfp_api/lib/dfp_api/v201802/mobile_application_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:24. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:56. require 'ads_common/savon_service' -require 'dfp_api/v201702/mobile_application_service_registry' +require 'dfp_api/v201802/mobile_application_service_registry' -module DfpApi; module V201702; module MobileApplicationService +module DfpApi; module V201802; module MobileApplicationService class MobileApplicationService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_mobile_applications(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::MobileApplicationService + return DfpApi::V201802::MobileApplicationService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/mobile_application_service_registry.rb b/dfp_api/lib/dfp_api/v201802/mobile_application_service_registry.rb new file mode 100644 index 000000000..858f01364 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/mobile_application_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:56. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module MobileApplicationService + class MobileApplicationServiceRegistry + MOBILEAPPLICATIONSERVICE_METHODS = {:create_mobile_applications=>{:input=>[{:name=>:mobile_applications, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_mobile_applications_response", :fields=>[{:name=>:rval, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_mobile_applications_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_mobile_applications_by_statement_response", :fields=>[{:name=>:rval, :type=>"MobileApplicationPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_mobile_application_action=>{:input=>[{:name=>:mobile_application_action, :type=>"MobileApplicationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_mobile_application_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_mobile_applications=>{:input=>[{:name=>:mobile_applications, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_mobile_applications_response", :fields=>[{:name=>:rval, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + MOBILEAPPLICATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :UnarchiveMobileApplications=>{:fields=>[], :base=>"MobileApplicationAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ArchiveMobileApplications=>{:fields=>[], :base=>"MobileApplicationAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplicationAction=>{:fields=>[], :abstract=>true}, :MobileApplicationActionError=>{:fields=>[{:name=>:reason, :type=>"MobileApplicationActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplication=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store, :type=>"MobileApplicationStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_store_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:developer_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:platform, :type=>"MobileApplicationPlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_free, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:download_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationError=>{:fields=>[{:name=>:reason, :type=>"MobileApplicationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileApplicationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"MobileApplication", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"MobileApplicationActionError.Reason"=>{:fields=>[]}, :"MobileApplicationError.Reason"=>{:fields=>[]}, :MobileApplicationPlatform=>{:fields=>[]}, :MobileApplicationStore=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + MOBILEAPPLICATIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return MOBILEAPPLICATIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return MOBILEAPPLICATIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return MOBILEAPPLICATIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, MobileApplicationServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/native_style_service.rb b/dfp_api/lib/dfp_api/v201802/native_style_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/native_style_service.rb rename to dfp_api/lib/dfp_api/v201802/native_style_service.rb index abf6089f3..3f660a48e --- a/dfp_api/lib/dfp_api/v201702/native_style_service.rb +++ b/dfp_api/lib/dfp_api/v201802/native_style_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:25. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:57. require 'ads_common/savon_service' -require 'dfp_api/v201702/native_style_service_registry' +require 'dfp_api/v201802/native_style_service_registry' -module DfpApi; module V201702; module NativeStyleService +module DfpApi; module V201802; module NativeStyleService class NativeStyleService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_native_styles(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::NativeStyleService + return DfpApi::V201802::NativeStyleService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/native_style_service_registry.rb b/dfp_api/lib/dfp_api/v201802/native_style_service_registry.rb new file mode 100644 index 000000000..965a4bfa9 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/native_style_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:57. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module NativeStyleService + class NativeStyleServiceRegistry + NATIVESTYLESERVICE_METHODS = {:create_native_styles=>{:input=>[{:name=>:native_styles, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_native_styles_response", :fields=>[{:name=>:rval, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_native_styles_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_native_styles_by_statement_response", :fields=>[{:name=>:rval, :type=>"NativeStylePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_native_style_action=>{:input=>[{:name=>:native_style_action, :type=>"NativeStyleAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_native_style_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_native_styles=>{:input=>[{:name=>:native_styles, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_native_styles_response", :fields=>[{:name=>:rval, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + NATIVESTYLESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveNativeStyles=>{:fields=>[], :base=>"NativeStyleAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeTemplateError=>{:fields=>[{:name=>:reason, :type=>"CreativeTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NativeStyleAction=>{:fields=>[], :abstract=>true}, :NativeStyle=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:html_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:css_snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_fluid, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"NativeStyleStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}]}, :NativeStyleError=>{:fields=>[{:name=>:reason, :type=>"NativeStyleError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NativeStylePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"NativeStyle", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeTemplateError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NativeStyleError.Reason"=>{:fields=>[]}, :NativeStyleStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} + NATIVESTYLESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return NATIVESTYLESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return NATIVESTYLESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return NATIVESTYLESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, NativeStyleServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/network_service.rb b/dfp_api/lib/dfp_api/v201802/network_service.rb old mode 100755 new mode 100644 similarity index 79% rename from dfp_api/lib/dfp_api/v201702/network_service.rb rename to dfp_api/lib/dfp_api/v201802/network_service.rb index c86b1e4fa..766509f52 --- a/dfp_api/lib/dfp_api/v201702/network_service.rb +++ b/dfp_api/lib/dfp_api/v201802/network_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:27. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:58. require 'ads_common/savon_service' -require 'dfp_api/v201702/network_service_registry' +require 'dfp_api/v201802/network_service_registry' -module DfpApi; module V201702; module NetworkService +module DfpApi; module V201802; module NetworkService class NetworkService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_all_networks(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::NetworkService + return DfpApi::V201802::NetworkService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/network_service_registry.rb b/dfp_api/lib/dfp_api/v201802/network_service_registry.rb new file mode 100644 index 000000000..be9cded66 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/network_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:58. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module NetworkService + class NetworkServiceRegistry + NETWORKSERVICE_METHODS = {:get_all_networks=>{:input=>[], :output=>{:name=>"get_all_networks_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_current_network=>{:input=>[], :output=>{:name=>"get_current_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}, :make_test_network=>{:input=>[], :output=>{:name=>"make_test_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}, :update_network=>{:input=>[{:name=>:network, :type=>"Network", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"update_network_response", :fields=>[{:name=>:rval, :type=>"Network", :min_occurs=>0, :max_occurs=>1}]}}} + NETWORKSERVICE_TYPES = {:ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Network=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:property_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_currency_codes, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_root_ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_test, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :NetworkError=>{:fields=>[{:name=>:reason, :type=>"NetworkError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxCreativeError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NetworkError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxCreativeError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + NETWORKSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return NETWORKSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return NETWORKSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return NETWORKSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, NetworkServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/order_service.rb b/dfp_api/lib/dfp_api/v201802/order_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/order_service.rb rename to dfp_api/lib/dfp_api/v201802/order_service.rb index 5892565ee..40a0ca1b6 --- a/dfp_api/lib/dfp_api/v201702/order_service.rb +++ b/dfp_api/lib/dfp_api/v201802/order_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:28. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:59. require 'ads_common/savon_service' -require 'dfp_api/v201702/order_service_registry' +require 'dfp_api/v201802/order_service_registry' -module DfpApi; module V201702; module OrderService +module DfpApi; module V201802; module OrderService class OrderService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_orders(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::OrderService + return DfpApi::V201802::OrderService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/order_service_registry.rb b/dfp_api/lib/dfp_api/v201802/order_service_registry.rb new file mode 100644 index 000000000..314388010 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/order_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:20:59. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module OrderService + class OrderServiceRegistry + ORDERSERVICE_METHODS = {:create_orders=>{:input=>[{:name=>:orders, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_orders_response", :fields=>[{:name=>:rval, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_orders_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_orders_by_statement_response", :fields=>[{:name=>:rval, :type=>"OrderPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_order_action=>{:input=>[{:name=>:order_action, :type=>"OrderAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_order_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_orders=>{:input=>[{:name=>:orders, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_orders_response", :fields=>[{:name=>:rval, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ORDERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApproveAndOverbookOrders=>{:fields=>[], :base=>"ApproveOrders"}, :ApproveOrders=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :ApproveOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :ArchiveOrders=>{:fields=>[], :base=>"OrderAction"}, :AudienceExtensionError=>{:fields=>[{:name=>:reason, :type=>"AudienceExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ClickTrackingLineItemError=>{:fields=>[{:name=>:reason, :type=>"ClickTrackingLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CompanyCreditStatusError=>{:fields=>[{:name=>:reason, :type=>"CompanyCreditStatusError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CrossSellError=>{:fields=>[{:name=>:reason, :type=>"CrossSellError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeleteOrders=>{:fields=>[], :base=>"OrderAction"}, :DisapproveOrders=>{:fields=>[], :base=>"OrderAction"}, :DisapproveOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GrpSettingsError=>{:fields=>[{:name=>:reason, :type=>"GrpSettingsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemActivityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemActivityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemCreativeAssociationError=>{:fields=>[{:name=>:reason, :type=>"LineItemCreativeAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderAction=>{:fields=>[], :abstract=>true}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Order=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:unlimited_end_date_time, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"OrderStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_order_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:agency_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:trafficker_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_trafficker_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:salesperson_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_salesperson_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:total_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_clicks_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_viewable_impressions_delivered, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_by_app, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Order", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseOrders=>{:fields=>[], :base=>"OrderAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ResumeAndOverbookOrders=>{:fields=>[], :base=>"ResumeOrders"}, :ResumeOrders=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :RetractOrders=>{:fields=>[], :base=>"OrderAction"}, :RetractOrdersWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetTopBoxLineItemError=>{:fields=>[{:name=>:reason, :type=>"SetTopBoxLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SubmitOrdersForApproval=>{:fields=>[{:name=>:skip_inventory_check, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"OrderAction"}, :SubmitOrdersForApprovalAndOverbook=>{:fields=>[], :base=>"SubmitOrdersForApproval"}, :SubmitOrdersForApprovalWithoutReservationChanges=>{:fields=>[], :base=>"OrderAction"}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TemplateInstantiatedCreativeError=>{:fields=>[{:name=>:reason, :type=>"TemplateInstantiatedCreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveOrders=>{:fields=>[], :base=>"OrderAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AudienceExtensionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"ClickTrackingLineItemError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CompanyCreditStatusError.Reason"=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CrossSellError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"GrpSettingsError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemActivityAssociationError.Reason"=>{:fields=>[]}, :"LineItemCreativeAssociationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :OrderStatus=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"SetTopBoxLineItemError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TemplateInstantiatedCreativeError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + ORDERSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ORDERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ORDERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ORDERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, OrderServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/package_service.rb b/dfp_api/lib/dfp_api/v201802/package_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/package_service.rb rename to dfp_api/lib/dfp_api/v201802/package_service.rb index f283453ac..581e8d6d3 --- a/dfp_api/lib/dfp_api/v201702/package_service.rb +++ b/dfp_api/lib/dfp_api/v201802/package_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:31. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:00. require 'ads_common/savon_service' -require 'dfp_api/v201702/package_service_registry' +require 'dfp_api/v201802/package_service_registry' -module DfpApi; module V201702; module PackageService +module DfpApi; module V201802; module PackageService class PackageService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_packages(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::PackageService + return DfpApi::V201802::PackageService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/package_service_registry.rb b/dfp_api/lib/dfp_api/v201802/package_service_registry.rb new file mode 100644 index 000000000..927232a13 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/package_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:00. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module PackageService + class PackageServiceRegistry + PACKAGESERVICE_METHODS = {:create_packages=>{:input=>[{:name=>:packages, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_packages_response", :fields=>[{:name=>:rval, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_packages_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_packages_by_statement_response", :fields=>[{:name=>:rval, :type=>"PackagePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_package_action=>{:input=>[{:name=>:package_action, :type=>"PackageAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_package_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_packages=>{:input=>[{:name=>:packages, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_packages_response", :fields=>[{:name=>:rval, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PACKAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CreateProposalLineItemsFromPackages=>{:fields=>[], :base=>"PackageAction"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :PackageAction=>{:fields=>[], :abstract=>true}, :PackageActionError=>{:fields=>[{:name=>:reason, :type=>"PackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Package=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"PackageStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :PackageError=>{:fields=>[{:name=>:reason, :type=>"PackageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PackagePage=>{:fields=>[{:name=>:results, :type=>"Package", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"PackageActionError.Reason"=>{:fields=>[]}, :"PackageError.Reason"=>{:fields=>[]}, :PackageStatus=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}} + PACKAGESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PACKAGESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PACKAGESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PACKAGESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, PackageServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/placement_service.rb b/dfp_api/lib/dfp_api/v201802/placement_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/placement_service.rb rename to dfp_api/lib/dfp_api/v201802/placement_service.rb index 9aeea938d..11b8d51c9 --- a/dfp_api/lib/dfp_api/v201702/placement_service.rb +++ b/dfp_api/lib/dfp_api/v201802/placement_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:36. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:02. require 'ads_common/savon_service' -require 'dfp_api/v201702/placement_service_registry' +require 'dfp_api/v201802/placement_service_registry' -module DfpApi; module V201702; module PlacementService +module DfpApi; module V201802; module PlacementService class PlacementService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_placements(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::PlacementService + return DfpApi::V201802::PlacementService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/placement_service_registry.rb b/dfp_api/lib/dfp_api/v201802/placement_service_registry.rb new file mode 100644 index 000000000..c6bf842ca --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/placement_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:02. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module PlacementService + class PlacementServiceRegistry + PLACEMENTSERVICE_METHODS = {:create_placements=>{:input=>[{:name=>:placements, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_placements_response", :fields=>[{:name=>:rval, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_placements_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_placements_by_statement_response", :fields=>[{:name=>:rval, :type=>"PlacementPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_placement_action=>{:input=>[{:name=>:placement_action, :type=>"PlacementAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_placement_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_placements=>{:input=>[{:name=>:placements, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_placements_response", :fields=>[{:name=>:rval, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PLACEMENTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivatePlacements=>{:fields=>[], :base=>"PlacementAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchivePlacements=>{:fields=>[], :base=>"PlacementAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivatePlacements=>{:fields=>[], :base=>"PlacementAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementAction=>{:fields=>[], :abstract=>true}, :Placement=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:placement_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"InventoryStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeted_ad_unit_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"SiteTargetingInfo"}, :PlacementError=>{:fields=>[{:name=>:reason, :type=>"PlacementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Placement", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SiteTargetingInfo=>{:fields=>[]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :InventoryStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PlacementError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + PLACEMENTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PLACEMENTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PLACEMENTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PLACEMENTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, PlacementServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/premium_rate_service.rb b/dfp_api/lib/dfp_api/v201802/premium_rate_service.rb old mode 100755 new mode 100644 similarity index 77% rename from dfp_api/lib/dfp_api/v201702/premium_rate_service.rb rename to dfp_api/lib/dfp_api/v201802/premium_rate_service.rb index cff99eb18..f2aac0f2b --- a/dfp_api/lib/dfp_api/v201702/premium_rate_service.rb +++ b/dfp_api/lib/dfp_api/v201802/premium_rate_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:38. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:03. require 'ads_common/savon_service' -require 'dfp_api/v201702/premium_rate_service_registry' +require 'dfp_api/v201802/premium_rate_service_registry' -module DfpApi; module V201702; module PremiumRateService +module DfpApi; module V201802; module PremiumRateService class PremiumRateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_premium_rates(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::PremiumRateService + return DfpApi::V201802::PremiumRateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/premium_rate_service_registry.rb b/dfp_api/lib/dfp_api/v201802/premium_rate_service_registry.rb new file mode 100644 index 000000000..0b4aa0208 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/premium_rate_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:03. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module PremiumRateService + class PremiumRateServiceRegistry + PREMIUMRATESERVICE_METHODS = {:create_premium_rates=>{:input=>[{:name=>:premium_rates, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_premium_rates_response", :fields=>[{:name=>:rval, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_premium_rates_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_premium_rates_by_statement_response", :fields=>[{:name=>:rval, :type=>"PremiumRatePage", :min_occurs=>0, :max_occurs=>1}]}}, :update_premium_rates=>{:input=>[{:name=>:premium_rates, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_premium_rates_response", :fields=>[{:name=>:rval, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PREMIUMRATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentPremiumFeature=>{:fields=>[{:name=>:audience_segment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :BrowserPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguagePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundlePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :CustomTargetingPremiumFeature=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DaypartPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCapabilityPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCategoryPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceManufacturerPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :GeographyPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileCarrierPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystemPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :PremiumFeature=>{:fields=>[], :abstract=>true}, :PremiumRate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_method, :type=>"PricingMethod", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_rate_values, :type=>"PremiumRateValue", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PremiumRateError=>{:fields=>[{:name=>:reason, :type=>"PremiumRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PremiumRatePage=>{:fields=>[{:name=>:results, :type=>"PremiumRate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PremiumRateValue=>{:fields=>[{:name=>:premium_rate_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_type, :type=>"PremiumAdjustmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnknownPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UserDomainPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPositionPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PremiumAdjustmentType=>{:fields=>[]}, :"PremiumRateError.Reason"=>{:fields=>[]}, :PricingMethod=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + PREMIUMRATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PREMIUMRATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PREMIUMRATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PREMIUMRATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, PremiumRateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_package_item_service.rb b/dfp_api/lib/dfp_api/v201802/product_package_item_service.rb old mode 100755 new mode 100644 similarity index 81% rename from dfp_api/lib/dfp_api/v201702/product_package_item_service.rb rename to dfp_api/lib/dfp_api/v201802/product_package_item_service.rb index 47d3cc18d..1e75f0398 --- a/dfp_api/lib/dfp_api/v201702/product_package_item_service.rb +++ b/dfp_api/lib/dfp_api/v201802/product_package_item_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:35. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:02. require 'ads_common/savon_service' -require 'dfp_api/v201702/product_package_item_service_registry' +require 'dfp_api/v201802/product_package_item_service_registry' -module DfpApi; module V201702; module ProductPackageItemService +module DfpApi; module V201802; module ProductPackageItemService class ProductPackageItemService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_product_package_items(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProductPackageItemService + return DfpApi::V201802::ProductPackageItemService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/product_package_item_service_registry.rb b/dfp_api/lib/dfp_api/v201802/product_package_item_service_registry.rb new file mode 100644 index 000000000..b0e8ba986 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/product_package_item_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:02. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProductPackageItemService + class ProductPackageItemServiceRegistry + PRODUCTPACKAGEITEMSERVICE_METHODS = {:create_product_package_items=>{:input=>[{:name=>:product_package_items, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_package_items_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_package_items_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_package_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_package_item_action=>{:input=>[{:name=>:product_package_item_action, :type=>"ProductPackageItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_package_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_package_items=>{:input=>[{:name=>:product_package_items, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_package_items_response", :fields=>[{:name=>:rval, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PRODUCTPACKAGEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductPackageItems=>{:fields=>[], :base=>"ProductPackageItemAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItemAction=>{:fields=>[], :abstract=>true}, :ProductPackageItemActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItem=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_mandatory, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:archive_status, :type=>"ArchiveStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProductPackageItemError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageItemPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductPackageItem", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductPackageRateCardAssociationError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageRateCardAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnArchiveProductPackageItems=>{:fields=>[], :base=>"ProductPackageItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :ArchiveStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProductPackageActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemError.Reason"=>{:fields=>[]}, :"ProductPackageRateCardAssociationError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + PRODUCTPACKAGEITEMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PRODUCTPACKAGEITEMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PRODUCTPACKAGEITEMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PRODUCTPACKAGEITEMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProductPackageItemServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_package_service.rb b/dfp_api/lib/dfp_api/v201802/product_package_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/product_package_service.rb rename to dfp_api/lib/dfp_api/v201802/product_package_service.rb index 52ae33fad..ea96adf55 --- a/dfp_api/lib/dfp_api/v201702/product_package_service.rb +++ b/dfp_api/lib/dfp_api/v201802/product_package_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:34. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:01. require 'ads_common/savon_service' -require 'dfp_api/v201702/product_package_service_registry' +require 'dfp_api/v201802/product_package_service_registry' -module DfpApi; module V201702; module ProductPackageService +module DfpApi; module V201802; module ProductPackageService class ProductPackageService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_product_packages(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProductPackageService + return DfpApi::V201802::ProductPackageService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/product_package_service_registry.rb b/dfp_api/lib/dfp_api/v201802/product_package_service_registry.rb new file mode 100644 index 000000000..5c27858c9 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/product_package_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:01. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProductPackageService + class ProductPackageServiceRegistry + PRODUCTPACKAGESERVICE_METHODS = {:create_product_packages=>{:input=>[{:name=>:product_packages, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_packages_response", :fields=>[{:name=>:rval, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_packages_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_packages_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPackagePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_package_action=>{:input=>[{:name=>:action, :type=>"ProductPackageAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_package_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_packages=>{:input=>[{:name=>:product_packages, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_packages_response", :fields=>[{:name=>:rval, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PRODUCTPACKAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackageAction=>{:fields=>[], :abstract=>true}, :ProductPackageActionError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackage=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductPackageStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :ProductPackageItemError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductPackagePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductPackage", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductPackageRateCardAssociationError=>{:fields=>[{:name=>:reason, :type=>"ProductPackageRateCardAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardError=>{:fields=>[{:name=>:reason, :type=>"RateCardError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UnarchiveProductPackages=>{:fields=>[], :base=>"ProductPackageAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProductPackageActionError.Reason"=>{:fields=>[]}, :"ProductPackageItemError.Reason"=>{:fields=>[]}, :"ProductPackageRateCardAssociationError.Reason"=>{:fields=>[]}, :ProductPackageStatus=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateCardError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + PRODUCTPACKAGESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PRODUCTPACKAGESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PRODUCTPACKAGESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PRODUCTPACKAGESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProductPackageServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_service.rb b/dfp_api/lib/dfp_api/v201802/product_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/product_service.rb rename to dfp_api/lib/dfp_api/v201802/product_service.rb index 5cc336e22..560bb20a5 --- a/dfp_api/lib/dfp_api/v201702/product_service.rb +++ b/dfp_api/lib/dfp_api/v201802/product_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:39. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:04. require 'ads_common/savon_service' -require 'dfp_api/v201702/product_service_registry' +require 'dfp_api/v201802/product_service_registry' -module DfpApi; module V201702; module ProductService +module DfpApi; module V201802; module ProductService class ProductService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_products(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProductService + return DfpApi::V201802::ProductService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/product_service_registry.rb b/dfp_api/lib/dfp_api/v201802/product_service_registry.rb new file mode 100644 index 000000000..7bb56e4e8 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/product_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:04. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProductService + class ProductServiceRegistry + PRODUCTSERVICE_METHODS = {:create_products=>{:input=>[{:name=>:products, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_products_response", :fields=>[{:name=>:rval, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_products_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_products_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_action=>{:input=>[{:name=>:product_action, :type=>"ProductAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_products=>{:input=>[{:name=>:products, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_products_response", :fields=>[{:name=>:rval, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PRODUCTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProducts=>{:fields=>[], :base=>"ProductAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeactivateProducts=>{:fields=>[], :base=>"ProductAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NonProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"NonProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PreferredDealError=>{:fields=>[{:name=>:reason, :type=>"PreferredDealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductAction=>{:fields=>[], :abstract=>true}, :ProductActionError=>{:fields=>[{:name=>:reason, :type=>"ProductActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Product=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name_source, :type=>"ValueSourceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_type, :type=>"ProductType", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_marketplace_info, :type=>"ProductMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms_source, :type=>"ValueSourceType", :min_occurs=>0, :max_occurs=>1}]}, :ProductPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Product", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProgrammaticEntitiesError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticEntitiesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublishProducts=>{:fields=>[], :base=>"ProductAction"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :WithdrawProducts=>{:fields=>[], :base=>"ProductAction"}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NonProgrammaticProductError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PreferredDealError.Reason"=>{:fields=>[]}, :"ProductActionError.Reason"=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :ProductStatus=>{:fields=>[]}, :ProductType=>{:fields=>[]}, :"ProgrammaticEntitiesError.Reason"=>{:fields=>[]}, :"ProgrammaticProductError.Reason"=>{:fields=>[]}, :ValueSourceType=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + PRODUCTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PRODUCTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PRODUCTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PRODUCTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProductServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/product_template_service.rb b/dfp_api/lib/dfp_api/v201802/product_template_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/product_template_service.rb rename to dfp_api/lib/dfp_api/v201802/product_template_service.rb index e0787a033..f8dddd508 --- a/dfp_api/lib/dfp_api/v201702/product_template_service.rb +++ b/dfp_api/lib/dfp_api/v201802/product_template_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:41. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:05. require 'ads_common/savon_service' -require 'dfp_api/v201702/product_template_service_registry' +require 'dfp_api/v201802/product_template_service_registry' -module DfpApi; module V201702; module ProductTemplateService +module DfpApi; module V201802; module ProductTemplateService class ProductTemplateService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_product_templates(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProductTemplateService + return DfpApi::V201802::ProductTemplateService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/product_template_service_registry.rb b/dfp_api/lib/dfp_api/v201802/product_template_service_registry.rb new file mode 100644 index 000000000..bf07191fa --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/product_template_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:05. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProductTemplateService + class ProductTemplateServiceRegistry + PRODUCTTEMPLATESERVICE_METHODS = {:create_product_templates=>{:input=>[{:name=>:product_templates, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_product_templates_response", :fields=>[{:name=>:rval, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_templates_by_statement=>{:input=>[{:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_templates_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProductTemplatePage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_product_template_action=>{:input=>[{:name=>:action, :type=>"ProductTemplateAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_product_template_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_product_templates=>{:input=>[{:name=>:product_templates, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_product_templates_response", :fields=>[{:name=>:rval, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PRODUCTTEMPLATESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BaseRateError=>{:fields=>[{:name=>:reason, :type=>"BaseRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeactivateProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementTargeting=>{:fields=>[{:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PreferredDealError=>{:fields=>[{:name=>:reason, :type=>"PreferredDealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductTemplateAction=>{:fields=>[], :abstract=>true}, :ProductTemplateActionError=>{:fields=>[{:name=>:reason, :type=>"ProductTemplateActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductTemplate=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name_macro, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProductTemplateStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_type, :type=>"ProductType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:product_segmentation, :type=>"ProductSegmentation", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_template_marketplace_info, :type=>"ProductTemplateMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}]}, :ProductTemplateError=>{:fields=>[{:name=>:reason, :type=>"ProductTemplateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductTemplateMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ProductTemplatePage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ProductTemplate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProductSegmentation=>{:fields=>[{:name=>:geo_segment, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_segments, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:placement_segment, :type=>"PlacementTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_segment, :type=>"CustomCriteria", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:user_domain_segment, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_segment, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_segment, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_segment, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_segment, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_segment, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_segment, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_segment, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_segment, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_segment, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_segment, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_segment, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:size_segment, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_application_segment, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_segment, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ProgrammaticEntitiesError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticEntitiesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgrammaticProductError=>{:fields=>[{:name=>:reason, :type=>"ProgrammaticProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProductTemplates=>{:fields=>[], :base=>"ProductTemplateAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"BaseRateError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PreferredDealError.Reason"=>{:fields=>[]}, :"ProductTemplateActionError.Reason"=>{:fields=>[]}, :"ProductTemplateError.Reason"=>{:fields=>[]}, :ProductTemplateStatus=>{:fields=>[]}, :ProductType=>{:fields=>[]}, :"ProgrammaticEntitiesError.Reason"=>{:fields=>[]}, :"ProgrammaticProductError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + PRODUCTTEMPLATESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PRODUCTTEMPLATESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PRODUCTTEMPLATESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PRODUCTTEMPLATESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProductTemplateServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/proposal_line_item_service.rb b/dfp_api/lib/dfp_api/v201802/proposal_line_item_service.rb old mode 100755 new mode 100644 similarity index 81% rename from dfp_api/lib/dfp_api/v201702/proposal_line_item_service.rb rename to dfp_api/lib/dfp_api/v201802/proposal_line_item_service.rb index 78b64b1eb..063610268 --- a/dfp_api/lib/dfp_api/v201702/proposal_line_item_service.rb +++ b/dfp_api/lib/dfp_api/v201802/proposal_line_item_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:43. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:07. require 'ads_common/savon_service' -require 'dfp_api/v201702/proposal_line_item_service_registry' +require 'dfp_api/v201802/proposal_line_item_service_registry' -module DfpApi; module V201702; module ProposalLineItemService +module DfpApi; module V201802; module ProposalLineItemService class ProposalLineItemService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_proposal_line_items(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProposalLineItemService + return DfpApi::V201802::ProposalLineItemService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/proposal_line_item_service_registry.rb b/dfp_api/lib/dfp_api/v201802/proposal_line_item_service_registry.rb new file mode 100644 index 000000000..180cc1ea6 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/proposal_line_item_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:07. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProposalLineItemService + class ProposalLineItemServiceRegistry + PROPOSALLINEITEMSERVICE_METHODS = {:create_proposal_line_items=>{:input=>[{:name=>:proposal_line_items, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_proposal_line_items_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_proposal_line_items_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_proposal_line_items_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_proposal_line_item_action=>{:input=>[{:name=>:proposal_line_item_action, :type=>"ProposalLineItemAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_proposal_line_item_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_proposal_line_items=>{:input=>[{:name=>:proposal_line_items, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_proposal_line_items_response", :fields=>[{:name=>:rval, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PROPOSALLINEITEMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActualizeProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AdUnitPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AudienceSegmentPremiumFeature=>{:fields=>[{:name=>:audience_segment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguagePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentBundlePremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentMetadataTargetingError=>{:fields=>[{:name=>:reason, :type=>"ContentMetadataTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingPremiumFeature=>{:fields=>[{:name=>:custom_targeting_key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting_value_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"PremiumFeature"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :CustomizableAttributes=>{:fields=>[{:name=>:allow_geo_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_ad_unit_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_placement_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_user_domain_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_bandwidth_group_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_browser_language_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_operating_system_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_capability_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_device_category_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_application_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_carrier_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_mobile_device_and_manufacturer_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_audience_segment_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_all_custom_targeting_keys_customizable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:allow_daypart_targeting_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_frequency_caps_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_delivery_settings_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeRangeTargetingError=>{:fields=>[{:name=>:reason, :type=>"DateTimeRangeTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DaypartPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargetingError=>{:fields=>[{:name=>:reason, :type=>"DayPartTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DealError=>{:fields=>[{:name=>:reason, :type=>"DealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeliveryData=>{:fields=>[{:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeliveryIndicator=>{:fields=>[{:name=>:expected_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:actual_delivery_percentage, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:max_impressions, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_time_units, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}]}, :FrequencyCapError=>{:fields=>[{:name=>:reason, :type=>"FrequencyCapError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCapPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :GenericTargetingError=>{:fields=>[{:name=>:reason, :type=>"GenericTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoTargetingError=>{:fields=>[{:name=>:reason, :type=>"GeoTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeographyPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :Goal=>{:fields=>[{:name=>:goal_type, :type=>"GoalType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit_type, :type=>"UnitType", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemError=>{:fields=>[{:name=>:reason, :type=>"LineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PauseProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacementPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PreferredDealError=>{:fields=>[{:name=>:reason, :type=>"PreferredDealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PremiumFeature=>{:fields=>[], :abstract=>true}, :PremiumRateValue=>{:fields=>[{:name=>:premium_rate_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:premium_feature, :type=>"PremiumFeature", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_type, :type=>"PremiumAdjustmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:adjustment_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemAction=>{:fields=>[], :abstract=>true}, :ProposalLineItemActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemConstraints=>{:fields=>[{:name=>:allow_creative_placeholders_customization, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:built_in_roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:built_in_frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:product_built_in_targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:customizable_attributes, :type=>"CustomizableAttributes", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItem=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:package_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost_adjustment, :type=>"CostAdjustment", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:goal, :type=>"Goal", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_quantity_buffer, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduled_quantity, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_rate_type, :type=>"DeliveryRateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:roadblocking_type, :type=>"RoadblockingType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companion_delivery_option, :type=>"CompanionDeliveryOption", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_rotation_type, :type=>"CreativeRotationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_max_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_caps, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:dfp_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_type, :type=>"LineItemType", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disable_same_advertiser_competitive_exclusion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_constraints, :type=>"ProposalLineItemConstraints", :min_occurs=>0, :max_occurs=>1}, {:name=>:premiums, :type=>"ProposalLineItemPremium", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_sold, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:base_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_indicator, :type=>"DeliveryIndicator", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_data, :type=>"DeliveryData", :min_occurs=>0, :max_occurs=>1}, {:name=>:computed_status, :type=>"ComputedStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_base, :type=>"BillingBase", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:reservation_status, :type=>"ReservationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_reservation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:use_third_party_ad_server_from_proposal, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_ad_server_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_third_party_ad_server_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:link_status, :type=>"LinkStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_info, :type=>"ProposalLineItemMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_card_pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:programmatic_creative_source, :type=>"ProgrammaticCreativeSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:estimated_minimum_impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemMarketplaceInfo=>{:fields=>[{:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemPage=>{:fields=>[{:name=>:results, :type=>"ProposalLineItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemPremium=>{:fields=>[{:name=>:premium_rate_value, :type=>"PremiumRateValue", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProposalLineItemPremiumStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProposalLineItemProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReleaseProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveProposalLineItems=>{:fields=>[{:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalLineItemAction"}, :ResumeProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TechnologyTargetingError=>{:fields=>[{:name=>:reason, :type=>"TechnologyTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UnknownPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UnlinkProposalLineItems=>{:fields=>[], :base=>"ProposalLineItemAction"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargetingError=>{:fields=>[{:name=>:reason, :type=>"UserDomainTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionPremiumFeature=>{:fields=>[], :base=>"PremiumFeature"}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionTargetingError=>{:fields=>[{:name=>:reason, :type=>"VideoPositionTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingBase=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :CompanionDeliveryOption=>{:fields=>[]}, :ComputedStatus=>{:fields=>[]}, :"ContentMetadataTargetingError.Reason"=>{:fields=>[]}, :CostAdjustment=>{:fields=>[]}, :CreativeRotationType=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :"DateTimeRangeTargetingError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DayPartTargetingError.Reason"=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"DealError.Reason"=>{:fields=>[]}, :DeliveryRateType=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"FrequencyCapError.Reason"=>{:fields=>[]}, :"GenericTargetingError.Reason"=>{:fields=>[]}, :"GeoTargetingError.Reason"=>{:fields=>[]}, :GoalType=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :LineItemType=>{:fields=>[]}, :LinkStatus=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :"PreferredDealError.Reason"=>{:fields=>[]}, :PremiumAdjustmentType=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :ProgrammaticCreativeSource=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemActionError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :ProposalLineItemPremiumStatus=>{:fields=>[]}, :"ProposalLineItemProgrammaticError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :ReservationStatus=>{:fields=>[]}, :RoadblockingType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TechnologyTargetingError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :UnitType=>{:fields=>[]}, :"UserDomainTargetingError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"VideoPositionTargetingError.Reason"=>{:fields=>[]}} + PROPOSALLINEITEMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PROPOSALLINEITEMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PROPOSALLINEITEMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PROPOSALLINEITEMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProposalLineItemServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/proposal_service.rb b/dfp_api/lib/dfp_api/v201802/proposal_service.rb old mode 100755 new mode 100644 similarity index 83% rename from dfp_api/lib/dfp_api/v201702/proposal_service.rb rename to dfp_api/lib/dfp_api/v201802/proposal_service.rb index 29132d4c5..152a6defb --- a/dfp_api/lib/dfp_api/v201702/proposal_service.rb +++ b/dfp_api/lib/dfp_api/v201802/proposal_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:46. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:08. require 'ads_common/savon_service' -require 'dfp_api/v201702/proposal_service_registry' +require 'dfp_api/v201802/proposal_service_registry' -module DfpApi; module V201702; module ProposalService +module DfpApi; module V201802; module ProposalService class ProposalService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_proposals(*args, &block) @@ -64,7 +64,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ProposalService + return DfpApi::V201802::ProposalService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/proposal_service_registry.rb b/dfp_api/lib/dfp_api/v201802/proposal_service_registry.rb new file mode 100644 index 000000000..ce26b0f5b --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/proposal_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:08. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ProposalService + class ProposalServiceRegistry + PROPOSALSERVICE_METHODS = {:create_proposals=>{:input=>[{:name=>:proposals, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_proposals_response", :fields=>[{:name=>:rval, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_marketplace_comments_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_marketplace_comments_by_statement_response", :fields=>[{:name=>:rval, :type=>"MarketplaceCommentPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_proposals_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_proposals_by_statement_response", :fields=>[{:name=>:rval, :type=>"ProposalPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_proposal_action=>{:input=>[{:name=>:proposal_action, :type=>"ProposalAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_proposal_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_proposals=>{:input=>[{:name=>:proposals, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_proposals_response", :fields=>[{:name=>:rval, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + PROPOSALSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AppliedLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negated, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ArchiveProposals=>{:fields=>[], :base=>"ProposalAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AvailableBillingError=>{:fields=>[{:name=>:reason, :type=>"AvailableBillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BaseCustomFieldValue=>{:fields=>[{:name=>:custom_field_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BillingError=>{:fields=>[{:name=>:reason, :type=>"BillingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BuyerRfp=>{:fields=>[{:name=>:cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_placeholders, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeting, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:additional_terms, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_exchange_environment, :type=>"AdExchangeEnvironment", :min_occurs=>0, :max_occurs=>1}, {:name=>:rfp_type, :type=>"RfpType", :min_occurs=>0, :max_occurs=>1}]}, :BypassProposalWorkflowRules=>{:fields=>[], :base=>"ProposalAction"}, :CancelRetractionForProposals=>{:fields=>[], :base=>"ProposalAction"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativePlaceholder=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"CreativePlaceholder", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expected_creative_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_size_type, :type=>"CreativeSizeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomFieldValue=>{:fields=>[{:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DealError=>{:fields=>[{:name=>:reason, :type=>"DealError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DiscardLocalVersionEdits=>{:fields=>[], :base=>"ProposalAction"}, :DropDownCustomFieldValue=>{:fields=>[{:name=>:custom_field_option_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BaseCustomFieldValue"}, :EditProposalsForNegotiation=>{:fields=>[], :base=>"ProposalAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MarketplaceComment=>{:fields=>[{:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:created_by_seller, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MarketplaceCommentPage=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"MarketplaceComment", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProposalMarketplaceInfo=>{:fields=>[{:name=>:has_local_version_edits, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:negotiation_status, :type=>"NegotiationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_new_version_from_buyer, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:buyer_account_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OfflineError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:reason, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PackageActionError=>{:fields=>[{:name=>:reason, :type=>"PackageActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PackageError=>{:fields=>[{:name=>:reason, :type=>"PackageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PrecisionError=>{:fields=>[{:name=>:reason, :type=>"PrecisionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductError=>{:fields=>[{:name=>:reason, :type=>"ProductError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalAction=>{:fields=>[], :abstract=>true}, :ProposalActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLink=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creator_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :ProposalCompanyAssociation=>{:fields=>[{:name=>:company_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"ProposalCompanyAssociationType", :min_occurs=>0, :max_occurs=>1}, {:name=>:contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Proposal=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_programmatic, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ProposalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_archived, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser, :type=>"ProposalCompanyAssociation", :min_occurs=>0, :max_occurs=>1}, {:name=>:agencies, :type=>"ProposalCompanyAssociation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:probability_of_close, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_cap, :type=>"BillingCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_schedule, :type=>"BillingSchedule", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_source, :type=>"BillingSource", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_base, :type=>"BillingBase", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:internal_notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_salesperson, :type=>"SalespersonSplit", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_salespeople, :type=>"SalespersonSplit", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:sales_planner_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:primary_trafficker_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_trafficker_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:seller_contact_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_values, :type=>"BaseCustomFieldValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:effective_applied_labels, :type=>"AppliedLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:advertiser_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_discount, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:exchange_rate, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:refresh_exchange_rate, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:agency_commission, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_added_tax, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_sold, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"ProposalApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:workflow_progress, :type=>"WorkflowProgress", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:resources, :type=>"ProposalLink", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:actual_expiry_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:expected_expiry_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_ad_server_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_third_party_ad_server_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:terms_and_conditions, :type=>"ProposalTermsAndConditions", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_retraction_details, :type=>"RetractionDetails", :min_occurs=>0, :max_occurs=>1}, {:name=>:marketplace_info, :type=>"ProposalMarketplaceInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:offline_errors, :type=>"OfflineError", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:has_offline_errors, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:buyer_rfp, :type=>"BuyerRfp", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_buyer_rfp, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ProposalError=>{:fields=>[{:name=>:reason, :type=>"ProposalError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemProgrammaticError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemProgrammaticError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Proposal", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ProposalTermsAndConditions=>{:fields=>[{:name=>:terms_and_conditions_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:content, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestApprovalProgressAction=>{:fields=>[{:name=>:approver_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:eligible_approver_user_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:eligible_approver_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"WorkflowApprovalRequestStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"ProgressAction"}, :RequestBuyerAcceptance=>{:fields=>[], :base=>"ProposalAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReserveInventoryProgressAction=>{:fields=>[], :base=>"ProgressAction"}, :ReserveProposals=>{:fields=>[{:name=>:allow_overbook, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalAction"}, :RetractProposals=>{:fields=>[{:name=>:retraction_details, :type=>"RetractionDetails", :min_occurs=>0, :max_occurs=>1}], :base=>"ProposalAction"}, :RetractionDetails=>{:fields=>[{:name=>:retraction_reason_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SalespersonSplit=>{:fields=>[{:name=>:user_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:split, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SendNotificationProgressAction=>{:fields=>[], :base=>"ProgressAction"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SubmitProposalsForApprovalBypassValidation=>{:fields=>[], :base=>"ProposalAction"}, :SubmitProposalsForApproval=>{:fields=>[], :base=>"ProposalAction"}, :SubmitProposalsForArchival=>{:fields=>[], :base=>"ProposalAction"}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TerminateNegotiations=>{:fields=>[], :base=>"ProposalAction"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UnarchiveProposals=>{:fields=>[], :base=>"ProposalAction"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateOrderWithSellerData=>{:fields=>[], :base=>"ProposalAction"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :WorkflowActionError=>{:fields=>[{:name=>:reason, :type=>"WorkflowActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProgressAction=>{:fields=>[{:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :WorkflowProgress=>{:fields=>[{:name=>:steps, :type=>"ProgressStep", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:submitter_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:submission_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_processing, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ProgressStep=>{:fields=>[{:name=>:rules, :type=>"ProgressRule", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:evaluation_status, :type=>"EvaluationStatus", :min_occurs=>0, :max_occurs=>1}]}, :ProgressRule=>{:fields=>[{:name=>:actions, :type=>"ProgressAction", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_status, :type=>"WorkflowEvaluationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:evaluation_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_external, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :WorkflowValidationError=>{:fields=>[{:name=>:reason, :type=>"WorkflowValidationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdExchangeEnvironment=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :WorkflowApprovalRequestStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AvailableBillingError.Reason"=>{:fields=>[]}, :BillingBase=>{:fields=>[]}, :BillingCap=>{:fields=>[]}, :"BillingError.Reason"=>{:fields=>[]}, :BillingSchedule=>{:fields=>[]}, :BillingSource=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :EvaluationStatus=>{:fields=>[]}, :CreativeSizeType=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"DealError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :ProposalApprovalStatus=>{:fields=>[]}, :NegotiationStatus=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"PackageActionError.Reason"=>{:fields=>[]}, :"PackageError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PrecisionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"ProductError.Reason"=>{:fields=>[]}, :"ProposalActionError.Reason"=>{:fields=>[]}, :ProposalCompanyAssociationType=>{:fields=>[]}, :"ProposalError.Reason"=>{:fields=>[]}, :"ProposalLineItemError.Reason"=>{:fields=>[]}, :"ProposalLineItemProgrammaticError.Reason"=>{:fields=>[]}, :ProposalStatus=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :RfpType=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}, :"WorkflowActionError.Reason"=>{:fields=>[]}, :WorkflowEvaluationStatus=>{:fields=>[]}, :"WorkflowValidationError.Reason"=>{:fields=>[]}} + PROPOSALSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PROPOSALSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PROPOSALSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PROPOSALSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ProposalServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/publisher_query_language_service.rb b/dfp_api/lib/dfp_api/v201802/publisher_query_language_service.rb old mode 100755 new mode 100644 similarity index 64% rename from dfp_api/lib/dfp_api/v201702/publisher_query_language_service.rb rename to dfp_api/lib/dfp_api/v201802/publisher_query_language_service.rb index 9296ad712..ae3944a41 --- a/dfp_api/lib/dfp_api/v201702/publisher_query_language_service.rb +++ b/dfp_api/lib/dfp_api/v201802/publisher_query_language_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:48. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:10. require 'ads_common/savon_service' -require 'dfp_api/v201702/publisher_query_language_service_registry' +require 'dfp_api/v201802/publisher_query_language_service_registry' -module DfpApi; module V201702; module PublisherQueryLanguageService +module DfpApi; module V201802; module PublisherQueryLanguageService class PublisherQueryLanguageService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def select(*args, &block) @@ -32,7 +32,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::PublisherQueryLanguageService + return DfpApi::V201802::PublisherQueryLanguageService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/publisher_query_language_service_registry.rb b/dfp_api/lib/dfp_api/v201802/publisher_query_language_service_registry.rb new file mode 100644 index 000000000..3dad007f0 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/publisher_query_language_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:10. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module PublisherQueryLanguageService + class PublisherQueryLanguageServiceRegistry + PUBLISHERQUERYLANGUAGESERVICE_METHODS = {:select=>{:input=>[{:name=>:select_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"select_response", :fields=>[{:name=>:rval, :type=>"ResultSet", :min_occurs=>0, :max_occurs=>1}]}}} + PUBLISHERQUERYLANGUAGESERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitCodeError=>{:fields=>[{:name=>:reason, :type=>"AdUnitCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitHierarchyError=>{:fields=>[{:name=>:reason, :type=>"AdUnitHierarchyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitTargeting=>{:fields=>[{:name=>:ad_unit_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_descendants, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :TechnologyTargeting=>{:fields=>[{:name=>:bandwidth_group_targeting, :type=>"BandwidthGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_targeting, :type=>"BrowserTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_language_targeting, :type=>"BrowserLanguageTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_capability_targeting, :type=>"DeviceCapabilityTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_category_targeting, :type=>"DeviceCategoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_targeting, :type=>"DeviceManufacturerTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carrier_targeting, :type=>"MobileCarrierTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_targeting, :type=>"MobileDeviceTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_device_submodel_targeting, :type=>"MobileDeviceSubmodelTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_targeting, :type=>"OperatingSystemTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_version_targeting, :type=>"OperatingSystemVersionTargeting", :min_occurs=>0, :max_occurs=>1}]}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BandwidthGroup=>{:fields=>[], :base=>"Technology"}, :BandwidthGroupTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:bandwidth_groups, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Browser=>{:fields=>[{:name=>:major_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :BrowserLanguage=>{:fields=>[], :base=>"Technology"}, :BrowserLanguageTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browser_languages, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BrowserTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:browsers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ChangeHistoryValue=>{:fields=>[{:name=>:entity_type, :type=>"ChangeHistoryEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:operation, :type=>"ChangeHistoryOperation", :min_occurs=>0, :max_occurs=>1}], :base=>"ObjectValue"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ColumnType=>{:fields=>[{:name=>:label_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ContentMetadataKeyHierarchyTargeting=>{:fields=>[{:name=>:custom_targeting_value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ContentTargeting=>{:fields=>[{:name=>:targeted_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_video_content_bundle_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_content_metadata, :type=>"ContentMetadataKeyHierarchyTargeting", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CreativeError=>{:fields=>[{:name=>:reason, :type=>"CreativeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomCriteria=>{:fields=>[{:name=>:key_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:value_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:operator, :type=>"CustomCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}], :base=>"CustomCriteriaLeaf"}, :CustomCriteriaSet=>{:fields=>[{:name=>:logical_operator, :type=>"CustomCriteriaSet.LogicalOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:children, :type=>"CustomCriteriaNode", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaNode"}, :CustomCriteriaLeaf=>{:fields=>[], :abstract=>true, :base=>"CustomCriteriaNode"}, :CustomCriteriaNode=>{:fields=>[], :abstract=>true}, :AudienceSegmentCriteria=>{:fields=>[{:name=>:operator, :type=>"AudienceSegmentCriteria.ComparisonOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:audience_segment_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CustomCriteriaLeaf"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DayPart=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"TimeOfDay", :min_occurs=>0, :max_occurs=>1}]}, :DayPartTargeting=>{:fields=>[{:name=>:day_parts, :type=>"DayPart", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:time_zone, :type=>"DeliveryTimeZone", :min_occurs=>0, :max_occurs=>1}]}, :DeviceCapability=>{:fields=>[], :base=>"Technology"}, :DeviceCapabilityTargeting=>{:fields=>[{:name=>:targeted_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_capabilities, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceCategory=>{:fields=>[], :base=>"Technology"}, :DeviceCategoryTargeting=>{:fields=>[{:name=>:targeted_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_device_categories, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DeviceManufacturer=>{:fields=>[], :base=>"Technology"}, :DeviceManufacturerTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ExchangeRateError=>{:fields=>[{:name=>:reason, :type=>"ExchangeRateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FileError=>{:fields=>[{:name=>:reason, :type=>"FileError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoTargeting=>{:fields=>[{:name=>:targeted_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidUrlError=>{:fields=>[{:name=>:reason, :type=>"InvalidUrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryTargeting=>{:fields=>[{:name=>:targeted_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_ad_units, :type=>"AdUnitTargeting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted_placement_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :InventoryTargetingError=>{:fields=>[{:name=>:reason, :type=>"InventoryTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InventoryUnitError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemFlightDateError=>{:fields=>[{:name=>:reason, :type=>"LineItemFlightDateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Location=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_parent_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileApplicationTargeting=>{:fields=>[{:name=>:mobile_application_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :MobileCarrier=>{:fields=>[], :base=>"Technology"}, :MobileCarrierTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_carriers, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDevice=>{:fields=>[{:name=>:manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodel=>{:fields=>[{:name=>:mobile_device_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_manufacturer_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :MobileDeviceSubmodelTargeting=>{:fields=>[{:name=>:targeted_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_device_submodels, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MobileDeviceTargeting=>{:fields=>[{:name=>:targeted_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_mobile_devices, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OperatingSystem=>{:fields=>[], :base=>"Technology"}, :OperatingSystemTargeting=>{:fields=>[{:name=>:is_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_systems, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Technology"}, :OperatingSystemVersionTargeting=>{:fields=>[{:name=>:targeted_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded_operating_system_versions, :type=>"Technology", :min_occurs=>0, :max_occurs=>:unbounded}]}, :OrderActionError=>{:fields=>[{:name=>:reason, :type=>"OrderActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RegExError=>{:fields=>[{:name=>:reason, :type=>"RegExError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredSizeError=>{:fields=>[{:name=>:reason, :type=>"RequiredSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReservationDetailsError=>{:fields=>[{:name=>:reason, :type=>"ReservationDetailsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ResultSet=>{:fields=>[{:name=>:column_types, :type=>"ColumnType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rows, :type=>"Row", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Row=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AudienceSegmentError=>{:fields=>[{:name=>:reason, :type=>"AudienceSegmentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :Targeting=>{:fields=>[{:name=>:geo_targeting, :type=>"GeoTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:inventory_targeting, :type=>"InventoryTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:day_part_targeting, :type=>"DayPartTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:technology_targeting, :type=>"TechnologyTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:custom_targeting, :type=>"CustomCriteriaSet", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_domain_targeting, :type=>"UserDomainTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_targeting, :type=>"ContentTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_targeting, :type=>"VideoPositionTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:mobile_application_targeting, :type=>"MobileApplicationTargeting", :min_occurs=>0, :max_occurs=>1}]}, :TargetingValue=>{:fields=>[{:name=>:value, :type=>"Targeting", :min_occurs=>0, :max_occurs=>1}], :base=>"ObjectValue"}, :Technology=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeOfDay=>{:fields=>[{:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UserDomainTargeting=>{:fields=>[{:name=>:domains, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :VideoPosition=>{:fields=>[{:name=>:position_type, :type=>"VideoPosition.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:midroll_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTargeting=>{:fields=>[{:name=>:targeted_positions, :type=>"VideoPositionTarget", :min_occurs=>0, :max_occurs=>:unbounded}]}, :VideoPositionWithinPod=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :VideoPositionTarget=>{:fields=>[{:name=>:video_position, :type=>"VideoPosition", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_bumper_type, :type=>"VideoBumperType", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_position_within_pod, :type=>"VideoPositionWithinPod", :min_occurs=>0, :max_occurs=>1}]}, :"AdUnitCodeError.Reason"=>{:fields=>[]}, :"AdUnitHierarchyError.Reason"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :ChangeHistoryEntityType=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CreativeError.Reason"=>{:fields=>[]}, :"CustomCriteria.ComparisonOperator"=>{:fields=>[]}, :"CustomCriteriaSet.LogicalOperator"=>{:fields=>[]}, :"AudienceSegmentCriteria.ComparisonOperator"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :DeliveryTimeZone=>{:fields=>[]}, :"ExchangeRateError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"FileError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"InvalidUrlError.Reason"=>{:fields=>[]}, :"InventoryTargetingError.Reason"=>{:fields=>[]}, :"InventoryUnitError.Reason"=>{:fields=>[]}, :"LineItemFlightDateError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :ChangeHistoryOperation=>{:fields=>[]}, :"OrderActionError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RegExError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"RequiredSizeError.Reason"=>{:fields=>[]}, :"ReservationDetailsError.Reason"=>{:fields=>[]}, :"AudienceSegmentError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :VideoBumperType=>{:fields=>[]}, :"VideoPosition.Type"=>{:fields=>[]}} + PUBLISHERQUERYLANGUAGESERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return PUBLISHERQUERYLANGUAGESERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return PUBLISHERQUERYLANGUAGESERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return PUBLISHERQUERYLANGUAGESERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, PublisherQueryLanguageServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/rate_card_service.rb b/dfp_api/lib/dfp_api/v201802/rate_card_service.rb old mode 100755 new mode 100644 similarity index 80% rename from dfp_api/lib/dfp_api/v201702/rate_card_service.rb rename to dfp_api/lib/dfp_api/v201802/rate_card_service.rb index f861c7f80..21ac50591 --- a/dfp_api/lib/dfp_api/v201702/rate_card_service.rb +++ b/dfp_api/lib/dfp_api/v201802/rate_card_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:50. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:11. require 'ads_common/savon_service' -require 'dfp_api/v201702/rate_card_service_registry' +require 'dfp_api/v201802/rate_card_service_registry' -module DfpApi; module V201702; module RateCardService +module DfpApi; module V201802; module RateCardService class RateCardService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_rate_cards(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::RateCardService + return DfpApi::V201802::RateCardService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/rate_card_service_registry.rb b/dfp_api/lib/dfp_api/v201802/rate_card_service_registry.rb new file mode 100644 index 000000000..9566a7a04 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/rate_card_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:11. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module RateCardService + class RateCardServiceRegistry + RATECARDSERVICE_METHODS = {:create_rate_cards=>{:input=>[{:name=>:rate_cards, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_rate_cards_response", :fields=>[{:name=>:rval, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_rate_cards_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_rate_cards_by_statement_response", :fields=>[{:name=>:rval, :type=>"RateCardPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_rate_card_action=>{:input=>[{:name=>:rate_card_action, :type=>"RateCardAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_rate_card_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_rate_cards=>{:input=>[{:name=>:rate_cards, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_rate_cards_response", :fields=>[{:name=>:rval, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + RATECARDSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateRateCards=>{:fields=>[], :base=>"RateCardAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateRateCards=>{:fields=>[], :base=>"RateCardAction"}, :EntityChildrenLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityChildrenLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityLimitReachedError=>{:fields=>[{:name=>:reason, :type=>"EntityLimitReachedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardAction=>{:fields=>[], :abstract=>true}, :RateCardActionError=>{:fields=>[{:name=>:reason, :type=>"RateCardActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCard=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"RateCardStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:for_marketplace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:applied_team_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_modified_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}]}, :RateCardError=>{:fields=>[{:name=>:reason, :type=>"RateCardError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateCardPage=>{:fields=>[{:name=>:results, :type=>"RateCard", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredNumberError=>{:fields=>[{:name=>:reason, :type=>"RequiredNumberError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"EntityChildrenLimitReachedError.Reason"=>{:fields=>[]}, :"EntityLimitReachedError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RateCardActionError.Reason"=>{:fields=>[]}, :"RateCardError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RequiredNumberError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :RateCardStatus=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} + RATECARDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return RATECARDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return RATECARDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return RATECARDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, RateCardServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service.rb old mode 100755 new mode 100644 similarity index 75% rename from dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service.rb rename to dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service.rb index 849078074..e1f802258 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_line_item_report_service.rb +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:52. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:12. require 'ads_common/savon_service' -require 'dfp_api/v201702/reconciliation_line_item_report_service_registry' +require 'dfp_api/v201802/reconciliation_line_item_report_service_registry' -module DfpApi; module V201702; module ReconciliationLineItemReportService +module DfpApi; module V201802; module ReconciliationLineItemReportService class ReconciliationLineItemReportService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_reconciliation_line_item_reports_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ReconciliationLineItemReportService + return DfpApi::V201802::ReconciliationLineItemReportService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service_registry.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service_registry.rb new file mode 100644 index 000000000..3e0f6a8f3 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_line_item_report_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:12. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ReconciliationLineItemReportService + class ReconciliationLineItemReportServiceRegistry + RECONCILIATIONLINEITEMREPORTSERVICE_METHODS = {:get_reconciliation_line_item_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_line_item_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationLineItemReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_line_item_reports=>{:input=>[{:name=>:reconciliation_line_item_reports, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_line_item_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + RECONCILIATIONLINEITEMREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BillableRevenueOverrides=>{:fields=>[{:name=>:net_billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_revenue_override, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationLineItemReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_rate, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:pricing_model, :type=>"PricingModel", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_source, :type=>"BillFrom", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:cap_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:rollover_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:net_billable_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:gross_billable_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:billable_revenue_overrides, :type=>"BillableRevenueOverrides", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationLineItemReportPage=>{:fields=>[{:name=>:results, :type=>"ReconciliationLineItemReport", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :BillFrom=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :PricingModel=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + RECONCILIATIONLINEITEMREPORTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return RECONCILIATIONLINEITEMREPORTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return RECONCILIATIONLINEITEMREPORTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return RECONCILIATIONLINEITEMREPORTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReconciliationLineItemReportServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service.rb old mode 100755 new mode 100644 similarity index 79% rename from dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service.rb rename to dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service.rb index 9100f9ccb..d2d2330c9 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_order_report_service.rb +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:51. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:11. require 'ads_common/savon_service' -require 'dfp_api/v201702/reconciliation_order_report_service_registry' +require 'dfp_api/v201802/reconciliation_order_report_service_registry' -module DfpApi; module V201702; module ReconciliationOrderReportService +module DfpApi; module V201802; module ReconciliationOrderReportService class ReconciliationOrderReportService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_reconciliation_order_reports_by_statement(*args, &block) @@ -48,7 +48,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ReconciliationOrderReportService + return DfpApi::V201802::ReconciliationOrderReportService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service_registry.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service_registry.rb new file mode 100644 index 000000000..ede97f55c --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_order_report_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:11. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ReconciliationOrderReportService + class ReconciliationOrderReportServiceRegistry + RECONCILIATIONORDERREPORTSERVICE_METHODS = {:get_reconciliation_order_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_order_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationOrderReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_reconciliation_order_report_action=>{:input=>[{:name=>:reconciliation_order_report_action, :type=>"ReconciliationOrderReportAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_reconciliation_order_report_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_order_reports=>{:input=>[{:name=>:reconciliation_order_reports, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_order_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + RECONCILIATIONORDERREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ReconciliationOrderReportAction=>{:fields=>[], :abstract=>true}, :ReconciliationOrderReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ReconciliationOrderReportStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:submission_date_time, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}, {:name=>:submitter_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_net_billable_revenue_manual_adjustment, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_gross_billable_revenue_manual_adjustment, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationOrderReportPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationOrderReport", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SubmitReconciliationOrderReports=>{:fields=>[], :base=>"ReconciliationOrderReportAction"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RevertReconciliationOrderReports=>{:fields=>[], :base=>"ReconciliationOrderReportAction"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :ReconciliationOrderReportStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + RECONCILIATIONORDERREPORTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return RECONCILIATIONORDERREPORTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return RECONCILIATIONORDERREPORTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return RECONCILIATIONORDERREPORTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReconciliationOrderReportServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service.rb old mode 100755 new mode 100644 similarity index 74% rename from dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service.rb rename to dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service.rb index e2c1ca4fe..0f1bf0721 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_report_row_service.rb +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:53. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:13. require 'ads_common/savon_service' -require 'dfp_api/v201702/reconciliation_report_row_service_registry' +require 'dfp_api/v201802/reconciliation_report_row_service_registry' -module DfpApi; module V201702; module ReconciliationReportRowService +module DfpApi; module V201802; module ReconciliationReportRowService class ReconciliationReportRowService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_reconciliation_report_rows_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ReconciliationReportRowService + return DfpApi::V201802::ReconciliationReportRowService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service_registry.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service_registry.rb new file mode 100644 index 000000000..e21f945d7 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_report_row_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:13. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ReconciliationReportRowService + class ReconciliationReportRowServiceRegistry + RECONCILIATIONREPORTROWSERVICE_METHODS = {:get_reconciliation_report_rows_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_report_rows_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportRowPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_report_rows=>{:input=>[{:name=>:reconciliation_report_rows, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_report_rows_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + RECONCILIATIONREPORTROWSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Money=>{:fields=>[{:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationImportError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationImportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationReportRow=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_report_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creative_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:order_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertiser_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_line_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:proposal_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciliation_source, :type=>"BillFrom", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_type, :type=>"RateType", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_cost_per_unit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:line_item_contracted_units_bought, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_volume, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:contracted_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:dfp_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:third_party_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:manual_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:reconciled_revenue, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:comments, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationReportRowPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationReportRow", :min_occurs=>0, :max_occurs=>:unbounded}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :BillFrom=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :RateType=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"ReconciliationImportError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + RECONCILIATIONREPORTROWSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return RECONCILIATIONREPORTROWSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return RECONCILIATIONREPORTROWSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return RECONCILIATIONREPORTROWSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReconciliationReportRowServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/reconciliation_report_service.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_report_service.rb old mode 100755 new mode 100644 similarity index 74% rename from dfp_api/lib/dfp_api/v201702/reconciliation_report_service.rb rename to dfp_api/lib/dfp_api/v201802/reconciliation_report_service.rb index 6ef04be51..f2d386d53 --- a/dfp_api/lib/dfp_api/v201702/reconciliation_report_service.rb +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_report_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:53. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:13. require 'ads_common/savon_service' -require 'dfp_api/v201702/reconciliation_report_service_registry' +require 'dfp_api/v201802/reconciliation_report_service_registry' -module DfpApi; module V201702; module ReconciliationReportService +module DfpApi; module V201802; module ReconciliationReportService class ReconciliationReportService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_reconciliation_reports_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ReconciliationReportService + return DfpApi::V201802::ReconciliationReportService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/reconciliation_report_service_registry.rb b/dfp_api/lib/dfp_api/v201802/reconciliation_report_service_registry.rb new file mode 100644 index 000000000..70b67ea1f --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/reconciliation_report_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:13. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ReconciliationReportService + class ReconciliationReportServiceRegistry + RECONCILIATIONREPORTSERVICE_METHODS = {:get_reconciliation_reports_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_reconciliation_reports_by_statement_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReportPage", :min_occurs=>0, :max_occurs=>1}]}}, :update_reconciliation_reports=>{:input=>[{:name=>:reconciliation_reports, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_reconciliation_reports_response", :fields=>[{:name=>:rval, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + RECONCILIATIONREPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationImportError=>{:fields=>[{:name=>:reason, :type=>"ReconciliationImportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReconciliationReport=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ReconciliationReportStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:notes, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ReconciliationReportPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"ReconciliationReport", :min_occurs=>0, :max_occurs=>:unbounded}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"ReconciliationError.Reason"=>{:fields=>[]}, :"ReconciliationImportError.Reason"=>{:fields=>[]}, :ReconciliationReportStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + RECONCILIATIONREPORTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return RECONCILIATIONREPORTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return RECONCILIATIONREPORTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return RECONCILIATIONREPORTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReconciliationReportServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/report_service.rb b/dfp_api/lib/dfp_api/v201802/report_service.rb old mode 100755 new mode 100644 similarity index 83% rename from dfp_api/lib/dfp_api/v201702/report_service.rb rename to dfp_api/lib/dfp_api/v201802/report_service.rb index e0a68d1c7..3dc0e003f --- a/dfp_api/lib/dfp_api/v201702/report_service.rb +++ b/dfp_api/lib/dfp_api/v201802/report_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:54. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:14. require 'ads_common/savon_service' -require 'dfp_api/v201702/report_service_registry' +require 'dfp_api/v201802/report_service_registry' -module DfpApi; module V201702; module ReportService +module DfpApi; module V201802; module ReportService class ReportService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_report_download_url(*args, &block) @@ -64,7 +64,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::ReportService + return DfpApi::V201802::ReportService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/report_service_registry.rb b/dfp_api/lib/dfp_api/v201802/report_service_registry.rb new file mode 100644 index 000000000..cb20c528f --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/report_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:14. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module ReportService + class ReportServiceRegistry + REPORTSERVICE_METHODS = {:get_report_download_url=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:export_format, :type=>"ExportFormat", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_download_url_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :original_name=>"getReportDownloadURL"}, :get_report_download_url_with_options=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_download_options, :type=>"ReportDownloadOptions", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_download_url_with_options_response", :fields=>[{:name=>:rval, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}}, :get_report_job_status=>{:input=>[{:name=>:report_job_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_job_status_response", :fields=>[{:name=>:rval, :type=>"ReportJobStatus", :min_occurs=>0, :max_occurs=>1}]}}, :get_saved_queries_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_saved_queries_by_statement_response", :fields=>[{:name=>:rval, :type=>"SavedQueryPage", :min_occurs=>0, :max_occurs=>1}]}}, :run_report_job=>{:input=>[{:name=>:report_job, :type=>"ReportJob", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"run_report_job_response", :fields=>[{:name=>:rval, :type=>"ReportJob", :min_occurs=>0, :max_occurs=>1}]}}} + REPORTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CurrencyCodeError=>{:fields=>[{:name=>:reason, :type=>"CurrencyCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportDownloadOptions=>{:fields=>[{:name=>:export_format, :type=>"ExportFormat", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_report_properties, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_totals_row, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:use_gzip_compression, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :ReportError=>{:fields=>[{:name=>:reason, :type=>"ReportError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportJob=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_query, :type=>"ReportQuery", :min_occurs=>0, :max_occurs=>1}]}, :ReportQuery=>{:fields=>[{:name=>:dimensions, :type=>"Dimension", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_unit_view, :type=>"ReportQuery.AdUnitView", :min_occurs=>0, :max_occurs=>1}, {:name=>:columns, :type=>"Column", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:dimension_attributes, :type=>"DimensionAttribute", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:custom_field_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:content_metadata_key_hierarchy_custom_targeting_key_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:date_range_type, :type=>"DateRangeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_zero_sales_rows, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:adx_report_currency, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_type, :type=>"TimeZoneType", :min_occurs=>0, :max_occurs=>1}]}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SavedQuery=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:report_query, :type=>"ReportQuery", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_compatible_with_api_version, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SavedQueryPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"SavedQuery", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :Value=>{:fields=>[], :abstract=>true}, :"ReportQuery.AdUnitView"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :Column=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CurrencyCodeError.Reason"=>{:fields=>[]}, :DateRangeType=>{:fields=>[]}, :Dimension=>{:fields=>[]}, :DimensionAttribute=>{:fields=>[]}, :ExportFormat=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"ReportError.Reason"=>{:fields=>[]}, :ReportJobStatus=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TimeZoneType=>{:fields=>[]}} + REPORTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return REPORTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return REPORTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return REPORTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReportServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service.rb b/dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service.rb old mode 100755 new mode 100644 similarity index 74% rename from dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service.rb rename to dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service.rb index 66938c057..eff7b1c30 --- a/dfp_api/lib/dfp_api/v201702/suggested_ad_unit_service.rb +++ b/dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:57. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:15. require 'ads_common/savon_service' -require 'dfp_api/v201702/suggested_ad_unit_service_registry' +require 'dfp_api/v201802/suggested_ad_unit_service_registry' -module DfpApi; module V201702; module SuggestedAdUnitService +module DfpApi; module V201802; module SuggestedAdUnitService class SuggestedAdUnitService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_suggested_ad_units_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::SuggestedAdUnitService + return DfpApi::V201802::SuggestedAdUnitService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service_registry.rb b/dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service_registry.rb new file mode 100644 index 000000000..680249bf0 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/suggested_ad_unit_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:15. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module SuggestedAdUnitService + class SuggestedAdUnitServiceRegistry + SUGGESTEDADUNITSERVICE_METHODS = {:get_suggested_ad_units_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_suggested_ad_units_by_statement_response", :fields=>[{:name=>:rval, :type=>"SuggestedAdUnitPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_suggested_ad_unit_action=>{:input=>[{:name=>:suggested_ad_unit_action, :type=>"SuggestedAdUnitAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_suggested_ad_unit_action_response", :fields=>[{:name=>:rval, :type=>"SuggestedAdUnitUpdateResult", :min_occurs=>0, :max_occurs=>1}]}}} + SUGGESTEDADUNITSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :AdUnitParent=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_unit_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveSuggestedAdUnits=>{:fields=>[], :base=>"SuggestedAdUnitAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdUnitSize=>{:fields=>[{:name=>:size, :type=>"Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:environment_type, :type=>"EnvironmentType", :min_occurs=>0, :max_occurs=>1}, {:name=>:companions, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:full_display_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :InventoryUnitSizesError=>{:fields=>[{:name=>:reason, :type=>"InventoryUnitSizesError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelEntityAssociationError=>{:fields=>[{:name=>:reason, :type=>"LabelEntityAssociationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :Size=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_aspect_ratio, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :SuggestedAdUnitAction=>{:fields=>[], :abstract=>true}, :SuggestedAdUnit=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_requests, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:parent_path, :type=>"AdUnitParent", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:target_window, :type=>"AdUnit.TargetWindow", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_platform, :type=>"TargetPlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:suggested_ad_unit_sizes, :type=>"AdUnitSize", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SuggestedAdUnitPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"SuggestedAdUnit", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SuggestedAdUnitUpdateResult=>{:fields=>[{:name=>:new_ad_unit_ids, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :Value=>{:fields=>[], :abstract=>true}, :"AdUnit.TargetWindow"=>{:fields=>[]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :EnvironmentType=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InventoryUnitSizesError.Reason"=>{:fields=>[]}, :"LabelEntityAssociationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TargetPlatform=>{:fields=>[]}} + SUGGESTEDADUNITSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return SUGGESTEDADUNITSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return SUGGESTEDADUNITSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return SUGGESTEDADUNITSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, SuggestedAdUnitServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/team_service.rb b/dfp_api/lib/dfp_api/v201802/team_service.rb old mode 100755 new mode 100644 similarity index 66% rename from dfp_api/lib/dfp_api/v201702/team_service.rb rename to dfp_api/lib/dfp_api/v201802/team_service.rb index 7fef42a17..c63a0a893 --- a/dfp_api/lib/dfp_api/v201702/team_service.rb +++ b/dfp_api/lib/dfp_api/v201802/team_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:58. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:16. require 'ads_common/savon_service' -require 'dfp_api/v201702/team_service_registry' +require 'dfp_api/v201802/team_service_registry' -module DfpApi; module V201702; module TeamService +module DfpApi; module V201802; module TeamService class TeamService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_teams(*args, &block) @@ -33,6 +33,14 @@ def get_teams_by_statement_to_xml(*args) return get_soap_xml('get_teams_by_statement', args) end + def perform_team_action(*args, &block) + return execute_action('perform_team_action', args, &block) + end + + def perform_team_action_to_xml(*args) + return get_soap_xml('perform_team_action', args) + end + def update_teams(*args, &block) return execute_action('update_teams', args, &block) end @@ -48,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::TeamService + return DfpApi::V201802::TeamService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/team_service_registry.rb b/dfp_api/lib/dfp_api/v201802/team_service_registry.rb new file mode 100644 index 000000000..6078b623d --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/team_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:16. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module TeamService + class TeamServiceRegistry + TEAMSERVICE_METHODS = {:create_teams=>{:input=>[{:name=>:teams, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_teams_response", :fields=>[{:name=>:rval, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_teams_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_teams_by_statement_response", :fields=>[{:name=>:rval, :type=>"TeamPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_team_action=>{:input=>[{:name=>:team_action, :type=>"TeamAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_team_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_teams=>{:input=>[{:name=>:teams, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_teams_response", :fields=>[{:name=>:rval, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + TEAMSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateTeams=>{:fields=>[], :base=>"TeamAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateTeams=>{:fields=>[], :base=>"TeamAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :OrderError=>{:fields=>[{:name=>:reason, :type=>"OrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamAction=>{:fields=>[], :abstract=>true}, :Team=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"TeamStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_all_companies, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:has_all_inventory, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TeamPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"Team", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OrderError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TeamAccessType=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :TeamStatus=>{:fields=>[]}} + TEAMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return TEAMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return TEAMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return TEAMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, TeamServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/user_service.rb b/dfp_api/lib/dfp_api/v201802/user_service.rb old mode 100755 new mode 100644 similarity index 84% rename from dfp_api/lib/dfp_api/v201702/user_service.rb rename to dfp_api/lib/dfp_api/v201802/user_service.rb index 8a654943c..f4213382a --- a/dfp_api/lib/dfp_api/v201702/user_service.rb +++ b/dfp_api/lib/dfp_api/v201802/user_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:17:58. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:16. require 'ads_common/savon_service' -require 'dfp_api/v201702/user_service_registry' +require 'dfp_api/v201802/user_service_registry' -module DfpApi; module V201702; module UserService +module DfpApi; module V201802; module UserService class UserService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_users(*args, &block) @@ -72,7 +72,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::UserService + return DfpApi::V201802::UserService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/user_service_registry.rb b/dfp_api/lib/dfp_api/v201802/user_service_registry.rb new file mode 100644 index 000000000..b3686f667 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/user_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:16. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module UserService + class UserServiceRegistry + USERSERVICE_METHODS = {:create_users=>{:input=>[{:name=>:users, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_users_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_all_roles=>{:input=>[], :output=>{:name=>"get_all_roles_response", :fields=>[{:name=>:rval, :type=>"Role", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_current_user=>{:input=>[], :output=>{:name=>"get_current_user_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>1}]}}, :get_users_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_users_by_statement_response", :fields=>[{:name=>:rval, :type=>"UserPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_user_action=>{:input=>[{:name=>:user_action, :type=>"UserAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_user_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_users=>{:input=>[{:name=>:users, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_users_response", :fields=>[{:name=>:rval, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + USERSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ActivateUsers=>{:fields=>[], :base=>"UserAction"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomFieldValueError=>{:fields=>[{:name=>:reason, :type=>"CustomFieldValueError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeactivateUsers=>{:fields=>[], :base=>"UserAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InvalidEmailError=>{:fields=>[{:name=>:reason, :type=>"InvalidEmailError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Role=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"RoleStatus", :min_occurs=>0, :max_occurs=>1}]}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :TimeZoneError=>{:fields=>[{:name=>:reason, :type=>"TimeZoneError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TokenError=>{:fields=>[{:name=>:reason, :type=>"TokenError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TypeError=>{:fields=>[], :base=>"ApiError"}, :UniqueError=>{:fields=>[], :base=>"ApiError"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserAction=>{:fields=>[], :abstract=>true}, :User=>{:fields=>[{:name=>:is_active, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_email_notification_allowed, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_service_account, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:orders_ui_local_time_zone_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"UserRecord"}, :UserPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"User", :min_occurs=>0, :max_occurs=>:unbounded}]}, :UserRecord=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:role_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:role_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomFieldValueError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"InvalidEmailError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :RoleStatus=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}, :"TimeZoneError.Reason"=>{:fields=>[]}, :"TokenError.Reason"=>{:fields=>[]}} + USERSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return USERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return USERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return USERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, UserServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/user_team_association_service.rb b/dfp_api/lib/dfp_api/v201802/user_team_association_service.rb old mode 100755 new mode 100644 similarity index 81% rename from dfp_api/lib/dfp_api/v201702/user_team_association_service.rb rename to dfp_api/lib/dfp_api/v201802/user_team_association_service.rb index 07b5cf6b8..3be6d712a --- a/dfp_api/lib/dfp_api/v201702/user_team_association_service.rb +++ b/dfp_api/lib/dfp_api/v201802/user_team_association_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:18:00. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:17. require 'ads_common/savon_service' -require 'dfp_api/v201702/user_team_association_service_registry' +require 'dfp_api/v201802/user_team_association_service_registry' -module DfpApi; module V201702; module UserTeamAssociationService +module DfpApi; module V201802; module UserTeamAssociationService class UserTeamAssociationService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def create_user_team_associations(*args, &block) @@ -56,7 +56,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::UserTeamAssociationService + return DfpApi::V201802::UserTeamAssociationService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/user_team_association_service_registry.rb b/dfp_api/lib/dfp_api/v201802/user_team_association_service_registry.rb new file mode 100644 index 000000000..c98495413 --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/user_team_association_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:17. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module UserTeamAssociationService + class UserTeamAssociationServiceRegistry + USERTEAMASSOCIATIONSERVICE_METHODS = {:create_user_team_associations=>{:input=>[{:name=>:user_team_associations, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"create_user_team_associations_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_user_team_associations_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_user_team_associations_by_statement_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociationPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_user_team_association_action=>{:input=>[{:name=>:user_team_association_action, :type=>"UserTeamAssociationAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_user_team_association_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}, :update_user_team_associations=>{:input=>[{:name=>:user_team_associations, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"update_user_team_associations_response", :fields=>[{:name=>:rval, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + USERTEAMASSOCIATIONSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DeleteUserTeamAssociations=>{:fields=>[], :base=>"UserTeamAssociationAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TeamError=>{:fields=>[{:name=>:reason, :type=>"TeamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :UserRecordTeamAssociation=>{:fields=>[{:name=>:team_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:overridden_team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_team_access_type, :type=>"TeamAccessType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :UserTeamAssociationAction=>{:fields=>[], :abstract=>true}, :UserTeamAssociation=>{:fields=>[{:name=>:user_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"UserRecordTeamAssociation"}, :UserTeamAssociationPage=>{:fields=>[{:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:results, :type=>"UserTeamAssociation", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Value=>{:fields=>[], :abstract=>true}, :"ApiVersionError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :TeamAccessType=>{:fields=>[]}, :"TeamError.Reason"=>{:fields=>[]}} + USERTEAMASSOCIATIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return USERTEAMASSOCIATIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return USERTEAMASSOCIATIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return USERTEAMASSOCIATIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, UserTeamAssociationServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/v201702/workflow_request_service.rb b/dfp_api/lib/dfp_api/v201802/workflow_request_service.rb old mode 100755 new mode 100644 similarity index 74% rename from dfp_api/lib/dfp_api/v201702/workflow_request_service.rb rename to dfp_api/lib/dfp_api/v201802/workflow_request_service.rb index 73121df45..99c6c4cdf --- a/dfp_api/lib/dfp_api/v201702/workflow_request_service.rb +++ b/dfp_api/lib/dfp_api/v201802/workflow_request_service.rb @@ -2,19 +2,19 @@ # # This is auto-generated code, changes will be overwritten. # -# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # -# Code generated by AdsCommon library 0.12.6 on 2017-02-15 12:18:01. +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:18. require 'ads_common/savon_service' -require 'dfp_api/v201702/workflow_request_service_registry' +require 'dfp_api/v201802/workflow_request_service_registry' -module DfpApi; module V201702; module WorkflowRequestService +module DfpApi; module V201802; module WorkflowRequestService class WorkflowRequestService < AdsCommon::SavonService def initialize(config, endpoint) - namespace = 'https://www.google.com/apis/ads/publisher/v201702' - super(config, endpoint, namespace, :v201702) + namespace = 'https://www.google.com/apis/ads/publisher/v201802' + super(config, endpoint, namespace, :v201802) end def get_workflow_requests_by_statement(*args, &block) @@ -40,7 +40,7 @@ def get_service_registry() end def get_module() - return DfpApi::V201702::WorkflowRequestService + return DfpApi::V201802::WorkflowRequestService end end end; end; end diff --git a/dfp_api/lib/dfp_api/v201802/workflow_request_service_registry.rb b/dfp_api/lib/dfp_api/v201802/workflow_request_service_registry.rb new file mode 100644 index 000000000..cce78509f --- /dev/null +++ b/dfp_api/lib/dfp_api/v201802/workflow_request_service_registry.rb @@ -0,0 +1,45 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2018, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 1.0.1 on 2018-02-07 17:21:18. + +require 'dfp_api/errors' + +module DfpApi; module V201802; module WorkflowRequestService + class WorkflowRequestServiceRegistry + WORKFLOWREQUESTSERVICE_METHODS = {:get_workflow_requests_by_statement=>{:input=>[{:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_workflow_requests_by_statement_response", :fields=>[{:name=>:rval, :type=>"WorkflowRequestPage", :min_occurs=>0, :max_occurs=>1}]}}, :perform_workflow_request_action=>{:input=>[{:name=>:action, :type=>"WorkflowRequestAction", :min_occurs=>0, :max_occurs=>1}, {:name=>:filter_statement, :type=>"Statement", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"perform_workflow_request_action_response", :fields=>[{:name=>:rval, :type=>"UpdateResult", :min_occurs=>0, :max_occurs=>1}]}}} + WORKFLOWREQUESTSERVICE_TYPES = {:ObjectValue=>{:fields=>[], :abstract=>true, :base=>"Value"}, :ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_path_elements, :type=>"FieldPathElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApiVersionError=>{:fields=>[{:name=>:reason, :type=>"ApiVersionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ApproveWorkflowApprovalRequests=>{:fields=>[{:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequestAction"}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowRequest=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:workflow_rule_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:entity_type, :type=>"WorkflowEntityType", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"WorkflowRequestType", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanValue=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CommonError=>{:fields=>[{:name=>:reason, :type=>"CommonError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomTargetingError=>{:fields=>[{:name=>:reason, :type=>"CustomTargetingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateTime=>{:fields=>[{:name=>:date, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:minute, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:second, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_zone_id, :original_name=>"timeZoneID", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateTimeValue=>{:fields=>[{:name=>:value, :type=>"DateTime", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :DateValue=>{:fields=>[{:name=>:value, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :SkipWorkflowExternalConditionRequests=>{:fields=>[], :base=>"WorkflowRequestAction"}, :FeatureError=>{:fields=>[{:name=>:reason, :type=>"FeatureError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FieldPathElement=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ForecastError=>{:fields=>[{:name=>:reason, :type=>"ForecastError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LineItemOperationError=>{:fields=>[{:name=>:reason, :type=>"LineItemOperationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotNullError=>{:fields=>[{:name=>:reason, :type=>"NotNullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :ParseError=>{:fields=>[{:name=>:reason, :type=>"ParseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TriggerWorkflowExternalConditionRequests=>{:fields=>[], :base=>"WorkflowRequestAction"}, :PermissionError=>{:fields=>[{:name=>:reason, :type=>"PermissionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProposalLineItemActionError=>{:fields=>[{:name=>:reason, :type=>"ProposalLineItemActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageContextError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageContextError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PublisherQueryLanguageSyntaxError=>{:fields=>[{:name=>:reason, :type=>"PublisherQueryLanguageSyntaxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :QuotaError=>{:fields=>[{:name=>:reason, :type=>"QuotaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectWorkflowApprovalRequests=>{:fields=>[{:name=>:comment, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequestAction"}, :RequiredCollectionError=>{:fields=>[{:name=>:reason, :type=>"RequiredCollectionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ServerError=>{:fields=>[{:name=>:reason, :type=>"ServerError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SetValue=>{:fields=>[{:name=>:values, :type=>"Value", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Value"}, :SoapRequestHeader=>{:fields=>[{:name=>:network_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Statement=>{:fields=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :StatementError=>{:fields=>[{:name=>:reason, :type=>"StatementError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_ValueMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Value", :min_occurs=>0, :max_occurs=>1}]}, :TextValue=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Value"}, :UpdateResult=>{:fields=>[{:name=>:num_changes, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Value=>{:fields=>[], :abstract=>true}, :WorkflowActionError=>{:fields=>[{:name=>:reason, :type=>"WorkflowActionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowApprovalRequest=>{:fields=>[{:name=>:status, :type=>"WorkflowApprovalRequestStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequest"}, :WorkflowExternalConditionRequest=>{:fields=>[{:name=>:status, :type=>"WorkflowEvaluationStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"WorkflowRequest"}, :WorkflowRequestAction=>{:fields=>[], :abstract=>true}, :WorkflowRequestError=>{:fields=>[{:name=>:reason, :type=>"WorkflowRequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :WorkflowRequestPage=>{:fields=>[{:name=>:results, :type=>"WorkflowRequest", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_result_set_size, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :"ApiVersionError.Reason"=>{:fields=>[]}, :WorkflowApprovalRequestStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CommonError.Reason"=>{:fields=>[]}, :"CustomTargetingError.Reason"=>{:fields=>[]}, :"FeatureError.Reason"=>{:fields=>[]}, :"ForecastError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"LineItemOperationError.Reason"=>{:fields=>[]}, :"NotNullError.Reason"=>{:fields=>[]}, :"ParseError.Reason"=>{:fields=>[]}, :"PermissionError.Reason"=>{:fields=>[]}, :"ProposalActionError.Reason"=>{:fields=>[]}, :"ProposalLineItemActionError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageContextError.Reason"=>{:fields=>[]}, :"PublisherQueryLanguageSyntaxError.Reason"=>{:fields=>[]}, :"QuotaError.Reason"=>{:fields=>[]}, :"RequiredCollectionError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"ServerError.Reason"=>{:fields=>[]}, :"StatementError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"WorkflowActionError.Reason"=>{:fields=>[]}, :WorkflowEntityType=>{:fields=>[]}, :"WorkflowRequestError.Reason"=>{:fields=>[]}, :WorkflowRequestType=>{:fields=>[]}, :WorkflowEvaluationStatus=>{:fields=>[]}} + WORKFLOWREQUESTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return WORKFLOWREQUESTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return WORKFLOWREQUESTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return WORKFLOWREQUESTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < DfpApi::Errors::ApiException + attr_reader :message # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, WorkflowRequestServiceRegistry) + end + end +end; end; end diff --git a/dfp_api/lib/dfp_api/version.rb b/dfp_api/lib/dfp_api/version.rb old mode 100755 new mode 100644 index bcbd47793..d31f041fe --- a/dfp_api/lib/dfp_api/version.rb +++ b/dfp_api/lib/dfp_api/version.rb @@ -19,6 +19,6 @@ module DfpApi module ApiConfig - CLIENT_LIB_VERSION = '1.1.0' + CLIENT_LIB_VERSION = '1.2.0' end end diff --git a/dfp_api/test/bugs/test_issue_00000007.rb b/dfp_api/test/bugs/test_issue_00000007.rb index 84b150450..664211835 100755 --- a/dfp_api/test/bugs/test_issue_00000007.rb +++ b/dfp_api/test/bugs/test_issue_00000007.rb @@ -25,7 +25,7 @@ require 'ads_common/config' require 'ads_common/savon_service' require 'ads_savon/soap/response' -require 'dfp_api/v201711/line_item_service' +require 'dfp_api/v201802/line_item_service' class HeaderHandler def prepare_request(http, soap) @@ -45,11 +45,11 @@ def initialize(namespace, endpoint, version) end def get_module() - return DfpApi::V201711::LineItemService + return DfpApi::V201802::LineItemService end def get_service_registry() - return DfpApi::V201711::LineItemService::LineItemServiceRegistry + return DfpApi::V201802::LineItemService::LineItemServiceRegistry end end @@ -61,8 +61,8 @@ class TestDfpIssue7 < Test::Unit::TestCase TEST_NAMESPACE = 'https://ads.google.com/apis/ads/publisher/' TEST_ENDPOINT = - 'https://ads.google.com/apis/ads/publisher/v201711/LineItemService?wsdl' - TEST_VERSION = :v201711 + 'https://ads.google.com/apis/ads/publisher/v201802/LineItemService?wsdl' + TEST_VERSION = :v201802 def test_issue_7_request() args = {:line_items => [ @@ -95,7 +95,7 @@ def test_issue_7_response() def get_xml_response_text() return < - + 1 0 diff --git a/dfp_api/test/bugs/test_issue_00000081.rb b/dfp_api/test/bugs/test_issue_00000081.rb index ba7acc736..80f08f615 100755 --- a/dfp_api/test/bugs/test_issue_00000081.rb +++ b/dfp_api/test/bugs/test_issue_00000081.rb @@ -23,7 +23,7 @@ require 'test/unit' require 'ads_common/savon_service' -require 'dfp_api/v201711/line_item_service' +require 'dfp_api/v201802/line_item_service' # SavonService is abstract, defining a child class for the test. class StubService81 < AdsCommon::SavonService @@ -37,7 +37,7 @@ def initialize(namespace, endpoint, version) end def get_module() - return DfpApi::V201711::LineItemService + return DfpApi::V201802::LineItemService end end @@ -46,8 +46,8 @@ class TestDfpIssue81 < Test::Unit::TestCase TEST_NAMESPACE = 'https://ads.google.com/apis/ads/publisher/' TEST_ENDPOINT = ( - 'https://ads.google.com/apis/ads/publisher/v201711/LineItemService?wsdl') - TEST_VERSION = :v201711 + 'https://ads.google.com/apis/ads/publisher/v201802/LineItemService?wsdl') + TEST_VERSION = :v201802 def setup() @stub_service = @@ -64,7 +64,7 @@ def test_issue_81() data = @nori.parse(get_xml_text())[:envelope][:body] savon_service = StubService81.new(TEST_NAMESPACE, TEST_ENDPOINT, TEST_VERSION) - assert_instance_of(DfpApi::V201711::LineItemService::ApiException, + assert_instance_of(DfpApi::V201802::LineItemService::ApiException, savon_service.send(:exception_for_soap_fault, data)) end @@ -73,7 +73,7 @@ def get_xml_text() - + abc123 658 @@ -86,7 +86,7 @@ def get_xml_text() + xmlns="https://www.google.com/apis/ads/publisher/v201802"> [PublisherQueryLanguageContextError.UNEXECUTABLE @ Unknown column: 'blah'] diff --git a/dfp_api/test/dfp_api/test_dfp_datetime.rb b/dfp_api/test/dfp_api/test_dfp_datetime.rb new file mode 100755 index 000000000..d62f1cd5c --- /dev/null +++ b/dfp_api/test/dfp_api/test_dfp_datetime.rb @@ -0,0 +1,338 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Tests the DfpDate and DfpDateTime. + +require 'test/unit' +require 'dfp_api' + + +class TestDfpApi < Test::Unit::TestCase + def setup() + @dfp = DfpApi::Api.new({}) + end + + # Test initializer with integer params + def test_initialize_date() + date = @dfp.date(2017, 11, 7) + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(7, date.day) + end + + # Test initializer with hash param + def test_initialize_date_with_hash() + date = @dfp.date({:year => 2017, :month => 11, :day => 7}) + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(7, date.day) + end + + # Test initializer with Date param + def test_initialize_date_with_date() + date = @dfp.date(Date.new(2017, 11, 7)) + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(7, date.day) + end + + # Test adding a Number to a DfpApi::DfpDate + def test_date_plus_number() + date = @dfp.date(2017, 11, 7) + date = date + 1 + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(8, date.day) + assert_true(date.is_a? DfpApi::DfpDate) + end + + # Test subtracting a Number from a DfpApi::DfpDate + def test_date_minus_number() + date = @dfp.date(2017, 11, 7) + date = date - 1 + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(6, date.day) + assert_true(date.is_a? DfpApi::DfpDate) + end + + # Test shifting a DfpApi::DfpDate right by some number of months + def test_date_shift_right() + date = @dfp.date(2017, 10, 7) + date = date >> 1 + assert_equal(2017, date.year) + assert_equal(11, date.month) + assert_equal(7, date.day) + assert_true(date.is_a? DfpApi::DfpDate) + end + + # Test shifting a DfpApi::DfpDate left by some number of months + def test_date_shift_left() + date = @dfp.date(2017, 11, 7) + date = date << 1 + assert_equal(2017, date.year) + assert_equal(10, date.month) + assert_equal(7, date.day) + assert_true(date.is_a? DfpApi::DfpDate) + end + + # Test converting a DfpApi::DfpDate to a hash + def test_date_to_h() + date = @dfp.date(2017, 11, 7) + hash = {:year => 2017, :month => 11, :day => 7} + assert_equal(hash, date.to_h) + end + + # Test initializer with standard params + def test_initialize_datetime() + datetime = @dfp.datetime( + 2017, 11, 7, 17, 30, 10, 'America/New_York' + ) + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7, datetime.day) + assert_equal(17, datetime.hour) + assert_equal(30, datetime.min) + assert_equal(10, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + end + + # Test initializer with hash param + def test_initialize_datetime_with_hash() + hash = { + :date => {:year => 2017, :month => 11, :day => 7}, + :hour => 17, :minute => 30, :second => 10, + :time_zone_id => 'America/New_York' + } + datetime = @dfp.datetime(hash) + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7, datetime.day) + assert_equal(17, datetime.hour) + assert_equal(30, datetime.min) + assert_equal(10, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + end + + # Test initializer with Time param + def test_initialize_datetime_with_time() + time = Time.new(2017, 11, 7, 17, 30, 10) + datetime = @dfp.datetime(time, 'America/New_York') + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7, datetime.day) + assert_equal(17, datetime.hour) + assert_equal(30, datetime.min) + assert_equal(10, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + end + + # Test initializer with DateTime param + def test_initialize_datetime_with_datetime() + time = DateTime.new(2017, 11, 7, 17, 30, 10) + datetime = @dfp.datetime(time, 'America/New_York') + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7, datetime.day) + assert_equal(17, datetime.hour) + assert_equal(30, datetime.min) + assert_equal(10, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + end + + # Test initializer error with no timezone param + def test_initialize_datetime_without_timezone() + assert_raise(RuntimeError) do + datetime = @dfp.datetime(2017, 11, 7, 17, 30, 10) + end + end + + # Test initializer with standard params in Pacific time + def test_initialize_datetime_in_pacific_time() + datetime = @dfp.datetime( + 2017, 11, 7, 17, 30, 10, 'America/Los_Angeles' + ) + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7, datetime.day) + assert_equal(17, datetime.hour) + assert_equal(30, datetime.min) + assert_equal(10, datetime.sec) + assert_equal('America/Los_Angeles', datetime.timezone.identifier) + assert_equal(-28800, datetime.utc_offset) + end + + # Test adding a Number to a DfpApi::DfpDateTime + def test_datetime_plus_number() + sec_delta = 5 # Between 0 and 49 + min_delta = 10 # Between 0 and 29 + hour_delta = 1 # Between 0 and 42 + day_delta = 3 # Between 0 and 23 + datetime = @dfp.datetime( + 2017, 11, 7, 17, 30, 10, 'America/New_York' + ) + datetime = datetime + sec_delta + min_delta * 60 + hour_delta * 60 * 60 + + day_delta * 60 * 60 * 24 + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7 + day_delta, datetime.day) + assert_equal(17 + hour_delta, datetime.hour) + assert_equal(30 + min_delta, datetime.min) + assert_equal(10 + sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test subtracting a Number from a DfpApi::DfpDateTime + def test_datetime_minus_number() + sec_delta = 5 # Between 0 and 10 + min_delta = 10 # Between 0 and 30 + hour_delta = 1 # Between 0 and 17 + day_delta = 3 # Between 0 and 6 + datetime = @dfp.datetime( + 2017, 11, 7, 17, 30, 10, 'America/New_York' + ) + datetime = datetime - sec_delta - min_delta * 60 - hour_delta * 60 * 60 - + day_delta * 60 * 60 * 24 + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(7 - day_delta, datetime.day) + assert_equal(17 - hour_delta, datetime.hour) + assert_equal(30 - min_delta, datetime.min) + assert_equal(10 - sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test adding a Number to a DfpApi::DfpDateTime on a month boundary + def test_datetime_plus_number_month_boundary() + sec_delta = 5 # Between 0 and 49 + min_delta = 10 # Between 0 and 29 + hour_delta = 1 # Between 0 and 42 + day_delta = 3 # Between 0 and 23 + datetime = @dfp.datetime( + 2017, 11, 30, 17, 30, 10, 'America/New_York' + ) + datetime = datetime + sec_delta + min_delta * 60 + hour_delta * 60 * 60 + + day_delta * 60 * 60 * 24 + assert_equal(2017, datetime.year) + assert_equal(12, datetime.month) + assert_equal(day_delta, datetime.day) + assert_equal(17 + hour_delta, datetime.hour) + assert_equal(30 + min_delta, datetime.min) + assert_equal(10 + sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test subtracting a Number from a DfpApi::DfpDateTime on a month boundary + def test_datetime_minus_number_month_boundary() + sec_delta = 5 # Between 0 and 10 + min_delta = 10 # Between 0 and 30 + hour_delta = 1 # Between 0 and 17 + day_delta = 3 # Between 0 and 6 + datetime = @dfp.datetime( + 2017, 12, 1, 17, 30, 10, 'America/New_York' + ) + datetime = datetime - sec_delta - min_delta * 60 - hour_delta * 60 * 60 - + day_delta * 60 * 60 * 24 + assert_equal(2017, datetime.year) + assert_equal(11, datetime.month) + assert_equal(31 - day_delta, datetime.day) + assert_equal(17 - hour_delta, datetime.hour) + assert_equal(30 - min_delta, datetime.min) + assert_equal(10 - sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test adding a Number to a DfpApi::DfpDateTime on a year boundary + def test_datetime_plus_number_year_boundary() + sec_delta = 5 # Between 0 and 49 + min_delta = 10 # Between 0 and 29 + hour_delta = 1 # Between 0 and 42 + day_delta = 3 # Between 0 and 23 + datetime = @dfp.datetime( + 2017, 12, 31, 17, 30, 10, 'America/New_York' + ) + datetime = datetime + sec_delta + min_delta * 60 + hour_delta * 60 * 60 + + day_delta * 60 * 60 * 24 + assert_equal(2018, datetime.year) + assert_equal(1, datetime.month) + assert_equal(day_delta, datetime.day) + assert_equal(17 + hour_delta, datetime.hour) + assert_equal(30 + min_delta, datetime.min) + assert_equal(10 + sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test subtracting a Number from a DfpApi::DfpDateTime on a year boundary + def test_datetime_minus_number_year_boundary() + sec_delta = 5 # Between 0 and 10 + min_delta = 10 # Between 0 and 30 + hour_delta = 1 # Between 0 and 17 + day_delta = 3 # Between 0 and 6 + datetime = @dfp.datetime( + 2018, 1, 1, 17, 30, 10, 'America/New_York' + ) + datetime = datetime - sec_delta - min_delta * 60 - hour_delta * 60 * 60 - + day_delta * 60 * 60 * 24 + assert_equal(2017, datetime.year) + assert_equal(12, datetime.month) + assert_equal(32 - day_delta, datetime.day) + assert_equal(17 - hour_delta, datetime.hour) + assert_equal(30 - min_delta, datetime.min) + assert_equal(10 - sec_delta, datetime.sec) + assert_equal('America/New_York', datetime.timezone.identifier) + assert_equal(-18000, datetime.utc_offset) + assert_true(datetime.is_a? DfpApi::DfpDateTime) + end + + # Test converting a DfpApi::DfpDateTime into a hash + def test_datetime_to_h() + datetime = @dfp.datetime(2017, 11, 7, 17, 30, 10, 'America/New_York') + hash = { + :date => {:year => 2017, :month => 11, :day => 7}, + :hour => 17, :minute => 30, :second => 10, + :time_zone_id => 'America/New_York' + } + assert_equal(hash, datetime.to_h) + end + + # Test that restricted Time methods throw an error on DfpApi::DfpDateTime + def test_datetime_restricted_methods() + datetime = @dfp.utc() + restricted_functions = [:dst?, :getgm, :getlocal, :getutc, :gmt, :gmtime, + :gmtoff, :isdst, :localtime, :utc] + restricted_functions.each do |function| + assert_raise(NoMethodError) do + datetime.send(function) + end + end + end +end diff --git a/dfp_api/test/dfp_api/test_dfp_statement.rb b/dfp_api/test/dfp_api/test_dfp_statement.rb new file mode 100755 index 000000000..3682f3e4e --- /dev/null +++ b/dfp_api/test/dfp_api/test_dfp_statement.rb @@ -0,0 +1,255 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Tests the StatementBuilder utility. + +require 'test/unit' +require 'dfp_api' +require 'date' + + +KEYWORDS = ['SELECT', 'FROM', 'WHERE', 'ORDER BY', 'LIMIT', 'OFFSET'] +DEFAULT_LIMIT = 500 +DEFAULT_OFFSET = 0 + + +def keywords_downcase(query) + KEYWORDS.each do |keyword| + # Case-insensitively match the keyword and replace it with lowercase form + query = query.sub(/#{keyword}/i, keyword.downcase) + end + query +end + + +class TestDfpApi < Test::Unit::TestCase + def setup() + @dfp = DfpApi::Api.new({}) + end + + # Test initializer with only SELECT and FROM clauses + def test_basic_query_initalize_with_block() + columns = 'TestColumnA, TestColumnB' + table = 'TestTable' + sb = @dfp.new_statement_builder do |b| + b.select = columns + b.from = table + end + query = 'select ' + columns + ' from ' + table + ' limit ' + + DEFAULT_LIMIT.to_s + ' offset ' + DEFAULT_OFFSET.to_s + assert_equal(query, keywords_downcase(sb.to_statement()[:query])) + end + + # Test configure method with only SELECT and FROM clauses + def test_basic_query_configure_method + columns = 'TestColumnA, TestColumnB' + table = 'TestTable' + sb = @dfp.new_statement_builder + sb.configure do |b| + b.select = columns + b.from = table + end + query = 'select ' + columns + ' from ' + table + ' limit ' + + DEFAULT_LIMIT.to_s + ' offset ' + DEFAULT_OFFSET.to_s + assert_equal(query, keywords_downcase(sb.to_statement()[:query])) + end + + # Test initializer with all options + def test_complex_query_initialize_with_block() + bind_variable_name = 'bind_variable' + bind_variable_value = 100 # Expected to be a number + columns = 'TestColumnA, TestColumnB' + table = 'TestTable' + condition = 'TestColumnA > :' + bind_variable_name + order_property = 'TestColumnA' + ascending = false + limit = 1000 + offset = 500 + sb = @dfp.new_statement_builder do |b| + b.select = columns + b.from = table + b.where = condition + b.order_by = order_property + b.ascending = ascending + b.limit = limit + b.offset = offset + b.with_bind_variable(bind_variable_name, bind_variable_value) + end + query = 'select ' + columns + ' from ' + table + ' where ' + + condition + ' order by ' + order_property + + (ascending ? ' ASC' : ' DESC') + ' limit ' + limit.to_s + + ' offset ' + offset.to_s + values = [{ + :key => bind_variable_name, + :value => { + :xsi_type => 'NumberValue', + :value => bind_variable_value + } + }] + assert_equal(query, keywords_downcase(sb.to_statement()[:query])) + assert_equal(values, sb.to_statement()[:values]) + end + + # Test all bind variable types + def test_bind_variable_type_inference() + sb = @dfp.new_statement_builder do |b| + b.with_bind_variable('num_var', 1) + b.with_bind_variable('text_var', 'asdf') + b.with_bind_variable('bool_var', true) + b.with_bind_variable('set_var', [1,2,3]) + b.with_bind_variable('date_var', @dfp.date()) + b.with_bind_variable('datetime_var', @dfp.datetime('UTC')) + end + values = sb.to_statement()[:values] + assert_equal('NumberValue', + values.find {|v| v[:key] == 'num_var'}[:value][:xsi_type]) + assert_equal('TextValue', + values.find {|v| v[:key] == 'text_var'}[:value][:xsi_type]) + assert_equal('BooleanValue', + values.find {|v| v[:key] == 'bool_var'}[:value][:xsi_type]) + assert_equal('SetValue', + values.find {|v| v[:key] == 'set_var'}[:value][:xsi_type]) + assert_equal('DateValue', + values.find {|v| v[:key] == 'date_var'}[:value][:xsi_type]) + assert_equal('DateTimeValue', + values.find {|v| v[:key] == 'datetime_var'}[:value][:xsi_type]) + end + + # Test only last variable for a given key is retained + def test_multiple_settings_of_bind_variable() + sb = @dfp.new_statement_builder + sb.with_bind_variable('var_name', 123) + sb.with_bind_variable('var_name', 'abc') + values = [{:key => 'var_name', + :value => {:xsi_type => 'TextValue', :value => 'abc'}}] + assert_equal(values, sb.to_statement()[:values]) + end + + # Test validation of SELECT clause without FROM clause + def test_validation_select_without_from() + sb = @dfp.new_statement_builder { |b| b.select = 'TestColumnA' } + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of FROM clause without SELECT clause + def test_validation_from_without_select() + sb = @dfp.new_statement_builder { |b| b.from = 'TestTable' } + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of SELECT clause with empty string for FROM clause + def test_validation_select_with_empty_from() + sb = @dfp.new_statement_builder do |b| + b.select = 'TestColumnA' + b.from = '' + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of FROM clause with empty string for SELECT clause + def test_validation_from_with_empty_select() + sb = @dfp.new_statement_builder do |b| + b.select = '' + b.from = 'TestTable' + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of OFFSET clause without LIMIT clause + def test_validation_offset_without_limit() + sb = @dfp.new_statement_builder do |b| + b.offset = 50 + b.limit = nil + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of OFFSET clause with empty string for LIMIT clause + def test_validation_offset_with_empty_limit() + sb = @dfp.new_statement_builder do |b| + b.offset = 50 + b.limit = '' + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of LIMIT clause with empty string for OFFSET clause + def test_validation_limit_with_empty_offset() + sb = @dfp.new_statement_builder do |b| + b.offset = '' + b.limit = 100 + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of non-integer OFFSET + def test_validation_non_integer_offset() + sb = @dfp.new_statement_builder { |b| b.offset = 50.0 } + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation of non-integer LIMIT + def test_validation_non_integer_limit() + sb = @dfp.new_statement_builder { |b| b.limit = 100.0 } + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation for missing value + def test_validation_missing_value() + sb = @dfp.new_statement_builder do |b| + b.with_bind_variable('var_name', nil) + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation for missing value type + def test_validation_missing_value_type() + sb = @dfp.new_statement_builder do |b| + b.with_bind_variable('var_name', {:value => 123}) + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation for unknown value type + def test_validation_unknown_value_type() + sb = @dfp.new_statement_builder do |b| + b.with_bind_variable('var_name', + {:xsi_type => 'FloatValue', :value => 1.0}) + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation for sets containing different types + def test_validation_heterogeneous_sets() + sb = @dfp.new_statement_builder do |b| + b.with_bind_variable('var_name', [1,2,'3']) + end + assert_raise(RuntimeError) { sb.to_statement() } + end + + # Test validation for DateTimeValues without time_zone_id + def test_validation_datetime_missing_timezone() + sb = @dfp.new_statement_builder do |b| + datetime = @dfp.datetime('UTC').to_h + datetime.delete(:time_zone_id) + b.with_bind_variable('var_name', + {:xsi_type => 'DateTimeValue', :value => datetime}) + end + assert_raise(RuntimeError) { sb.to_statement() } + end +end diff --git a/dfp_api/test/dfp_api/test_dfp_utils.rb b/dfp_api/test/dfp_api/test_dfp_utils.rb new file mode 100755 index 000000000..4a4bdfebb --- /dev/null +++ b/dfp_api/test/dfp_api/test_dfp_utils.rb @@ -0,0 +1,54 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright:: Copyright 2017, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.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. +# +# Tests the DFP utils. + +require 'test/unit' +require 'dfp_api/utils' +require 'thread' + + +class TestUtils < Test::Unit::TestCase + @@lock = Mutex.new + + def test_utility_registry() + util_registry = DfpApi::Utils::UtilityRegistry.instance + @@lock.synchronize do + util_registry.extract! # clear any previously recorded utilities + assert_equal(0, util_registry.length) + util_registry.add('item1') + assert_equal(1, util_registry.length) + util_registry.add('item2') + assert_equal(2, util_registry.length) + assert_equal(Set.new(['item1', 'item2']), util_registry.extract!) + assert_equal(0, util_registry.length) + end + end + + def test_utility_registry_disabled() + util_registry = DfpApi::Utils::UtilityRegistry.instance + @@lock.synchronize do + util_registry.extract! # clear any previously recorded utilities + util_registry.enabled = false + assert_equal(0, util_registry.length) + util_registry.add('item1') + assert_equal(0, util_registry.length) + util_registry.enabled = true # re-enable to restore default state + end + end +end