google-dfp-api 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +6 -0
- data/README +11 -5
- data/Rakefile +1 -1
- data/examples/{v201101 → v201108}/common/error_handling.rb +1 -1
- data/examples/{v201101 → v201108}/common/oauth_handling.rb +1 -1
- data/examples/{v201101 → v201108}/company_service/create_companies.rb +1 -1
- data/examples/{v201101 → v201108}/company_service/get_all_companies.rb +1 -1
- data/examples/{v201101 → v201108}/company_service/get_companies_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/company_service/get_company.rb +1 -1
- data/examples/{v201101 → v201108}/company_service/update_companies.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/copy_image_creatives.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/create_creatives.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/get_all_creatives.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/get_creative.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/get_creatives_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/creative_service/update_creatives.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/delete_custom_targeting_keys.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/delete_custom_targeting_values.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/update_custom_targeting_keys.rb +1 -1
- data/examples/{v201101 → v201108}/custom_targeting_service/update_custom_targeting_values.rb +1 -1
- data/examples/{v201101 → v201108}/forecast_service/get_forecast.rb +8 -4
- data/examples/{v201101 → v201108}/forecast_service/get_forecast_by_id.rb +1 -1
- data/examples/{v201101 → v201108}/inventory_service/create_ad_units.rb +8 -2
- data/examples/{v201101 → v201108}/inventory_service/deactivate_ad_units.rb +1 -1
- data/examples/{v201101 → v201108}/inventory_service/get_ad_unit.rb +1 -1
- data/examples/v201108/inventory_service/get_ad_unit_sizes.rb +73 -0
- data/examples/{v201101 → v201108}/inventory_service/get_ad_units_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/inventory_service/get_all_ad_units.rb +1 -1
- data/examples/{v201101 → v201108}/inventory_service/update_ad_units.rb +1 -1
- data/examples/v201108/label_service/create_labels.rb +83 -0
- data/examples/v201108/label_service/deactivate_labels.rb +118 -0
- data/examples/v201108/label_service/get_all_labels.rb +94 -0
- data/examples/v201108/label_service/get_label.rb +76 -0
- data/examples/v201108/label_service/get_labels_by_statement.rb +91 -0
- data/examples/v201108/label_service/update_labels.rb +104 -0
- data/examples/{v201101 → v201108}/line_item_creative_association_service/create_licas.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_creative_association_service/deactivate_licas.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_creative_association_service/get_all_licas.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_creative_association_service/get_lica.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_creative_association_service/get_licas_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_creative_association_service/update_licas.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_service/activate_line_items.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_service/create_line_items.rb +49 -19
- data/examples/{v201101 → v201108}/line_item_service/get_all_line_items.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_service/get_line_item.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_service/get_line_items_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/line_item_service/target_custom_criteria.rb +30 -36
- data/examples/{v201101 → v201108}/line_item_service/update_line_items.rb +1 -1
- data/examples/{v201101 → v201108}/network_service/get_all_networks.rb +1 -1
- data/examples/{v201101 → v201108}/network_service/get_current_network.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/approve_orders.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/create_orders.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/get_all_orders.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/get_order.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/get_orders_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/order_service/update_orders.rb +1 -1
- data/examples/{v201101 → v201108}/placement_service/create_placements.rb +3 -2
- data/examples/{v201101 → v201108}/placement_service/deactivate_placements.rb +1 -1
- data/examples/{v201101 → v201108}/placement_service/get_all_placements.rb +1 -1
- data/examples/{v201101 → v201108}/placement_service/get_placement.rb +1 -1
- data/examples/{v201101 → v201108}/placement_service/get_placements_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/placement_service/update_placements.rb +1 -1
- data/examples/v201108/publisher_query_language_service/get_all_bandwidth_groups.rb +85 -0
- data/examples/v201108/publisher_query_language_service/get_all_browser_languages.rb +85 -0
- data/examples/v201108/publisher_query_language_service/get_all_browsers.rb +85 -0
- data/examples/{v201101 → v201108}/publisher_query_language_service/get_all_cities.rb +1 -1
- data/examples/{v201101 → v201108}/publisher_query_language_service/get_all_countries.rb +1 -1
- data/examples/{v201101 → v201108}/publisher_query_language_service/get_all_metros.rb +1 -1
- data/examples/v201108/publisher_query_language_service/get_all_operating_systems.rb +85 -0
- data/examples/{v201101 → v201108}/publisher_query_language_service/get_all_regions.rb +1 -1
- data/examples/{v201101 → v201108}/report_service/download_report.rb +1 -1
- data/examples/{v201101 → v201108}/report_service/run_delivery_report.rb +1 -1
- data/examples/{v201101 → v201108}/report_service/run_inventory_report.rb +1 -1
- data/examples/{v201101 → v201108}/report_service/run_sales_report.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/create_users.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/deactivate_users.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/get_all_roles.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/get_all_users.rb +1 -1
- data/examples/v201108/user_service/get_current_user.rb +66 -0
- data/examples/{v201101 → v201108}/user_service/get_user.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/get_users_by_statement.rb +1 -1
- data/examples/{v201101 → v201108}/user_service/update_users.rb +1 -1
- data/lib/dfp_api.rb +5 -12
- data/lib/dfp_api/api_config.rb +14 -13
- data/lib/dfp_api/credential_handler.rb +5 -5
- data/lib/dfp_api/v201104/company_service.rb +5 -5
- data/lib/dfp_api/v201104/company_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/creative_service.rb +5 -5
- data/lib/dfp_api/v201104/creative_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/custom_targeting_service.rb +9 -9
- data/lib/dfp_api/v201104/custom_targeting_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/forecast_service.rb +5 -5
- data/lib/dfp_api/v201104/forecast_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/inventory_service.rb +9 -9
- data/lib/dfp_api/v201104/inventory_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/line_item_creative_association_service.rb +1 -1
- data/lib/dfp_api/v201104/line_item_creative_association_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/line_item_service.rb +13 -13
- data/lib/dfp_api/v201104/line_item_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/network_service.rb +5 -5
- data/lib/dfp_api/v201104/network_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/order_service.rb +1 -1
- data/lib/dfp_api/v201104/order_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/placement_service.rb +5 -5
- data/lib/dfp_api/v201104/placement_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/publisher_query_language_service.rb +1 -1
- data/lib/dfp_api/v201104/publisher_query_language_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/report_service.rb +5 -5
- data/lib/dfp_api/v201104/report_service_registry.rb +5 -3
- data/lib/dfp_api/v201104/user_service.rb +9 -9
- data/lib/dfp_api/v201104/user_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/company_service.rb +9 -9
- data/lib/dfp_api/v201107/company_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/custom_targeting_service.rb +9 -9
- data/lib/dfp_api/v201107/custom_targeting_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/label_service.rb +5 -5
- data/lib/dfp_api/v201107/label_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/order_service.rb +13 -13
- data/lib/dfp_api/v201107/order_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/report_service.rb +5 -5
- data/lib/dfp_api/v201107/report_service_registry.rb +5 -3
- data/lib/dfp_api/v201107/user_service.rb +19 -19
- data/lib/dfp_api/v201107/user_service_registry.rb +5 -3
- data/lib/dfp_api/{v201101 → v201108}/company_service.rb +10 -10
- data/lib/dfp_api/v201108/company_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/creative_service.rb +10 -10
- data/lib/dfp_api/v201108/creative_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/custom_targeting_service.rb +14 -14
- data/lib/dfp_api/v201108/custom_targeting_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/forecast_service.rb +10 -10
- data/lib/dfp_api/v201108/forecast_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/inventory_service.rb +18 -14
- data/lib/dfp_api/v201108/inventory_service_registry.rb +44 -0
- data/lib/dfp_api/v201108/label_service.rb +56 -0
- data/lib/dfp_api/v201108/label_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/line_item_creative_association_service.rb +6 -6
- data/lib/dfp_api/v201108/line_item_creative_association_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/line_item_service.rb +18 -18
- data/lib/dfp_api/v201108/line_item_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/network_service.rb +10 -10
- data/lib/dfp_api/v201108/network_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/order_service.rb +6 -6
- data/lib/dfp_api/v201108/order_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/placement_service.rb +10 -10
- data/lib/dfp_api/v201108/placement_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/publisher_query_language_service.rb +6 -6
- data/lib/dfp_api/v201108/publisher_query_language_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/report_service.rb +10 -10
- data/lib/dfp_api/v201108/report_service_registry.rb +44 -0
- data/lib/dfp_api/v201108/third_party_slot_service.rb +44 -0
- data/lib/dfp_api/v201108/third_party_slot_service_registry.rb +44 -0
- data/lib/dfp_api/{v201101 → v201108}/user_service.rb +18 -14
- data/lib/dfp_api/v201108/user_service_registry.rb +44 -0
- metadata +120 -104
- data/lib/dfp_api/v201101/company_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/creative_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/custom_targeting_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/forecast_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/inventory_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/line_item_creative_association_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/line_item_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/network_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/order_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/placement_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/publisher_query_language_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/report_service_registry.rb +0 -42
- data/lib/dfp_api/v201101/user_service_registry.rb +0 -42
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
#
|
|
3
|
+
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
|
+
#
|
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
6
|
+
#
|
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
16
|
+
# implied.
|
|
17
|
+
# See the License for the specific language governing permissions and
|
|
18
|
+
# limitations under the License.
|
|
19
|
+
#
|
|
20
|
+
# This example gets the current user.
|
|
21
|
+
#
|
|
22
|
+
# Tags: UserService.getCurrentUser
|
|
23
|
+
|
|
24
|
+
require 'rubygems'
|
|
25
|
+
require 'dfp_api'
|
|
26
|
+
|
|
27
|
+
API_VERSION = :v201108
|
|
28
|
+
|
|
29
|
+
def get_current_user()
|
|
30
|
+
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
|
31
|
+
dfp = DfpApi::Api.new
|
|
32
|
+
|
|
33
|
+
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
|
34
|
+
# the configuration file or provide your own logger:
|
|
35
|
+
# dfp.logger = Logger.new('dfp_xml.log')
|
|
36
|
+
|
|
37
|
+
# Get the UserService.
|
|
38
|
+
user_service = dfp.service(:UserService, API_VERSION)
|
|
39
|
+
|
|
40
|
+
# Get the current user.
|
|
41
|
+
user = user_service.get_current_user()
|
|
42
|
+
|
|
43
|
+
puts "Current user has ID %d, email %s and role %s." %
|
|
44
|
+
[user[:id], user[:email], user[:role_name]]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
if __FILE__ == $0
|
|
48
|
+
begin
|
|
49
|
+
get_current_user()
|
|
50
|
+
|
|
51
|
+
# HTTP errors.
|
|
52
|
+
rescue AdsCommon::Errors::HttpError => e
|
|
53
|
+
puts "HTTP Error: %s" % e
|
|
54
|
+
|
|
55
|
+
# API errors.
|
|
56
|
+
rescue DfpApi::Errors::ApiException => e
|
|
57
|
+
puts "Message: %s" % e.message
|
|
58
|
+
puts 'Errors:'
|
|
59
|
+
e.errors.each_with_index do |error, index|
|
|
60
|
+
puts "\tError [%d]:" % (index + 1)
|
|
61
|
+
error.each do |field, value|
|
|
62
|
+
puts "\t\t%s: %s" % [field, value]
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
data/lib/dfp_api.rb
CHANGED
|
@@ -20,11 +20,10 @@
|
|
|
20
20
|
# Contains the main classes for the client library. Takes care of all
|
|
21
21
|
# dependencies.
|
|
22
22
|
|
|
23
|
-
gem 'google-ads-common', '~>0.5.
|
|
24
|
-
|
|
25
|
-
require 'savon'
|
|
23
|
+
gem 'google-ads-common', '~>0.5.1'
|
|
26
24
|
|
|
27
25
|
require 'ads_common/api'
|
|
26
|
+
require 'ads_common/savon_service'
|
|
28
27
|
require 'ads_common/savon_headers/oauth_header_handler'
|
|
29
28
|
require 'ads_common/savon_headers/simple_header_handler'
|
|
30
29
|
require 'dfp_api/api_config'
|
|
@@ -54,10 +53,7 @@ module DfpApi
|
|
|
54
53
|
# Sets the logger to use.
|
|
55
54
|
def logger=(logger)
|
|
56
55
|
super(logger)
|
|
57
|
-
|
|
58
|
-
config.log_level = :debug
|
|
59
|
-
config.logger = logger
|
|
60
|
-
end
|
|
56
|
+
AdsCommon::SavonService.logger = logger
|
|
61
57
|
end
|
|
62
58
|
|
|
63
59
|
private
|
|
@@ -65,13 +61,10 @@ module DfpApi
|
|
|
65
61
|
# Retrieve DFP HeaderHandlers per credential.
|
|
66
62
|
def soap_header_handlers(auth_handler, header_list, version, namespace)
|
|
67
63
|
handler = nil
|
|
68
|
-
auth_method = @config.read('authentication.method',
|
|
69
|
-
'ClientLogin').to_s.upcase.to_sym
|
|
64
|
+
auth_method = @config.read('authentication.method', :CLIENTLOGIN)
|
|
70
65
|
handler = case auth_method
|
|
71
66
|
when :CLIENTLOGIN
|
|
72
|
-
|
|
73
|
-
AdsCommon::SavonHeaders::SimpleHeaderHandler :
|
|
74
|
-
DfpApi::ClientLoginHeaderHandler
|
|
67
|
+
DfpApi::ClientLoginHeaderHandler
|
|
75
68
|
when :OAUTH
|
|
76
69
|
AdsCommon::SavonHeaders::OAuthHeaderHandler
|
|
77
70
|
end
|
data/lib/dfp_api/api_config.rb
CHANGED
|
@@ -34,23 +34,18 @@ module DfpApi
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
# Set defaults
|
|
37
|
-
DEFAULT_VERSION = :
|
|
37
|
+
DEFAULT_VERSION = :v201108
|
|
38
38
|
DEFAULT_ENVIRONMENT = :PRODUCTION
|
|
39
|
-
LATEST_VERSION = :
|
|
39
|
+
LATEST_VERSION = :v201108
|
|
40
40
|
|
|
41
41
|
# Set other constants
|
|
42
42
|
API_NAME = 'DfpApi'
|
|
43
43
|
API_PATH = 'dfp_api'
|
|
44
|
-
CLIENT_LIB_VERSION = '0.2.
|
|
44
|
+
CLIENT_LIB_VERSION = '0.2.4'
|
|
45
45
|
DEFAULT_CONFIG_FILENAME = 'dfp_api.yml'
|
|
46
46
|
|
|
47
47
|
# Configure the services available to each version
|
|
48
48
|
@@service_config = {
|
|
49
|
-
:v201101 => [:CompanyService, :CreativeService, :ForecastService,
|
|
50
|
-
:InventoryService, :LineItemCreativeAssociationService,
|
|
51
|
-
:LineItemService, :NetworkService, :OrderService,
|
|
52
|
-
:PlacementService, :ReportService, :UserService,
|
|
53
|
-
:CustomTargetingService, :PublisherQueryLanguageService],
|
|
54
49
|
:v201103 => [:CompanyService, :CreativeService, :ForecastService,
|
|
55
50
|
:InventoryService, :LineItemCreativeAssociationService,
|
|
56
51
|
:LineItemService, :NetworkService, :OrderService,
|
|
@@ -66,24 +61,30 @@ module DfpApi
|
|
|
66
61
|
:LineItemService, :NetworkService, :OrderService,
|
|
67
62
|
:PlacementService, :ReportService, :UserService,
|
|
68
63
|
:CustomTargetingService, :PublisherQueryLanguageService,
|
|
69
|
-
:LabelService]
|
|
64
|
+
:LabelService],
|
|
65
|
+
:v201108 => [:CompanyService, :CreativeService, :ForecastService,
|
|
66
|
+
:InventoryService, :LineItemCreativeAssociationService,
|
|
67
|
+
:LineItemService, :NetworkService, :OrderService,
|
|
68
|
+
:PlacementService, :ReportService, :UserService,
|
|
69
|
+
:CustomTargetingService, :PublisherQueryLanguageService,
|
|
70
|
+
:LabelService, :ThirdPartySlotService]
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
# Configure the different environments, with the base URL for each one
|
|
73
74
|
@@environment_config = {
|
|
74
75
|
:PRODUCTION => {
|
|
75
76
|
:oauth_scope => 'https://www.google.com/apis/ads/publisher/',
|
|
76
|
-
:v201101 => 'https://www.google.com/apis/ads/publisher/',
|
|
77
77
|
:v201103 => 'https://www.google.com/apis/ads/publisher/',
|
|
78
78
|
:v201104 => 'https://www.google.com/apis/ads/publisher/',
|
|
79
|
-
:v201107 => 'https://www.google.com/apis/ads/publisher/'
|
|
79
|
+
:v201107 => 'https://www.google.com/apis/ads/publisher/',
|
|
80
|
+
:v201108 => 'https://www.google.com/apis/ads/publisher/'
|
|
80
81
|
},
|
|
81
82
|
:SANDBOX => {
|
|
82
83
|
:oauth_scope => 'https://sandbox.google.com/apis/ads/publisher/',
|
|
83
|
-
:v201101 => 'https://sandbox.google.com/apis/ads/publisher/',
|
|
84
84
|
:v201103 => 'https://sandbox.google.com/apis/ads/publisher/',
|
|
85
85
|
:v201104 => 'https://sandbox.google.com/apis/ads/publisher/',
|
|
86
|
-
:v201107 => 'https://sandbox.google.com/apis/ads/publisher/'
|
|
86
|
+
:v201107 => 'https://sandbox.google.com/apis/ads/publisher/',
|
|
87
|
+
:v201108 => 'https://sandbox.google.com/apis/ads/publisher/'
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -29,8 +29,7 @@ module DfpApi
|
|
|
29
29
|
def credentials(version = nil)
|
|
30
30
|
validate_headers_for_server()
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
result = case method
|
|
32
|
+
result = case @credentials[:method]
|
|
34
33
|
when :CLIENTLOGIN
|
|
35
34
|
{:email => @credentials[:email],
|
|
36
35
|
:password => @credentials[:password],
|
|
@@ -42,9 +41,10 @@ module DfpApi
|
|
|
42
41
|
:oauth_token => @credentials[:oauth_token],
|
|
43
42
|
:oauth_token_secret => @credentials[:oauth_token_secret],
|
|
44
43
|
:oauth_callback => @credentials[:oauth_callback],
|
|
45
|
-
:oauth_method => @credentials[:oauth_method]
|
|
44
|
+
:oauth_method => @credentials[:oauth_method],
|
|
45
|
+
:oauth_request_token => @credentials[:oauth_request_token]}
|
|
46
46
|
end
|
|
47
|
-
client_lib = "Ruby
|
|
47
|
+
client_lib = "DfpApi-Ruby-%s" % DfpApi::ApiConfig::CLIENT_LIB_VERSION
|
|
48
48
|
application_name = @credentials[:application_name] || $0
|
|
49
49
|
result[:applicationName] = "%s|%s" % [client_lib, application_name]
|
|
50
50
|
result[:networkCode] = @credentials[:network_code]
|
|
@@ -57,7 +57,7 @@ module DfpApi
|
|
|
57
57
|
# environment.
|
|
58
58
|
def validate_headers_for_server()
|
|
59
59
|
if @credentials[:application_name].nil?
|
|
60
|
-
raise AdsCommon::Errors::AuthError,
|
|
60
|
+
raise AdsCommon::Errors::AuthError, 'Application name is not specified'
|
|
61
61
|
end
|
|
62
62
|
return nil
|
|
63
63
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
4
|
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
5
|
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.
|
|
6
|
+
# Code generated by AdsCommon library 0.5.1 on 2011-09-23 16:12:05.
|
|
7
7
|
|
|
8
8
|
require 'ads_common/savon_service'
|
|
9
9
|
require 'dfp_api/v201104/company_service_registry'
|
|
@@ -15,6 +15,10 @@ module DfpApi; module V201104; module CompanyService
|
|
|
15
15
|
super(api, endpoint, namespace, :v201104)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
def get_company(*args)
|
|
19
|
+
return execute_action('get_company', args)
|
|
20
|
+
end
|
|
21
|
+
|
|
18
22
|
def update_companies(*args)
|
|
19
23
|
return execute_action('update_companies', args)
|
|
20
24
|
end
|
|
@@ -35,10 +39,6 @@ module DfpApi; module V201104; module CompanyService
|
|
|
35
39
|
return execute_action('get_companies_by_statement', args)
|
|
36
40
|
end
|
|
37
41
|
|
|
38
|
-
def get_company(*args)
|
|
39
|
-
return execute_action('get_company', args)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
42
|
private
|
|
43
43
|
|
|
44
44
|
def get_service_registry()
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
4
|
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
5
|
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.
|
|
6
|
+
# Code generated by AdsCommon library 0.5.1 on 2011-09-23 16:12:05.
|
|
7
|
+
|
|
8
|
+
require 'dfp_api/errors'
|
|
7
9
|
|
|
8
10
|
module DfpApi; module V201104; module CompanyService
|
|
9
11
|
class CompanyServiceRegistry
|
|
10
|
-
COMPANYSERVICE_METHODS = {:
|
|
11
|
-
COMPANYSERVICE_TYPES = {:
|
|
12
|
+
COMPANYSERVICE_METHODS = {:get_company=>{:output=>{:fields=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"get_company_response"}, :input=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:company_id}]}, :update_companies=>{:output=>{:fields=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:rval}], :name=>"update_companies_response"}, :input=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:companies}]}, :update_company=>{:output=>{:fields=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"update_company_response"}, :input=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>1, :name=>:company}]}, :create_companies=>{:output=>{:fields=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:rval}], :name=>"create_companies_response"}, :input=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:companies}]}, :create_company=>{:output=>{:fields=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"create_company_response"}, :input=>[{:type=>"Company", :min_occurs=>0, :max_occurs=>1, :name=>:company}]}, :get_companies_by_statement=>{:output=>{:fields=>[{:type=>"CompanyPage", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"get_companies_by_statement_response"}, :input=>[{:type=>"Statement", :min_occurs=>0, :max_occurs=>1, :name=>:filter_statement}]}}
|
|
13
|
+
COMPANYSERVICE_TYPES = {:Authentication=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:authentication_type}], :abstract=>true}, :SoapResponseHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:request_id}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:response_time}]}, :OAuth=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:parameters}], :base=>"Authentication"}, :TextValue=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :BooleanValue=>{:fields=>[{:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :Statement=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:query}, {:type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:values}]}, :NumberValue=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :ClientLogin=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:token}], :base=>"Authentication"}, :String_ValueMapEntry=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:key}, {:type=>"Value", :min_occurs=>0, :max_occurs=>1, :name=>:value}]}, :Company=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:id}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:name}, {:type=>"Company.Type", :min_occurs=>0, :max_occurs=>1, :name=>:type}]}, :CompanyPage=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:total_result_set_size}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:start_index}, {:type=>"Company", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:results}]}, :Value=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value_type}], :abstract=>true}, :SoapRequestHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:network_code}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:application_name}, {:type=>"Authentication", :min_occurs=>0, :max_occurs=>1, :name=>:authentication}]}}
|
|
12
14
|
COMPANYSERVICE_NAMESPACES = []
|
|
13
15
|
|
|
14
16
|
def self.get_method_signature(method_name)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
4
|
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
5
|
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.
|
|
6
|
+
# Code generated by AdsCommon library 0.5.1 on 2011-09-23 16:12:39.
|
|
7
7
|
|
|
8
8
|
require 'ads_common/savon_service'
|
|
9
9
|
require 'dfp_api/v201104/creative_service_registry'
|
|
@@ -15,6 +15,10 @@ module DfpApi; module V201104; module CreativeService
|
|
|
15
15
|
super(api, endpoint, namespace, :v201104)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
def update_creative(*args)
|
|
19
|
+
return execute_action('update_creative', args)
|
|
20
|
+
end
|
|
21
|
+
|
|
18
22
|
def update_creatives(*args)
|
|
19
23
|
return execute_action('update_creatives', args)
|
|
20
24
|
end
|
|
@@ -35,10 +39,6 @@ module DfpApi; module V201104; module CreativeService
|
|
|
35
39
|
return execute_action('get_creatives_by_statement', args)
|
|
36
40
|
end
|
|
37
41
|
|
|
38
|
-
def update_creative(*args)
|
|
39
|
-
return execute_action('update_creative', args)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
42
|
private
|
|
43
43
|
|
|
44
44
|
def get_service_registry()
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
4
|
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
5
|
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.
|
|
6
|
+
# Code generated by AdsCommon library 0.5.1 on 2011-09-23 16:12:39.
|
|
7
|
+
|
|
8
|
+
require 'dfp_api/errors'
|
|
7
9
|
|
|
8
10
|
module DfpApi; module V201104; module CreativeService
|
|
9
11
|
class CreativeServiceRegistry
|
|
10
|
-
CREATIVESERVICE_METHODS = {:
|
|
11
|
-
CREATIVESERVICE_TYPES = {:
|
|
12
|
+
CREATIVESERVICE_METHODS = {:update_creative=>{:output=>{:fields=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"update_creative_response"}, :input=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>1, :name=>:creative}]}, :update_creatives=>{:output=>{:fields=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:rval}], :name=>"update_creatives_response"}, :input=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:creatives}]}, :create_creative=>{:output=>{:fields=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"create_creative_response"}, :input=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>1, :name=>:creative}]}, :create_creatives=>{:output=>{:fields=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:rval}], :name=>"create_creatives_response"}, :input=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:creatives}]}, :get_creative=>{:output=>{:fields=>[{:type=>"Creative", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"get_creative_response"}, :input=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:creative_id}]}, :get_creatives_by_statement=>{:output=>{:fields=>[{:type=>"CreativePage", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"get_creatives_by_statement_response"}, :input=>[{:type=>"Statement", :min_occurs=>0, :max_occurs=>1, :name=>:filter_statement}]}}
|
|
13
|
+
CREATIVESERVICE_TYPES = {:ThirdPartyCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:snippet}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:expanded_snippet}], :base=>"Creative"}, :BaseFlashRedirectCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :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}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :Authentication=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:authentication_type}], :abstract=>true}, :SoapResponseHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:request_id}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:response_time}]}, :OAuth=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:parameters}], :base=>"Authentication"}, :FlashCreative=>{:fields=>[], :base=>"BaseFlashCreative"}, :TextValue=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :Size=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:width}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:height}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:is_aspect_ratio}]}, :BooleanValue=>{:fields=>[{:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :BaseImageCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:image_name}, {:type=>"base64Binary", :min_occurs=>0, :max_occurs=>1, :name=>:image_byte_array}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:override_size}, {:type=>"Size", :min_occurs=>0, :max_occurs=>1, :name=>:asset_size}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:image_url}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :Statement=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:query}, {:type=>"String_ValueMapEntry", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:values}]}, :NumberValue=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Value"}, :FlashRedirectCreative=>{:fields=>[], :base=>"BaseFlashRedirectCreative"}, :ClientLogin=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:token}], :base=>"Authentication"}, :BaseImageRedirectCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:image_url}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :String_ValueMapEntry=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:key}, {:type=>"Value", :min_occurs=>0, :max_occurs=>1, :name=>:value}]}, :HasDestinationUrlCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:destination_url}], :abstract=>true, :base=>"Creative"}, :ImageCreative=>{:fields=>[], :base=>"BaseImageCreative"}, :Creative=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:advertiser_id}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:id}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:name}, {:type=>"Size", :min_occurs=>0, :max_occurs=>1, :name=>:size}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:preview_url}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:creative_type}], :abstract=>true}, :ImageRedirectCreative=>{:fields=>[], :base=>"BaseImageRedirectCreative"}, :BaseFlashCreative=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:flash_name}, {:type=>"base64Binary", :min_occurs=>0, :max_occurs=>1, :name=>:flash_byte_array}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:fallback_image_name}, {:type=>"base64Binary", :min_occurs=>0, :max_occurs=>1, :name=>:fallback_image_byte_array}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:override_size}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:click_tag_required}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:fallback_preview_url}, {:type=>"Size", :min_occurs=>0, :max_occurs=>1, :name=>:flash_asset_size}, {:type=>"Size", :min_occurs=>0, :max_occurs=>1, :name=>:fallback_asset_size}], :abstract=>true, :base=>"HasDestinationUrlCreative"}, :Value=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value_type}], :abstract=>true}, :SoapRequestHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:network_code}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:application_name}, {:type=>"Authentication", :min_occurs=>0, :max_occurs=>1, :name=>:authentication}]}, :CreativePage=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:total_result_set_size}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:start_index}, {:type=>"Creative", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:results}]}}
|
|
12
14
|
CREATIVESERVICE_NAMESPACES = []
|
|
13
15
|
|
|
14
16
|
def self.get_method_signature(method_name)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
4
|
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
5
|
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.
|
|
6
|
+
# Code generated by AdsCommon library 0.5.1 on 2011-09-23 16:11:55.
|
|
7
7
|
|
|
8
8
|
require 'ads_common/savon_service'
|
|
9
9
|
require 'dfp_api/v201104/custom_targeting_service_registry'
|
|
@@ -15,6 +15,14 @@ module DfpApi; module V201104; module CustomTargetingService
|
|
|
15
15
|
super(api, endpoint, namespace, :v201104)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
def get_custom_targeting_keys_by_statement(*args)
|
|
19
|
+
return execute_action('get_custom_targeting_keys_by_statement', args)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def get_custom_targeting_values_by_statement(*args)
|
|
23
|
+
return execute_action('get_custom_targeting_values_by_statement', args)
|
|
24
|
+
end
|
|
25
|
+
|
|
18
26
|
def perform_custom_targeting_key_action(*args)
|
|
19
27
|
return execute_action('perform_custom_targeting_key_action', args)
|
|
20
28
|
end
|
|
@@ -39,14 +47,6 @@ module DfpApi; module V201104; module CustomTargetingService
|
|
|
39
47
|
return execute_action('update_custom_targeting_values', args)
|
|
40
48
|
end
|
|
41
49
|
|
|
42
|
-
def get_custom_targeting_keys_by_statement(*args)
|
|
43
|
-
return execute_action('get_custom_targeting_keys_by_statement', args)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def get_custom_targeting_values_by_statement(*args)
|
|
47
|
-
return execute_action('get_custom_targeting_values_by_statement', args)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
50
|
private
|
|
51
51
|
|
|
52
52
|
def get_service_registry()
|