google-adwords-api 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +15 -0
  2. data/ChangeLog +5 -0
  3. data/README.md +53 -30
  4. data/examples/v201406/account_management/create_account.rb +92 -0
  5. data/examples/v201406/account_management/get_account_alerts.rb +122 -0
  6. data/examples/v201406/account_management/get_account_changes.rb +145 -0
  7. data/examples/v201406/account_management/get_account_hierarchy.rb +103 -0
  8. data/examples/v201406/advanced_operations/add_ad_group_bid_modifier.rb +105 -0
  9. data/examples/v201406/advanced_operations/add_click_to_download_ad.rb +137 -0
  10. data/examples/v201406/advanced_operations/add_places_location_extensions.rb +159 -0
  11. data/examples/v201406/advanced_operations/add_site_links.rb +306 -0
  12. data/examples/v201406/advanced_operations/add_text_ad_with_upgraded_urls.rb +137 -0
  13. data/examples/v201406/advanced_operations/get_ad_group_bid_modifiers.rb +106 -0
  14. data/examples/v201406/advanced_operations/update_site_links.rb +194 -0
  15. data/examples/v201406/advanced_operations/upload_offline_conversions.rb +117 -0
  16. data/examples/v201406/advanced_operations/use_shared_bidding_strategy.rb +164 -0
  17. data/examples/v201406/basic_operations/add_ad_groups.rb +142 -0
  18. data/examples/v201406/basic_operations/add_campaigns.rb +153 -0
  19. data/examples/v201406/basic_operations/add_keywords.rb +116 -0
  20. data/examples/v201406/basic_operations/add_text_ads.rb +113 -0
  21. data/examples/v201406/basic_operations/get_ad_groups.rb +106 -0
  22. data/examples/v201406/basic_operations/get_campaigns.rb +101 -0
  23. data/examples/v201406/basic_operations/get_campaigns_with_awql.rb +93 -0
  24. data/examples/v201406/basic_operations/get_keywords.rb +112 -0
  25. data/examples/v201406/basic_operations/get_text_ads.rb +114 -0
  26. data/examples/v201406/basic_operations/pause_ad.rb +92 -0
  27. data/examples/v201406/basic_operations/remove_ad.rb +93 -0
  28. data/examples/v201406/basic_operations/remove_ad_group.rb +110 -0
  29. data/examples/v201406/basic_operations/remove_campaign.rb +111 -0
  30. data/examples/v201406/basic_operations/remove_keyword.rb +98 -0
  31. data/examples/v201406/basic_operations/update_ad_group.rb +89 -0
  32. data/examples/v201406/basic_operations/update_campaign.rb +90 -0
  33. data/examples/v201406/basic_operations/update_keyword.rb +110 -0
  34. data/examples/v201406/campaign_management/add_campaign_labels.rb +86 -0
  35. data/examples/v201406/campaign_management/add_experiment.rb +166 -0
  36. data/examples/v201406/campaign_management/add_keywords_in_bulk.rb +158 -0
  37. data/examples/v201406/campaign_management/add_location_extension.rb +125 -0
  38. data/examples/v201406/campaign_management/get_all_disapproved_ads.rb +101 -0
  39. data/examples/v201406/campaign_management/get_all_disapproved_ads_with_awql.rb +93 -0
  40. data/examples/v201406/campaign_management/get_campaigns_by_label.rb +112 -0
  41. data/examples/v201406/campaign_management/promote_experiment.rb +85 -0
  42. data/examples/v201406/campaign_management/set_ad_parameters.rb +122 -0
  43. data/examples/v201406/campaign_management/set_criterion_bid_modifier.rb +108 -0
  44. data/examples/v201406/campaign_management/validate_text_ad.rb +114 -0
  45. data/examples/v201406/error_handling/handle_captcha_challenge.rb +93 -0
  46. data/examples/v201406/error_handling/handle_partial_failures.rb +134 -0
  47. data/examples/v201406/error_handling/handle_policy_violation_error.rb +145 -0
  48. data/examples/v201406/error_handling/handle_two_factor_authorization_error.rb +88 -0
  49. data/examples/v201406/misc/create_ad_words_session_without_properties_file.rb +94 -0
  50. data/examples/v201406/misc/get_all_images_and_videos.rb +108 -0
  51. data/examples/v201406/misc/setup_oauth2.rb +88 -0
  52. data/examples/v201406/misc/upload_image.rb +97 -0
  53. data/examples/v201406/misc/use_oauth2_jwt.rb +97 -0
  54. data/examples/v201406/optimization/estimate_keyword_traffic.rb +137 -0
  55. data/examples/v201406/optimization/get_keyword_bid_simulations.rb +100 -0
  56. data/examples/v201406/optimization/get_keyword_ideas.rb +130 -0
  57. data/examples/v201406/optimization/get_placement_ideas.rb +112 -0
  58. data/examples/v201406/remarketing/add_audience.rb +123 -0
  59. data/examples/v201406/remarketing/add_conversion_tracker.rb +105 -0
  60. data/examples/v201406/reporting/download_criteria_report.rb +87 -0
  61. data/examples/v201406/reporting/download_criteria_report_with_awql.rb +86 -0
  62. data/examples/v201406/reporting/get_report_fields.rb +79 -0
  63. data/examples/v201406/reporting/parallel_report_download.rb +171 -0
  64. data/examples/v201406/shopping_campaigns/add_product_partition_tree.rb +269 -0
  65. data/examples/v201406/shopping_campaigns/add_product_scope.rb +133 -0
  66. data/examples/v201406/shopping_campaigns/add_shopping_campaign.rb +135 -0
  67. data/examples/v201406/shopping_campaigns/get_product_category_taxonomy.rb +117 -0
  68. data/examples/v201406/shopping_campaigns/set_product_sales_channel.rb +98 -0
  69. data/examples/v201406/targeting/add_campaign_targeting_criteria.rb +173 -0
  70. data/examples/v201406/targeting/add_demographic_targeting_criteria.rb +116 -0
  71. data/examples/v201406/targeting/get_campaign_targeting_criteria.rb +110 -0
  72. data/examples/v201406/targeting/get_targetable_languages_and_carriers.rb +94 -0
  73. data/examples/v201406/targeting/lookup_location.rb +112 -0
  74. data/lib/adwords_api/api_config.rb +91 -5
  75. data/lib/adwords_api/v201402/campaign_shared_set_service.rb +38 -0
  76. data/lib/adwords_api/v201402/campaign_shared_set_service_registry.rb +47 -0
  77. data/lib/adwords_api/v201402/shared_criterion_service.rb +38 -0
  78. data/lib/adwords_api/v201402/shared_criterion_service_registry.rb +47 -0
  79. data/lib/adwords_api/v201402/shared_set_service.rb +38 -0
  80. data/lib/adwords_api/v201402/shared_set_service_registry.rb +47 -0
  81. data/lib/adwords_api/v201406/ad_group_ad_service.rb +46 -0
  82. data/lib/adwords_api/v201406/ad_group_ad_service_registry.rb +46 -0
  83. data/lib/adwords_api/v201406/ad_group_bid_modifier_service.rb +42 -0
  84. data/lib/adwords_api/v201406/ad_group_bid_modifier_service_registry.rb +46 -0
  85. data/lib/adwords_api/v201406/ad_group_criterion_service.rb +46 -0
  86. data/lib/adwords_api/v201406/ad_group_criterion_service_registry.rb +46 -0
  87. data/lib/adwords_api/v201406/ad_group_feed_service.rb +42 -0
  88. data/lib/adwords_api/v201406/ad_group_feed_service_registry.rb +46 -0
  89. data/lib/adwords_api/v201406/ad_group_service.rb +46 -0
  90. data/lib/adwords_api/v201406/ad_group_service_registry.rb +46 -0
  91. data/lib/adwords_api/v201406/ad_param_service.rb +38 -0
  92. data/lib/adwords_api/v201406/ad_param_service_registry.rb +46 -0
  93. data/lib/adwords_api/v201406/adwords_user_list_service.rb +38 -0
  94. data/lib/adwords_api/v201406/adwords_user_list_service_registry.rb +46 -0
  95. data/lib/adwords_api/v201406/alert_service.rb +34 -0
  96. data/lib/adwords_api/v201406/alert_service_registry.rb +46 -0
  97. data/lib/adwords_api/v201406/bidding_strategy_service.rb +42 -0
  98. data/lib/adwords_api/v201406/bidding_strategy_service_registry.rb +46 -0
  99. data/lib/adwords_api/v201406/budget_order_service.rb +42 -0
  100. data/lib/adwords_api/v201406/budget_order_service_registry.rb +46 -0
  101. data/lib/adwords_api/v201406/budget_service.rb +42 -0
  102. data/lib/adwords_api/v201406/budget_service_registry.rb +46 -0
  103. data/lib/adwords_api/v201406/campaign_ad_extension_service.rb +38 -0
  104. data/lib/adwords_api/v201406/campaign_ad_extension_service_registry.rb +46 -0
  105. data/lib/adwords_api/v201406/campaign_criterion_service.rb +42 -0
  106. data/lib/adwords_api/v201406/campaign_criterion_service_registry.rb +46 -0
  107. data/lib/adwords_api/v201406/campaign_feed_service.rb +42 -0
  108. data/lib/adwords_api/v201406/campaign_feed_service_registry.rb +46 -0
  109. data/lib/adwords_api/v201406/campaign_service.rb +46 -0
  110. data/lib/adwords_api/v201406/campaign_service_registry.rb +46 -0
  111. data/lib/adwords_api/v201406/campaign_shared_set_service.rb +38 -0
  112. data/lib/adwords_api/v201406/campaign_shared_set_service_registry.rb +47 -0
  113. data/lib/adwords_api/v201406/constant_data_service.rb +66 -0
  114. data/lib/adwords_api/v201406/constant_data_service_registry.rb +46 -0
  115. data/lib/adwords_api/v201406/conversion_tracker_service.rb +38 -0
  116. data/lib/adwords_api/v201406/conversion_tracker_service_registry.rb +46 -0
  117. data/lib/adwords_api/v201406/customer_feed_service.rb +42 -0
  118. data/lib/adwords_api/v201406/customer_feed_service_registry.rb +46 -0
  119. data/lib/adwords_api/v201406/customer_service.rb +38 -0
  120. data/lib/adwords_api/v201406/customer_service_registry.rb +46 -0
  121. data/lib/adwords_api/v201406/customer_sync_service.rb +34 -0
  122. data/lib/adwords_api/v201406/customer_sync_service_registry.rb +47 -0
  123. data/lib/adwords_api/v201406/data_service.rb +54 -0
  124. data/lib/adwords_api/v201406/data_service_registry.rb +46 -0
  125. data/lib/adwords_api/v201406/experiment_service.rb +38 -0
  126. data/lib/adwords_api/v201406/experiment_service_registry.rb +46 -0
  127. data/lib/adwords_api/v201406/feed_item_service.rb +42 -0
  128. data/lib/adwords_api/v201406/feed_item_service_registry.rb +46 -0
  129. data/lib/adwords_api/v201406/feed_mapping_service.rb +42 -0
  130. data/lib/adwords_api/v201406/feed_mapping_service_registry.rb +46 -0
  131. data/lib/adwords_api/v201406/feed_service.rb +42 -0
  132. data/lib/adwords_api/v201406/feed_service_registry.rb +46 -0
  133. data/lib/adwords_api/v201406/geo_location_service.rb +34 -0
  134. data/lib/adwords_api/v201406/geo_location_service_registry.rb +46 -0
  135. data/lib/adwords_api/v201406/label_service.rb +42 -0
  136. data/lib/adwords_api/v201406/label_service_registry.rb +46 -0
  137. data/lib/adwords_api/v201406/location_criterion_service.rb +38 -0
  138. data/lib/adwords_api/v201406/location_criterion_service_registry.rb +46 -0
  139. data/lib/adwords_api/v201406/managed_customer_service.rb +50 -0
  140. data/lib/adwords_api/v201406/managed_customer_service_registry.rb +46 -0
  141. data/lib/adwords_api/v201406/media_service.rb +42 -0
  142. data/lib/adwords_api/v201406/media_service_registry.rb +46 -0
  143. data/lib/adwords_api/v201406/mutate_job_service.rb +42 -0
  144. data/lib/adwords_api/v201406/mutate_job_service_registry.rb +46 -0
  145. data/lib/adwords_api/v201406/offline_conversion_feed_service.rb +34 -0
  146. data/lib/adwords_api/v201406/offline_conversion_feed_service_registry.rb +46 -0
  147. data/lib/adwords_api/v201406/report_definition_service.rb +34 -0
  148. data/lib/adwords_api/v201406/report_definition_service_registry.rb +46 -0
  149. data/lib/adwords_api/v201406/shared_criterion_service.rb +38 -0
  150. data/lib/adwords_api/v201406/shared_criterion_service_registry.rb +47 -0
  151. data/lib/adwords_api/v201406/shared_set_service.rb +38 -0
  152. data/lib/adwords_api/v201406/shared_set_service_registry.rb +47 -0
  153. data/lib/adwords_api/v201406/targeting_idea_service.rb +38 -0
  154. data/lib/adwords_api/v201406/targeting_idea_service_registry.rb +46 -0
  155. data/lib/adwords_api/v201406/traffic_estimator_service.rb +34 -0
  156. data/lib/adwords_api/v201406/traffic_estimator_service_registry.rb +46 -0
  157. data/lib/adwords_api/version.rb +1 -1
  158. data/lib/adwords_api.rb +1 -1
  159. data/test/adwords_api/test_adwords_api.rb +7 -3
  160. metadata +423 -274
  161. data/test/bugs/test_issue_00000063.rb +0 -141
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example illustrates how to retrieve all the campaign targets. To set
22
+ # campaign targets, run add_campaign_targeting_criteria.rb.
23
+ #
24
+ # Tags: CampaignCriterionService.get
25
+
26
+ require 'adwords_api'
27
+
28
+ def get_campaign_targeting_criteria(campaign_id)
29
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
30
+ # when called without parameters.
31
+ adwords = AdwordsApi::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
+ # adwords.logger = Logger.new('adwords_xml.log')
36
+
37
+ campaign_criterion_srv =
38
+ adwords.service(:CampaignCriterionService, API_VERSION)
39
+
40
+ # Selector to get all the targeting for this campaign.
41
+ selector = {
42
+ :fields => ['Id', 'CriteriaType', 'KeywordText'],
43
+ :predicates => [
44
+ {:field => 'CampaignId', :operator => 'EQUALS', :values => [campaign_id]}
45
+ ],
46
+ :paging => {
47
+ :start_index => 0,
48
+ :number_results => PAGE_SIZE
49
+ }
50
+ }
51
+
52
+ # Set initial values.
53
+ offset, page = 0, {}
54
+
55
+ begin
56
+ page = campaign_criterion_srv.get(selector)
57
+ if page[:entries]
58
+ page[:entries].each do |typed_criterion|
59
+ negative = typed_criterion[:xsi_type] == 'NegativeCampaignCriterion' ?
60
+ ' (negative)' : ''
61
+ criterion = typed_criterion[:criterion]
62
+ puts ("Campaign criterion%s with ID %d, type '%s' and text '%s'" +
63
+ " was found.") %
64
+ [negative, criterion[:id], criterion[:type], criterion[:text]]
65
+ end
66
+ # Increment values to request the next page.
67
+ offset += PAGE_SIZE
68
+ selector[:paging][:start_index] = offset
69
+ end
70
+ end while page[:total_num_entries] > offset
71
+
72
+ if page.include?(:total_num_entries)
73
+ puts "\tCampaign ID %d has %d criteria." %
74
+ [campaign_id, page[:total_num_entries]]
75
+ end
76
+ end
77
+
78
+ if __FILE__ == $0
79
+ API_VERSION = :v201406
80
+ PAGE_SIZE = 500
81
+
82
+ begin
83
+ # Specify campaign ID to get targeting for.
84
+ campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
85
+ get_campaign_targeting_criteria(campaign_id)
86
+
87
+ # Authorization error.
88
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
89
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
90
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
91
+ "to retrieve and store OAuth2 tokens."
92
+ puts "See this wiki page for more details:\n\n " +
93
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
94
+
95
+ # HTTP errors.
96
+ rescue AdsCommon::Errors::HttpError => e
97
+ puts "HTTP Error: %s" % e
98
+
99
+ # API errors.
100
+ rescue AdwordsApi::Errors::ApiException => e
101
+ puts "Message: %s" % e.message
102
+ puts 'Errors:'
103
+ e.errors.each_with_index do |error, index|
104
+ puts "\tError [%d]:" % (index + 1)
105
+ error.each do |field, value|
106
+ puts "\t\t%s: %s" % [field, value]
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example illustrates how to retrieve all languages and carriers available
22
+ # for targeting.
23
+ #
24
+ # Tags: ConstantDataService.getLanguageCriterion
25
+ # Tags: ConstantDataService.getCarrierCriterion
26
+
27
+ require 'adwords_api'
28
+
29
+ def get_targetable_languages_and_carriers()
30
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
31
+ # when called without parameters.
32
+ adwords = AdwordsApi::Api.new
33
+
34
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
35
+ # the configuration file or provide your own logger:
36
+ # adwords.logger = Logger.new('adwords_xml.log')
37
+
38
+ constant_data_srv = adwords.service(:ConstantDataService, API_VERSION)
39
+
40
+ # Get all languages from ConstantDataService.
41
+ languages = constant_data_srv.get_language_criterion()
42
+
43
+ if languages
44
+ languages.each do |language|
45
+ puts "Language name is '%s', ID is %d and code is '%s'." %
46
+ [language[:name], language[:id], language[:code]]
47
+ end
48
+ else
49
+ puts 'No languages were found.'
50
+ end
51
+
52
+ # Get all carriers from ConstantDataService.
53
+ carriers = constant_data_srv.get_carrier_criterion()
54
+
55
+ if carriers
56
+ carriers.each do |carrier|
57
+ puts "Carrier name is '%s', ID is %d and country code is '%s'." %
58
+ [carrier[:name], carrier[:id], carrier[:country_code]]
59
+ end
60
+ else
61
+ puts 'No carriers were retrieved.'
62
+ end
63
+ end
64
+
65
+ if __FILE__ == $0
66
+ API_VERSION = :v201406
67
+
68
+ begin
69
+ get_targetable_languages_and_carriers()
70
+
71
+ # Authorization error.
72
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
73
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
74
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
75
+ "to retrieve and store OAuth2 tokens."
76
+ puts "See this wiki page for more details:\n\n " +
77
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
78
+
79
+ # HTTP errors.
80
+ rescue AdsCommon::Errors::HttpError => e
81
+ puts "HTTP Error: %s" % e
82
+
83
+ # API errors.
84
+ rescue AdwordsApi::Errors::ApiException => e
85
+ puts "Message: %s" % e.message
86
+ puts 'Errors:'
87
+ e.errors.each_with_index do |error, index|
88
+ puts "\tError [%d]:" % (index + 1)
89
+ error.each do |field, value|
90
+ puts "\t\t%s: %s" % [field, value]
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example gets location criteria by name.
22
+ #
23
+ # Tags: LocationCriterionService.get
24
+
25
+ require 'adwords_api'
26
+
27
+ def lookup_location()
28
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
29
+ # when called without parameters.
30
+ adwords = AdwordsApi::Api.new
31
+
32
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
33
+ # the configuration file or provide your own logger:
34
+ # adwords.logger = Logger.new('adwords_xml.log')
35
+
36
+ location_criterion_srv =
37
+ adwords.service(:LocationCriterionService, API_VERSION)
38
+
39
+ # List of locations to look up.
40
+ location_names = ['Paris', 'Quebec', 'Spain', 'Deutschland']
41
+ # Locale to retrieve names in.
42
+ locale = 'en'
43
+
44
+ # Get the criteria by names.
45
+ selector = {
46
+ :fields => ['Id', 'LocationName', 'CanonicalName', 'DisplayType',
47
+ 'ParentLocations', 'Reach', 'TargetingStatus'],
48
+ :predicates => [
49
+ # Location names must match exactly, only EQUALS and IN are supported.
50
+ {:field => 'LocationName',
51
+ :operator => 'IN',
52
+ :values => location_names},
53
+ # Set the locale of the returned location names.
54
+ {:field => 'Locale', :operator => 'EQUALS', :values => [locale]}
55
+ ]
56
+ }
57
+ criteria = location_criterion_srv.get(selector)
58
+
59
+ if criteria
60
+ criteria.each do |criterion|
61
+ # Extract all parent location names as one comma-separated string.
62
+ parent_location = if criterion[:location][:parent_locations] and
63
+ !criterion[:location][:parent_locations].empty?
64
+ locations_array = criterion[:location][:parent_locations].map do |loc|
65
+ loc[:location_name]
66
+ end
67
+ locations_array.join(', ')
68
+ else
69
+ 'N/A'
70
+ end
71
+ puts ("The search term '%s' returned the location '%s' of type '%s' " +
72
+ "with ID %d, parent locations '%s' and reach %d (%s)") %
73
+ [criterion[:search_term], criterion[:location][:location_name],
74
+ criterion[:location][:criterion_type], criterion[:location][:id],
75
+ parent_location, criterion[:reach],
76
+ criterion[:location][:targeting_status]]
77
+ end
78
+ else
79
+ puts 'No criteria were returned.'
80
+ end
81
+ end
82
+
83
+ if __FILE__ == $0
84
+ API_VERSION = :v201406
85
+
86
+ begin
87
+ lookup_location()
88
+
89
+ # Authorization error.
90
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
91
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
92
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
93
+ "to retrieve and store OAuth2 tokens."
94
+ puts "See this wiki page for more details:\n\n " +
95
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
96
+
97
+ # HTTP errors.
98
+ rescue AdsCommon::Errors::HttpError => e
99
+ puts "HTTP Error: %s" % e
100
+
101
+ # API errors.
102
+ rescue AdwordsApi::Errors::ApiException => e
103
+ puts "Message: %s" % e.message
104
+ puts 'Errors:'
105
+ e.errors.each_with_index do |error, index|
106
+ puts "\tError [%d]:" % (index + 1)
107
+ error.each do |field, value|
108
+ puts "\t\t%s: %s" % [field, value]
109
+ end
110
+ end
111
+ end
112
+ end
@@ -35,9 +35,9 @@ module AdwordsApi
35
35
  end
36
36
 
37
37
  # Set defaults
38
- DEFAULT_VERSION = :v201402
38
+ DEFAULT_VERSION = :v201406
39
39
  DEFAULT_ENVIRONMENT = :PRODUCTION
40
- LATEST_VERSION = :v201402
40
+ LATEST_VERSION = :v201406
41
41
 
42
42
  # Set other constants
43
43
  API_NAME = 'AdwordsApi'
@@ -99,6 +99,7 @@ module AdwordsApi
99
99
  :CampaignCriterionService,
100
100
  :CampaignFeedService,
101
101
  :CampaignService,
102
+ :CampaignSharedSetService,
102
103
  :ConstantDataService,
103
104
  :ConversionTrackerService,
104
105
  :CustomerFeedService,
@@ -116,6 +117,48 @@ module AdwordsApi
116
117
  :MutateJobService,
117
118
  :OfflineConversionFeedService,
118
119
  :ReportDefinitionService,
120
+ :SharedCriterionService,
121
+ :SharedSetService,
122
+ :TargetingIdeaService,
123
+ :TrafficEstimatorService
124
+ ],
125
+ :v201406 => [
126
+ :AdGroupAdService,
127
+ :AdGroupBidModifierService,
128
+ :AdGroupCriterionService,
129
+ :AdGroupFeedService,
130
+ :AdGroupService,
131
+ :AdParamService,
132
+ :AdwordsUserListService,
133
+ :AlertService,
134
+ :BiddingStrategyService,
135
+ :BudgetOrderService,
136
+ :BudgetService,
137
+ :CampaignAdExtensionService,
138
+ :CampaignCriterionService,
139
+ :CampaignFeedService,
140
+ :CampaignService,
141
+ :CampaignSharedSetService,
142
+ :ConstantDataService,
143
+ :ConversionTrackerService,
144
+ :CustomerFeedService,
145
+ :CustomerService,
146
+ :CustomerSyncService,
147
+ :DataService,
148
+ :ExperimentService,
149
+ :FeedItemService,
150
+ :FeedMappingService,
151
+ :FeedService,
152
+ :GeoLocationService,
153
+ :LabelService,
154
+ :LocationCriterionService,
155
+ :ManagedCustomerService,
156
+ :MediaService,
157
+ :MutateJobService,
158
+ :OfflineConversionFeedService,
159
+ :ReportDefinitionService,
160
+ :SharedCriterionService,
161
+ :SharedSetService,
119
162
  :TargetingIdeaService,
120
163
  :TrafficEstimatorService
121
164
  ]
@@ -124,10 +167,11 @@ module AdwordsApi
124
167
  # Configure the different environments, with the base URL for each one
125
168
  @@environment_config = {
126
169
  :PRODUCTION => {
127
- :oauth_scope => 'https://adwords.google.com/api/adwords/',
170
+ :oauth_scope => 'https://www.googleapis.com/auth/adwords',
128
171
  :header_ns => 'https://adwords.google.com/api/adwords/cm/',
129
172
  :v201309 => 'https://adwords.google.com/api/adwords/',
130
- :v201402 => 'https://adwords.google.com/api/adwords/'
173
+ :v201402 => 'https://adwords.google.com/api/adwords/',
174
+ :v201406 => 'https://adwords.google.com/api/adwords/'
131
175
  }
132
176
  }
133
177
 
@@ -184,6 +228,7 @@ module AdwordsApi
184
228
  [:v201402, :CampaignCriterionService] => 'cm/',
185
229
  [:v201402, :CampaignFeedService] => 'cm/',
186
230
  [:v201402, :CampaignService] => 'cm/',
231
+ [:v201402, :CampaignSharedSetService] => 'cm/',
187
232
  [:v201402, :ConstantDataService] => 'cm/',
188
233
  [:v201402, :ConversionTrackerService] => 'cm/',
189
234
  [:v201402, :CustomerSyncService] => 'ch/',
@@ -198,6 +243,8 @@ module AdwordsApi
198
243
  [:v201402, :MutateJobService] => 'cm/',
199
244
  [:v201402, :OfflineConversionFeedService] => 'cm/',
200
245
  [:v201402, :ReportDefinitionService] => 'cm/',
246
+ [:v201402, :SharedCriterionService] => 'cm/',
247
+ [:v201402, :SharedSetService] => 'cm/',
201
248
  [:v201402, :TargetingIdeaService] => 'o/',
202
249
  [:v201402, :TrafficEstimatorService] => 'o/',
203
250
  [:v201402, :ManagedCustomerService] => 'mcm/',
@@ -205,7 +252,46 @@ module AdwordsApi
205
252
  [:v201402, :CustomerFeedService] => 'cm/',
206
253
  [:v201402, :BudgetService] => 'cm/',
207
254
  [:v201402, :BiddingStrategyService] => 'cm/',
208
- [:v201402, :AdwordsUserListService] => 'rm/'
255
+ [:v201402, :AdwordsUserListService] => 'rm/',
256
+ # v201406
257
+ [:v201406, :AdGroupAdService] => 'cm/',
258
+ [:v201406, :AdGroupBidModifierService] => 'cm/',
259
+ [:v201406, :AdGroupCriterionService] => 'cm/',
260
+ [:v201406, :AdGroupFeedService] => 'cm/',
261
+ [:v201406, :AdGroupService] => 'cm/',
262
+ [:v201406, :AdParamService] => 'cm/',
263
+ [:v201406, :AlertService] => 'mcm/',
264
+ [:v201406, :BudgetOrderService] => 'billing/',
265
+ [:v201406, :CampaignAdExtensionService] => 'cm/',
266
+ [:v201406, :CampaignCriterionService] => 'cm/',
267
+ [:v201406, :CampaignFeedService] => 'cm/',
268
+ [:v201406, :CampaignService] => 'cm/',
269
+ [:v201406, :CampaignSharedSetService] => 'cm/',
270
+ [:v201406, :ConstantDataService] => 'cm/',
271
+ [:v201406, :ConversionTrackerService] => 'cm/',
272
+ [:v201406, :CustomerSyncService] => 'ch/',
273
+ [:v201406, :DataService] => 'cm/',
274
+ [:v201406, :ExperimentService] => 'cm/',
275
+ [:v201406, :FeedItemService] => 'cm/',
276
+ [:v201406, :FeedMappingService] => 'cm/',
277
+ [:v201406, :FeedService] => 'cm/',
278
+ [:v201406, :GeoLocationService] => 'cm/',
279
+ [:v201406, :LocationCriterionService] => 'cm/',
280
+ [:v201406, :MediaService] => 'cm/',
281
+ [:v201406, :MutateJobService] => 'cm/',
282
+ [:v201406, :OfflineConversionFeedService] => 'cm/',
283
+ [:v201406, :ReportDefinitionService] => 'cm/',
284
+ [:v201406, :SharedCriterionService] => 'cm/',
285
+ [:v201406, :SharedSetService] => 'cm/',
286
+ [:v201406, :TargetingIdeaService] => 'o/',
287
+ [:v201406, :TrafficEstimatorService] => 'o/',
288
+ [:v201406, :ManagedCustomerService] => 'mcm/',
289
+ [:v201406, :CustomerService] => 'mcm/',
290
+ [:v201406, :CustomerFeedService] => 'cm/',
291
+ [:v201406, :BudgetService] => 'cm/',
292
+ [:v201406, :BiddingStrategyService] => 'cm/',
293
+ [:v201406, :AdwordsUserListService] => 'rm/',
294
+ [:v201406, :LabelService] => 'cm/'
209
295
  }
210
296
 
211
297
  # Auth constants for ClientLogin method.
@@ -0,0 +1,38 @@
1
+ # Encoding: utf-8
2
+ #
3
+ # This is auto-generated code, changes will be overwritten.
4
+ #
5
+ # Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
6
+ # License:: Licensed under the Apache License, Version 2.0.
7
+ #
8
+ # Code generated by AdsCommon library 0.9.5 on 2014-07-09 12:52:58.
9
+
10
+ require 'ads_common/savon_service'
11
+ require 'adwords_api/v201402/campaign_shared_set_service_registry'
12
+
13
+ module AdwordsApi; module V201402; module CampaignSharedSetService
14
+ class CampaignSharedSetService < AdsCommon::SavonService
15
+ def initialize(config, endpoint)
16
+ namespace = 'https://adwords.google.com/api/adwords/cm/v201402'
17
+ super(config, endpoint, namespace, :v201402)
18
+ end
19
+
20
+ def get(*args, &block)
21
+ return execute_action('get', args, &block)
22
+ end
23
+
24
+ def mutate(*args, &block)
25
+ return execute_action('mutate', args, &block)
26
+ end
27
+
28
+ private
29
+
30
+ def get_service_registry()
31
+ return CampaignSharedSetServiceRegistry
32
+ end
33
+
34
+ def get_module()
35
+ return AdwordsApi::V201402::CampaignSharedSetService
36
+ end
37
+ end
38
+ end; end; end
@@ -0,0 +1,47 @@
1
+ # Encoding: utf-8
2
+ #
3
+ # This is auto-generated code, changes will be overwritten.
4
+ #
5
+ # Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
6
+ # License:: Licensed under the Apache License, Version 2.0.
7
+ #
8
+ # Code generated by AdsCommon library 0.9.5 on 2014-07-09 12:52:58.
9
+
10
+ require 'adwords_api/errors'
11
+
12
+ module AdwordsApi; module V201402; module CampaignSharedSetService
13
+ class CampaignSharedSetServiceRegistry
14
+ CAMPAIGNSHAREDSETSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignSharedSetPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignSharedSetOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignSharedSetReturnValue", :min_occurs=>0, :max_occurs=>1}]}}}
15
+ CAMPAIGNSHAREDSETSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignSharedSet=>{:fields=>[{:name=>:shared_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:shared_set_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:shared_set_type, :type=>"SharedSetType", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CampaignSharedSet.Status", :min_occurs=>0, :max_occurs=>1}]}, :CampaignSharedSetError=>{:fields=>[{:name=>:reason, :type=>"CampaignSharedSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignSharedSetOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignSharedSetPage=>{:fields=>[{:name=>:entries, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :CampaignSharedSetReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :Operation=>{:fields=>[{:name=>:operator, :type=>"Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:operation_type, :original_name=>"Operation.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}]}, :Page=>{:fields=>[{:name=>:total_num_entries, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:page_type, :original_name=>"Page.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Predicate=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator, :type=>"Predicate.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateExceededError=>{:fields=>[{:name=>:reason, :type=>"RateExceededError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_scope, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:retry_after_seconds, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{:name=>:client_customer_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:developer_token, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_agent, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:validate_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:partial_failure, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:service_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:method_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operations, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.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}, {:name=>:api_error_type, :original_name=>"ApiError.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_exception_type, :original_name=>"ApplicationException.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Selector=>{:fields=>[{:name=>:fields, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:predicates, :type=>"Predicate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:date_range, :type=>"DateRange", :min_occurs=>0, :max_occurs=>1}, {:name=>:ordering, :type=>"OrderBy", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:paging, :type=>"Paging", :min_occurs=>0, :max_occurs=>1}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"CampaignSharedSet.Status"=>{:fields=>[]}, :"CampaignSharedSetError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :SharedSetType=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}}
16
+ CAMPAIGNSHAREDSETSERVICE_NAMESPACES = []
17
+
18
+ def self.get_method_signature(method_name)
19
+ return CAMPAIGNSHAREDSETSERVICE_METHODS[method_name.to_sym]
20
+ end
21
+
22
+ def self.get_type_signature(type_name)
23
+ return CAMPAIGNSHAREDSETSERVICE_TYPES[type_name.to_sym]
24
+ end
25
+
26
+ def self.get_namespace(index)
27
+ return CAMPAIGNSHAREDSETSERVICE_NAMESPACES[index]
28
+ end
29
+ end
30
+
31
+ # Indicates that this instance is a subtype of ApplicationException.
32
+ # Although this field is returned in the response, it is ignored on input
33
+ # and cannot be selected. Specify xsi:type instead.
34
+ class ApplicationException < AdwordsApi::Errors::ApiException
35
+ attr_reader :message # string
36
+ attr_reader :application_exception_type # string
37
+ end
38
+
39
+ class ApiException < ApplicationException
40
+ attr_reader :errors # ApiError
41
+ def initialize(exception_fault)
42
+ @array_fields ||= []
43
+ @array_fields << 'errors'
44
+ super(exception_fault, CampaignSharedSetServiceRegistry)
45
+ end
46
+ end
47
+ end; end; end
@@ -0,0 +1,38 @@
1
+ # Encoding: utf-8
2
+ #
3
+ # This is auto-generated code, changes will be overwritten.
4
+ #
5
+ # Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
6
+ # License:: Licensed under the Apache License, Version 2.0.
7
+ #
8
+ # Code generated by AdsCommon library 0.9.5 on 2014-07-09 12:52:45.
9
+
10
+ require 'ads_common/savon_service'
11
+ require 'adwords_api/v201402/shared_criterion_service_registry'
12
+
13
+ module AdwordsApi; module V201402; module SharedCriterionService
14
+ class SharedCriterionService < AdsCommon::SavonService
15
+ def initialize(config, endpoint)
16
+ namespace = 'https://adwords.google.com/api/adwords/cm/v201402'
17
+ super(config, endpoint, namespace, :v201402)
18
+ end
19
+
20
+ def get(*args, &block)
21
+ return execute_action('get', args, &block)
22
+ end
23
+
24
+ def mutate(*args, &block)
25
+ return execute_action('mutate', args, &block)
26
+ end
27
+
28
+ private
29
+
30
+ def get_service_registry()
31
+ return SharedCriterionServiceRegistry
32
+ end
33
+
34
+ def get_module()
35
+ return AdwordsApi::V201402::SharedCriterionService
36
+ end
37
+ end
38
+ end; end; end