google-adwords-api 0.20.1 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/README.md +3 -3
  4. data/examples/v201607/campaign_management/add_draft.rb +0 -1
  5. data/examples/v201607/campaign_management/add_trial.rb +0 -1
  6. data/examples/v201607/extensions/add_prices.rb +42 -44
  7. data/lib/adwords_api/api_config.rb +0 -86
  8. data/lib/adwords_api/credential_handler.rb +4 -0
  9. data/lib/adwords_api/errors.rb +11 -0
  10. data/lib/adwords_api/version.rb +1 -1
  11. data/test/adwords_api/test_credential_handler.rb +1 -1
  12. metadata +2 -165
  13. data/examples/v201601/account_management/create_account.rb +0 -88
  14. data/examples/v201601/account_management/get_account_changes.rb +0 -139
  15. data/examples/v201601/account_management/get_account_hierarchy.rb +0 -132
  16. data/examples/v201601/advanced_operations/add_ad_customizers.rb +0 -184
  17. data/examples/v201601/advanced_operations/add_ad_group_bid_modifier.rb +0 -101
  18. data/examples/v201601/advanced_operations/add_click_to_download_ad.rb +0 -133
  19. data/examples/v201601/advanced_operations/add_html5_ad.rb +0 -137
  20. data/examples/v201601/advanced_operations/add_text_ad_with_upgraded_urls.rb +0 -134
  21. data/examples/v201601/advanced_operations/create_and_attach_shared_keyword_set.rb +0 -141
  22. data/examples/v201601/advanced_operations/find_and_remove_criteria_from_shared_set.rb +0 -174
  23. data/examples/v201601/advanced_operations/get_ad_group_bid_modifiers.rb +0 -102
  24. data/examples/v201601/advanced_operations/use_shared_bidding_strategy.rb +0 -147
  25. data/examples/v201601/basic_operations/add_ad_groups.rb +0 -142
  26. data/examples/v201601/basic_operations/add_campaigns.rb +0 -139
  27. data/examples/v201601/basic_operations/add_keywords.rb +0 -114
  28. data/examples/v201601/basic_operations/add_text_ads.rb +0 -109
  29. data/examples/v201601/basic_operations/get_ad_groups.rb +0 -102
  30. data/examples/v201601/basic_operations/get_campaigns.rb +0 -97
  31. data/examples/v201601/basic_operations/get_campaigns_with_awql.rb +0 -89
  32. data/examples/v201601/basic_operations/get_keywords.rb +0 -109
  33. data/examples/v201601/basic_operations/get_text_ads.rb +0 -110
  34. data/examples/v201601/basic_operations/pause_ad.rb +0 -88
  35. data/examples/v201601/basic_operations/remove_ad.rb +0 -89
  36. data/examples/v201601/basic_operations/remove_ad_group.rb +0 -85
  37. data/examples/v201601/basic_operations/remove_campaign.rb +0 -87
  38. data/examples/v201601/basic_operations/remove_keyword.rb +0 -94
  39. data/examples/v201601/basic_operations/update_ad_group.rb +0 -85
  40. data/examples/v201601/basic_operations/update_campaign.rb +0 -86
  41. data/examples/v201601/basic_operations/update_keyword.rb +0 -106
  42. data/examples/v201601/campaign_management/add_campaign_labels.rb +0 -82
  43. data/examples/v201601/campaign_management/add_complete_campaigns_using_batch_job.rb +0 -356
  44. data/examples/v201601/campaign_management/add_experiment.rb +0 -162
  45. data/examples/v201601/campaign_management/add_keywords_in_bulk.rb +0 -153
  46. data/examples/v201601/campaign_management/add_keywords_using_incremental_batch_job.rb +0 -179
  47. data/examples/v201601/campaign_management/get_all_disapproved_ads.rb +0 -97
  48. data/examples/v201601/campaign_management/get_all_disapproved_ads_with_awql.rb +0 -89
  49. data/examples/v201601/campaign_management/get_campaigns_by_label.rb +0 -108
  50. data/examples/v201601/campaign_management/promote_experiment.rb +0 -81
  51. data/examples/v201601/campaign_management/set_ad_parameters.rb +0 -118
  52. data/examples/v201601/campaign_management/set_criterion_bid_modifier.rb +0 -104
  53. data/examples/v201601/campaign_management/validate_text_ad.rb +0 -110
  54. data/examples/v201601/error_handling/handle_partial_failures.rb +0 -130
  55. data/examples/v201601/error_handling/handle_policy_violation_error.rb +0 -141
  56. data/examples/v201601/extensions/add_google_my_business_location_extensions.rb +0 -193
  57. data/examples/v201601/extensions/add_site_links.rb +0 -164
  58. data/examples/v201601/extensions/add_site_links_using_feeds.rb +0 -281
  59. data/examples/v201601/migration/migrate_to_extension_settings.rb +0 -386
  60. data/examples/v201601/migration/upgrade_ad_url.rb +0 -93
  61. data/examples/v201601/misc/get_all_images_and_videos.rb +0 -104
  62. data/examples/v201601/misc/setup_oauth2.rb +0 -84
  63. data/examples/v201601/misc/upload_image.rb +0 -93
  64. data/examples/v201601/misc/upload_media_bundle.rb +0 -90
  65. data/examples/v201601/misc/use_oauth2_jwt.rb +0 -93
  66. data/examples/v201601/misc/use_runtime_config.rb +0 -92
  67. data/examples/v201601/optimization/estimate_keyword_traffic.rb +0 -146
  68. data/examples/v201601/optimization/get_keyword_bid_simulations.rb +0 -95
  69. data/examples/v201601/optimization/get_keyword_ideas.rb +0 -126
  70. data/examples/v201601/remarketing/add_audience.rb +0 -118
  71. data/examples/v201601/remarketing/add_conversion_tracker.rb +0 -97
  72. data/examples/v201601/remarketing/add_crm_based_user_list.rb +0 -119
  73. data/examples/v201601/remarketing/add_rule_based_user_lists.rb +0 -167
  74. data/examples/v201601/remarketing/upload_offline_conversions.rb +0 -98
  75. data/examples/v201601/reporting/download_criteria_report.rb +0 -92
  76. data/examples/v201601/reporting/download_criteria_report_with_awql.rb +0 -93
  77. data/examples/v201601/reporting/get_report_fields.rb +0 -75
  78. data/examples/v201601/reporting/parallel_report_download.rb +0 -164
  79. data/examples/v201601/reporting/stream_criteria_report_results.rb +0 -97
  80. data/examples/v201601/shopping_campaigns/add_product_partition_tree.rb +0 -267
  81. data/examples/v201601/shopping_campaigns/add_product_scope.rb +0 -129
  82. data/examples/v201601/shopping_campaigns/add_shopping_campaign.rb +0 -129
  83. data/examples/v201601/shopping_campaigns/get_product_category_taxonomy.rb +0 -115
  84. data/examples/v201601/targeting/add_campaign_targeting_criteria.rb +0 -180
  85. data/examples/v201601/targeting/add_demographic_targeting_criteria.rb +0 -112
  86. data/examples/v201601/targeting/get_campaign_targeting_criteria.rb +0 -106
  87. data/examples/v201601/targeting/get_targetable_languages_and_carriers.rb +0 -89
  88. data/examples/v201601/targeting/lookup_location.rb +0 -108
  89. data/examples/v201605/migration/upgrade_ad_url.rb +0 -93
  90. data/examples/v201607/migration/upgrade_ad_url.rb +0 -93
  91. data/lib/adwords_api/v201601/account_label_service.rb +0 -46
  92. data/lib/adwords_api/v201601/account_label_service_registry.rb +0 -46
  93. data/lib/adwords_api/v201601/ad_customizer_feed_service.rb +0 -46
  94. data/lib/adwords_api/v201601/ad_customizer_feed_service_registry.rb +0 -46
  95. data/lib/adwords_api/v201601/ad_group_ad_service.rb +0 -70
  96. data/lib/adwords_api/v201601/ad_group_ad_service_registry.rb +0 -46
  97. data/lib/adwords_api/v201601/ad_group_bid_modifier_service.rb +0 -54
  98. data/lib/adwords_api/v201601/ad_group_bid_modifier_service_registry.rb +0 -46
  99. data/lib/adwords_api/v201601/ad_group_criterion_service.rb +0 -62
  100. data/lib/adwords_api/v201601/ad_group_criterion_service_registry.rb +0 -46
  101. data/lib/adwords_api/v201601/ad_group_extension_setting_service.rb +0 -54
  102. data/lib/adwords_api/v201601/ad_group_extension_setting_service_registry.rb +0 -46
  103. data/lib/adwords_api/v201601/ad_group_feed_service.rb +0 -54
  104. data/lib/adwords_api/v201601/ad_group_feed_service_registry.rb +0 -46
  105. data/lib/adwords_api/v201601/ad_group_service.rb +0 -62
  106. data/lib/adwords_api/v201601/ad_group_service_registry.rb +0 -46
  107. data/lib/adwords_api/v201601/ad_param_service.rb +0 -46
  108. data/lib/adwords_api/v201601/ad_param_service_registry.rb +0 -46
  109. data/lib/adwords_api/v201601/adwords_user_list_service.rb +0 -54
  110. data/lib/adwords_api/v201601/adwords_user_list_service_registry.rb +0 -46
  111. data/lib/adwords_api/v201601/batch_job_service.rb +0 -54
  112. data/lib/adwords_api/v201601/batch_job_service_registry.rb +0 -46
  113. data/lib/adwords_api/v201601/bidding_strategy_service.rb +0 -54
  114. data/lib/adwords_api/v201601/bidding_strategy_service_registry.rb +0 -46
  115. data/lib/adwords_api/v201601/budget_order_service.rb +0 -54
  116. data/lib/adwords_api/v201601/budget_order_service_registry.rb +0 -46
  117. data/lib/adwords_api/v201601/budget_service.rb +0 -54
  118. data/lib/adwords_api/v201601/budget_service_registry.rb +0 -46
  119. data/lib/adwords_api/v201601/campaign_criterion_service.rb +0 -54
  120. data/lib/adwords_api/v201601/campaign_criterion_service_registry.rb +0 -46
  121. data/lib/adwords_api/v201601/campaign_extension_setting_service.rb +0 -54
  122. data/lib/adwords_api/v201601/campaign_extension_setting_service_registry.rb +0 -46
  123. data/lib/adwords_api/v201601/campaign_feed_service.rb +0 -54
  124. data/lib/adwords_api/v201601/campaign_feed_service_registry.rb +0 -46
  125. data/lib/adwords_api/v201601/campaign_service.rb +0 -62
  126. data/lib/adwords_api/v201601/campaign_service_registry.rb +0 -46
  127. data/lib/adwords_api/v201601/campaign_shared_set_service.rb +0 -54
  128. data/lib/adwords_api/v201601/campaign_shared_set_service_registry.rb +0 -46
  129. data/lib/adwords_api/v201601/constant_data_service.rb +0 -110
  130. data/lib/adwords_api/v201601/constant_data_service_registry.rb +0 -46
  131. data/lib/adwords_api/v201601/conversion_tracker_service.rb +0 -54
  132. data/lib/adwords_api/v201601/conversion_tracker_service_registry.rb +0 -46
  133. data/lib/adwords_api/v201601/customer_extension_setting_service.rb +0 -54
  134. data/lib/adwords_api/v201601/customer_extension_setting_service_registry.rb +0 -46
  135. data/lib/adwords_api/v201601/customer_feed_service.rb +0 -54
  136. data/lib/adwords_api/v201601/customer_feed_service_registry.rb +0 -46
  137. data/lib/adwords_api/v201601/customer_service.rb +0 -54
  138. data/lib/adwords_api/v201601/customer_service_registry.rb +0 -46
  139. data/lib/adwords_api/v201601/customer_sync_service.rb +0 -38
  140. data/lib/adwords_api/v201601/customer_sync_service_registry.rb +0 -47
  141. data/lib/adwords_api/v201601/data_service.rb +0 -78
  142. data/lib/adwords_api/v201601/data_service_registry.rb +0 -46
  143. data/lib/adwords_api/v201601/experiment_service.rb +0 -46
  144. data/lib/adwords_api/v201601/experiment_service_registry.rb +0 -46
  145. data/lib/adwords_api/v201601/feed_item_service.rb +0 -54
  146. data/lib/adwords_api/v201601/feed_item_service_registry.rb +0 -46
  147. data/lib/adwords_api/v201601/feed_mapping_service.rb +0 -54
  148. data/lib/adwords_api/v201601/feed_mapping_service_registry.rb +0 -46
  149. data/lib/adwords_api/v201601/feed_service.rb +0 -54
  150. data/lib/adwords_api/v201601/feed_service_registry.rb +0 -46
  151. data/lib/adwords_api/v201601/label_service.rb +0 -54
  152. data/lib/adwords_api/v201601/label_service_registry.rb +0 -46
  153. data/lib/adwords_api/v201601/location_criterion_service.rb +0 -46
  154. data/lib/adwords_api/v201601/location_criterion_service_registry.rb +0 -46
  155. data/lib/adwords_api/v201601/managed_customer_service.rb +0 -78
  156. data/lib/adwords_api/v201601/managed_customer_service_registry.rb +0 -46
  157. data/lib/adwords_api/v201601/media_service.rb +0 -54
  158. data/lib/adwords_api/v201601/media_service_registry.rb +0 -46
  159. data/lib/adwords_api/v201601/mutate_job_service.rb +0 -54
  160. data/lib/adwords_api/v201601/mutate_job_service_registry.rb +0 -46
  161. data/lib/adwords_api/v201601/offline_conversion_feed_service.rb +0 -38
  162. data/lib/adwords_api/v201601/offline_conversion_feed_service_registry.rb +0 -46
  163. data/lib/adwords_api/v201601/report_definition_service.rb +0 -38
  164. data/lib/adwords_api/v201601/report_definition_service_registry.rb +0 -46
  165. data/lib/adwords_api/v201601/shared_criterion_service.rb +0 -54
  166. data/lib/adwords_api/v201601/shared_criterion_service_registry.rb +0 -46
  167. data/lib/adwords_api/v201601/shared_set_service.rb +0 -54
  168. data/lib/adwords_api/v201601/shared_set_service_registry.rb +0 -46
  169. data/lib/adwords_api/v201601/targeting_idea_service.rb +0 -38
  170. data/lib/adwords_api/v201601/targeting_idea_service_registry.rb +0 -46
  171. data/lib/adwords_api/v201601/traffic_estimator_service.rb +0 -38
  172. data/lib/adwords_api/v201601/traffic_estimator_service_registry.rb +0 -46
  173. data/test/templates/v201601/basic_operations_get_campaigns.def +0 -116
  174. data/test/templates/v201601/basic_operations_update_keyword.def +0 -125
  175. data/test/templates/v201601/misc_use_oauth2_jwt.def +0 -131
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 136760f6dc477dd93488173dcb9a11a8808820cc
4
- data.tar.gz: 27e092050cf90e18598a55347d87efc3ffe98d8f
3
+ metadata.gz: d73022e994632c2dc38905e4023f36a312485bfb
4
+ data.tar.gz: f987ecd040907e791cd475e686baa73b8894b0d8
5
5
  SHA512:
6
- metadata.gz: 133410f71db8da7aca450cabeac85e174feb8732124aeceed986c2720a3b80f4e444ed34741ffe2600b53178ab3fb1ecf9a86d9fc267b67fc7525a24873f4d93
7
- data.tar.gz: 4d2056f3a4fa4b1101b42b54d9693b7a4930d9631824f7166078b17a7280f5a7daa83c16fdd13870ffddf921112bd993afd741e75d5de6e8274f00d34b284679
6
+ metadata.gz: d2c2e11cdb4970db90341a168c87a62089d1c8977ffb4057cde289f7bfdb4a8b55c0bc22792408be0eb99fc4eeec2636f6524c4b729149ee5f5a27802955f5c3
7
+ data.tar.gz: 50445dba9264e6e0050ce45318c8173ce04738d4cf1a575e9ad1e17ceb8bab369aed1a45f1d747b110455a15dc643f46c607635f8ecfced822a996ae7ecb4281
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 0.21.0:
2
+ - Removed deprecated API version v201601.
3
+ - Disallowed user agents with non-ASCII characters.
4
+
1
5
  0.20.1:
2
6
  - Support and examples for v201607.
3
7
  - Fixed issue #91 related to BJS utilities handling special characters.
data/README.md CHANGED
@@ -69,7 +69,7 @@ The basics of making a request are:
69
69
 
70
70
  3. Specify which service you're looking to use, and which version:
71
71
 
72
- campaign_srv = adwords.service(:CampaignService, :v201605)
72
+ campaign_srv = adwords.service(:CampaignService, :v201607)
73
73
 
74
74
  4. You should now be able to just use the API methods in the returned object:
75
75
 
@@ -191,7 +191,7 @@ To target a specific version:
191
191
 
192
192
  For example:
193
193
 
194
- $ rake generate[v201605]
194
+ $ rake generate[v201607]
195
195
 
196
196
  To target a specific service in a specific version:
197
197
 
@@ -199,7 +199,7 @@ To target a specific service in a specific version:
199
199
 
200
200
  For example:
201
201
 
202
- $ rake generate[v201605,CampaignService]
202
+ $ rake generate[v201607,CampaignService]
203
203
 
204
204
  To build the gems:
205
205
 
@@ -111,4 +111,3 @@ if __FILE__ == $0
111
111
  end
112
112
  end
113
113
  end
114
-
@@ -139,4 +139,3 @@ if __FILE__ == $0
139
139
  end
140
140
  end
141
141
  end
142
-
@@ -64,48 +64,30 @@ def add_prices(campaign_id)
64
64
  },
65
65
  # To create a price extension, at least three table rows are needed.
66
66
  :table_rows => [
67
- {
68
- :header => 'Scrubs',
69
- :description => 'Body Scrub, Salt Scrub',
70
- :final_urls => {
71
- :urls => ['http://www.example.com/scrubs']
72
- },
73
- :price => {
74
- :money => {
75
- :micro_amount => 60 * MICROS_PER_DOLLAR
76
- },
77
- :currency_code => 'USD'
78
- },
79
- :price_unit => 'PER_HOUR'
80
- },
81
- {
82
- :header => 'Hair Cuts',
83
- :description => 'Once a month',
84
- :final_urls => {
85
- :urls => ['http://www.example.com/haircuts']
86
- },
87
- :price => {
88
- :money => {
89
- :micro_amount => 75 * MICROS_PER_DOLLAR
90
- },
91
- :currency_code => 'USD'
92
- },
93
- :price_unit => 'PER_MONTH'
94
- },
95
- {
96
- :header => 'Skin Care Package',
97
- :description => 'Four times a month',
98
- :final_urls => {
99
- :urls => ['http://www.example.com/skincarepackage']
100
- },
101
- :price => {
102
- :money => {
103
- :micro_amount => 250 * MICROS_PER_DOLLAR
104
- },
105
- :currency_code => 'USD'
106
- },
107
- :price_unit => 'PER_MONTH'
108
- }
67
+ create_price_table_row(
68
+ 'Scrubs',
69
+ 'Body Scrub, Salt Scrub',
70
+ 'http://www.example.com/scrubs',
71
+ 60000000,
72
+ 'USD',
73
+ 'PER_HOUR'
74
+ ),
75
+ create_price_table_row(
76
+ 'Hair Cuts',
77
+ 'Once a month',
78
+ 'http://www.example.com/haircuts',
79
+ 75000000,
80
+ 'USD',
81
+ 'PER_MONTH'
82
+ ),
83
+ create_price_table_row(
84
+ 'Skin Care Package',
85
+ 'Four times a month',
86
+ 'http://www.example.com/skincarepackage',
87
+ 250000000,
88
+ 'USD',
89
+ 'PER_MONTH'
90
+ )
109
91
  ]
110
92
  }
111
93
 
@@ -128,11 +110,27 @@ def add_prices(campaign_id)
128
110
  new_extension_setting[:extension_type]
129
111
  end
130
112
 
113
+ def create_price_table_row(
114
+ header, description, final_url, price_in_micros, currency_code, price_unit)
115
+ return {
116
+ :header => header,
117
+ :description => description,
118
+ :final_urls => {
119
+ :urls => [final_url]
120
+ },
121
+ :price => {
122
+ :money => {
123
+ :micro_amount => price_in_micros
124
+ },
125
+ :currency_code => currency_code
126
+ },
127
+ :price_unit => price_unit
128
+ }
129
+ end
130
+
131
131
  if __FILE__ == $0
132
132
  API_VERSION = :v201607
133
133
 
134
- MICROS_PER_DOLLAR = 1000000
135
-
136
134
  begin
137
135
  # Campaign ID to add site link to.
138
136
  campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
@@ -43,49 +43,6 @@ module AdwordsApi
43
43
 
44
44
  # Configure the services available to each version
45
45
  @@service_config = {
46
- :v201601 => [
47
- :AccountLabelService,
48
- :AdCustomizerFeedService,
49
- :AdGroupAdService,
50
- :AdGroupBidModifierService,
51
- :AdGroupCriterionService,
52
- :AdGroupExtensionSettingService,
53
- :AdGroupFeedService,
54
- :AdGroupService,
55
- :AdParamService,
56
- :AdwordsUserListService,
57
- :BatchJobService,
58
- :BiddingStrategyService,
59
- :BudgetOrderService,
60
- :BudgetService,
61
- :CampaignCriterionService,
62
- :CampaignExtensionSettingService,
63
- :CampaignFeedService,
64
- :CampaignService,
65
- :CampaignSharedSetService,
66
- :ConstantDataService,
67
- :ConversionTrackerService,
68
- :CustomerExtensionSettingService,
69
- :CustomerFeedService,
70
- :CustomerService,
71
- :CustomerSyncService,
72
- :DataService,
73
- :ExperimentService,
74
- :FeedItemService,
75
- :FeedMappingService,
76
- :FeedService,
77
- :LabelService,
78
- :LocationCriterionService,
79
- :ManagedCustomerService,
80
- :MediaService,
81
- :MutateJobService,
82
- :OfflineConversionFeedService,
83
- :ReportDefinitionService,
84
- :SharedCriterionService,
85
- :SharedSetService,
86
- :TargetingIdeaService,
87
- :TrafficEstimatorService
88
- ],
89
46
  :v201603 => [
90
47
  :AccountLabelService,
91
48
  :AdCustomizerFeedService,
@@ -231,7 +188,6 @@ module AdwordsApi
231
188
  :PRODUCTION => {
232
189
  :oauth_scope => 'https://www.googleapis.com/auth/adwords',
233
190
  :header_ns => 'https://adwords.google.com/api/adwords/cm/',
234
- :v201601 => 'https://adwords.google.com/api/adwords/',
235
191
  :v201603 => 'https://adwords.google.com/api/adwords/',
236
192
  :v201605 => 'https://adwords.google.com/api/adwords/',
237
193
  :v201607 => 'https://adwords.google.com/api/adwords/'
@@ -241,48 +197,6 @@ module AdwordsApi
241
197
  # Configure the subdirectories for each version / service pair.
242
198
  # A missing pair means that only the base URL is used.
243
199
  @@subdir_config = {
244
- # v201601
245
- [:v201601, :AccountLabelService] => 'mcm/',
246
- [:v201601, :AdCustomizerFeedService] => 'cm/',
247
- [:v201601, :AdGroupAdService] => 'cm/',
248
- [:v201601, :AdGroupBidModifierService] => 'cm/',
249
- [:v201601, :AdGroupCriterionService] => 'cm/',
250
- [:v201601, :AdGroupExtensionSettingService] => 'cm/',
251
- [:v201601, :AdGroupFeedService] => 'cm/',
252
- [:v201601, :AdGroupService] => 'cm/',
253
- [:v201601, :AdParamService] => 'cm/',
254
- [:v201601, :BatchJobService] => 'cm/',
255
- [:v201601, :BudgetOrderService] => 'billing/',
256
- [:v201601, :CampaignCriterionService] => 'cm/',
257
- [:v201601, :CampaignExtensionSettingService] => 'cm/',
258
- [:v201601, :CampaignFeedService] => 'cm/',
259
- [:v201601, :CampaignService] => 'cm/',
260
- [:v201601, :CampaignSharedSetService] => 'cm/',
261
- [:v201601, :ConstantDataService] => 'cm/',
262
- [:v201601, :ConversionTrackerService] => 'cm/',
263
- [:v201601, :CustomerExtensionSettingService] => 'cm/',
264
- [:v201601, :CustomerSyncService] => 'ch/',
265
- [:v201601, :DataService] => 'cm/',
266
- [:v201601, :ExperimentService] => 'cm/',
267
- [:v201601, :FeedItemService] => 'cm/',
268
- [:v201601, :FeedMappingService] => 'cm/',
269
- [:v201601, :FeedService] => 'cm/',
270
- [:v201601, :LocationCriterionService] => 'cm/',
271
- [:v201601, :MediaService] => 'cm/',
272
- [:v201601, :MutateJobService] => 'cm/',
273
- [:v201601, :OfflineConversionFeedService] => 'cm/',
274
- [:v201601, :ReportDefinitionService] => 'cm/',
275
- [:v201601, :SharedCriterionService] => 'cm/',
276
- [:v201601, :SharedSetService] => 'cm/',
277
- [:v201601, :TargetingIdeaService] => 'o/',
278
- [:v201601, :TrafficEstimatorService] => 'o/',
279
- [:v201601, :ManagedCustomerService] => 'mcm/',
280
- [:v201601, :CustomerService] => 'mcm/',
281
- [:v201601, :CustomerFeedService] => 'cm/',
282
- [:v201601, :BudgetService] => 'cm/',
283
- [:v201601, :BiddingStrategyService] => 'cm/',
284
- [:v201601, :AdwordsUserListService] => 'rm/',
285
- [:v201601, :LabelService] => 'cm/',
286
200
  # v201603
287
201
  [:v201603, :AccountLabelService] => 'mcm/',
288
202
  [:v201603, :AdCustomizerFeedService] => 'cm/',
@@ -54,6 +54,10 @@ module AdwordsApi
54
54
  # Generates string to use as user agent in headers.
55
55
  def generate_user_agent(extra_ids = [])
56
56
  agent_app = @config.read('authentication.user_agent')
57
+ if !agent_app.nil? && !agent_app.ascii_only?
58
+ raise AdwordsApi::Errors::InvalidUserAgentError.new(
59
+ 'User agent contains non-ASCII characters.', agent_app)
60
+ end
57
61
  extra_ids << ['AwApi-Ruby/%s' % AdwordsApi::ApiConfig::CLIENT_LIB_VERSION]
58
62
  super(extra_ids, agent_app)
59
63
  end
@@ -93,7 +93,18 @@ module AdwordsApi
93
93
  end
94
94
  end
95
95
 
96
+ # Error for use an unsupported operation in a batch job.
96
97
  class InvalidBatchJobOperationError < AdsCommon::Errors::ApiException
97
98
  end
99
+
100
+ # Error for using an invalid user agent string.
101
+ class InvalidUserAgentError < AdsCommon::Errors::Error
102
+ attr_reader :user_agent
103
+
104
+ def initialize(message, user_agent)
105
+ super(message)
106
+ @user_agent = user_agent
107
+ end
108
+ end
98
109
  end
99
110
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module AdwordsApi
21
21
  module ApiConfig
22
- CLIENT_LIB_VERSION = '0.20.1'
22
+ CLIENT_LIB_VERSION = '0.21.0'
23
23
  end
24
24
  end
@@ -16,7 +16,7 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
  #
19
- # Tests credential handler.
19
+ # Tests adwords credential handler.
20
20
 
21
21
  require 'logger'
22
22
  require 'test/unit'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-adwords-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danial Klimkin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-07-29 00:00:00.000000000 Z
12
+ date: 2016-08-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-ads-common
@@ -64,82 +64,6 @@ files:
64
64
  - ChangeLog
65
65
  - README.md
66
66
  - adwords_api.yml
67
- - examples/v201601/account_management/create_account.rb
68
- - examples/v201601/account_management/get_account_changes.rb
69
- - examples/v201601/account_management/get_account_hierarchy.rb
70
- - examples/v201601/advanced_operations/add_ad_customizers.rb
71
- - examples/v201601/advanced_operations/add_ad_group_bid_modifier.rb
72
- - examples/v201601/advanced_operations/add_click_to_download_ad.rb
73
- - examples/v201601/advanced_operations/add_html5_ad.rb
74
- - examples/v201601/advanced_operations/add_text_ad_with_upgraded_urls.rb
75
- - examples/v201601/advanced_operations/create_and_attach_shared_keyword_set.rb
76
- - examples/v201601/advanced_operations/find_and_remove_criteria_from_shared_set.rb
77
- - examples/v201601/advanced_operations/get_ad_group_bid_modifiers.rb
78
- - examples/v201601/advanced_operations/use_shared_bidding_strategy.rb
79
- - examples/v201601/basic_operations/add_ad_groups.rb
80
- - examples/v201601/basic_operations/add_campaigns.rb
81
- - examples/v201601/basic_operations/add_keywords.rb
82
- - examples/v201601/basic_operations/add_text_ads.rb
83
- - examples/v201601/basic_operations/get_ad_groups.rb
84
- - examples/v201601/basic_operations/get_campaigns.rb
85
- - examples/v201601/basic_operations/get_campaigns_with_awql.rb
86
- - examples/v201601/basic_operations/get_keywords.rb
87
- - examples/v201601/basic_operations/get_text_ads.rb
88
- - examples/v201601/basic_operations/pause_ad.rb
89
- - examples/v201601/basic_operations/remove_ad.rb
90
- - examples/v201601/basic_operations/remove_ad_group.rb
91
- - examples/v201601/basic_operations/remove_campaign.rb
92
- - examples/v201601/basic_operations/remove_keyword.rb
93
- - examples/v201601/basic_operations/update_ad_group.rb
94
- - examples/v201601/basic_operations/update_campaign.rb
95
- - examples/v201601/basic_operations/update_keyword.rb
96
- - examples/v201601/campaign_management/add_campaign_labels.rb
97
- - examples/v201601/campaign_management/add_complete_campaigns_using_batch_job.rb
98
- - examples/v201601/campaign_management/add_experiment.rb
99
- - examples/v201601/campaign_management/add_keywords_in_bulk.rb
100
- - examples/v201601/campaign_management/add_keywords_using_incremental_batch_job.rb
101
- - examples/v201601/campaign_management/get_all_disapproved_ads.rb
102
- - examples/v201601/campaign_management/get_all_disapproved_ads_with_awql.rb
103
- - examples/v201601/campaign_management/get_campaigns_by_label.rb
104
- - examples/v201601/campaign_management/promote_experiment.rb
105
- - examples/v201601/campaign_management/set_ad_parameters.rb
106
- - examples/v201601/campaign_management/set_criterion_bid_modifier.rb
107
- - examples/v201601/campaign_management/validate_text_ad.rb
108
- - examples/v201601/error_handling/handle_partial_failures.rb
109
- - examples/v201601/error_handling/handle_policy_violation_error.rb
110
- - examples/v201601/extensions/add_google_my_business_location_extensions.rb
111
- - examples/v201601/extensions/add_site_links.rb
112
- - examples/v201601/extensions/add_site_links_using_feeds.rb
113
- - examples/v201601/migration/migrate_to_extension_settings.rb
114
- - examples/v201601/migration/upgrade_ad_url.rb
115
- - examples/v201601/misc/get_all_images_and_videos.rb
116
- - examples/v201601/misc/setup_oauth2.rb
117
- - examples/v201601/misc/upload_image.rb
118
- - examples/v201601/misc/upload_media_bundle.rb
119
- - examples/v201601/misc/use_oauth2_jwt.rb
120
- - examples/v201601/misc/use_runtime_config.rb
121
- - examples/v201601/optimization/estimate_keyword_traffic.rb
122
- - examples/v201601/optimization/get_keyword_bid_simulations.rb
123
- - examples/v201601/optimization/get_keyword_ideas.rb
124
- - examples/v201601/remarketing/add_audience.rb
125
- - examples/v201601/remarketing/add_conversion_tracker.rb
126
- - examples/v201601/remarketing/add_crm_based_user_list.rb
127
- - examples/v201601/remarketing/add_rule_based_user_lists.rb
128
- - examples/v201601/remarketing/upload_offline_conversions.rb
129
- - examples/v201601/reporting/download_criteria_report.rb
130
- - examples/v201601/reporting/download_criteria_report_with_awql.rb
131
- - examples/v201601/reporting/get_report_fields.rb
132
- - examples/v201601/reporting/parallel_report_download.rb
133
- - examples/v201601/reporting/stream_criteria_report_results.rb
134
- - examples/v201601/shopping_campaigns/add_product_partition_tree.rb
135
- - examples/v201601/shopping_campaigns/add_product_scope.rb
136
- - examples/v201601/shopping_campaigns/add_shopping_campaign.rb
137
- - examples/v201601/shopping_campaigns/get_product_category_taxonomy.rb
138
- - examples/v201601/targeting/add_campaign_targeting_criteria.rb
139
- - examples/v201601/targeting/add_demographic_targeting_criteria.rb
140
- - examples/v201601/targeting/get_campaign_targeting_criteria.rb
141
- - examples/v201601/targeting/get_targetable_languages_and_carriers.rb
142
- - examples/v201601/targeting/lookup_location.rb
143
67
  - examples/v201603/account_management/create_account.rb
144
68
  - examples/v201603/account_management/get_account_changes.rb
145
69
  - examples/v201603/account_management/get_account_hierarchy.rb
@@ -271,7 +195,6 @@ files:
271
195
  - examples/v201605/extensions/add_site_links.rb
272
196
  - examples/v201605/extensions/add_site_links_using_feeds.rb
273
197
  - examples/v201605/migration/migrate_to_extension_settings.rb
274
- - examples/v201605/migration/upgrade_ad_url.rb
275
198
  - examples/v201605/misc/get_all_images_and_videos.rb
276
199
  - examples/v201605/misc/setup_oauth2.rb
277
200
  - examples/v201605/misc/upload_image.rb
@@ -354,7 +277,6 @@ files:
354
277
  - examples/v201607/extensions/add_site_links.rb
355
278
  - examples/v201607/extensions/add_site_links_using_feeds.rb
356
279
  - examples/v201607/migration/migrate_to_extension_settings.rb
357
- - examples/v201607/migration/upgrade_ad_url.rb
358
280
  - examples/v201607/misc/get_all_images_and_videos.rb
359
281
  - examples/v201607/misc/setup_oauth2.rb
360
282
  - examples/v201607/misc/upload_image.rb
@@ -395,88 +317,6 @@ files:
395
317
  - lib/adwords_api/report_utils.rb
396
318
  - lib/adwords_api/utils.rb
397
319
  - lib/adwords_api/utils_reporter.rb
398
- - lib/adwords_api/v201601/account_label_service.rb
399
- - lib/adwords_api/v201601/account_label_service_registry.rb
400
- - lib/adwords_api/v201601/ad_customizer_feed_service.rb
401
- - lib/adwords_api/v201601/ad_customizer_feed_service_registry.rb
402
- - lib/adwords_api/v201601/ad_group_ad_service.rb
403
- - lib/adwords_api/v201601/ad_group_ad_service_registry.rb
404
- - lib/adwords_api/v201601/ad_group_bid_modifier_service.rb
405
- - lib/adwords_api/v201601/ad_group_bid_modifier_service_registry.rb
406
- - lib/adwords_api/v201601/ad_group_criterion_service.rb
407
- - lib/adwords_api/v201601/ad_group_criterion_service_registry.rb
408
- - lib/adwords_api/v201601/ad_group_extension_setting_service.rb
409
- - lib/adwords_api/v201601/ad_group_extension_setting_service_registry.rb
410
- - lib/adwords_api/v201601/ad_group_feed_service.rb
411
- - lib/adwords_api/v201601/ad_group_feed_service_registry.rb
412
- - lib/adwords_api/v201601/ad_group_service.rb
413
- - lib/adwords_api/v201601/ad_group_service_registry.rb
414
- - lib/adwords_api/v201601/ad_param_service.rb
415
- - lib/adwords_api/v201601/ad_param_service_registry.rb
416
- - lib/adwords_api/v201601/adwords_user_list_service.rb
417
- - lib/adwords_api/v201601/adwords_user_list_service_registry.rb
418
- - lib/adwords_api/v201601/batch_job_service.rb
419
- - lib/adwords_api/v201601/batch_job_service_registry.rb
420
- - lib/adwords_api/v201601/bidding_strategy_service.rb
421
- - lib/adwords_api/v201601/bidding_strategy_service_registry.rb
422
- - lib/adwords_api/v201601/budget_order_service.rb
423
- - lib/adwords_api/v201601/budget_order_service_registry.rb
424
- - lib/adwords_api/v201601/budget_service.rb
425
- - lib/adwords_api/v201601/budget_service_registry.rb
426
- - lib/adwords_api/v201601/campaign_criterion_service.rb
427
- - lib/adwords_api/v201601/campaign_criterion_service_registry.rb
428
- - lib/adwords_api/v201601/campaign_extension_setting_service.rb
429
- - lib/adwords_api/v201601/campaign_extension_setting_service_registry.rb
430
- - lib/adwords_api/v201601/campaign_feed_service.rb
431
- - lib/adwords_api/v201601/campaign_feed_service_registry.rb
432
- - lib/adwords_api/v201601/campaign_service.rb
433
- - lib/adwords_api/v201601/campaign_service_registry.rb
434
- - lib/adwords_api/v201601/campaign_shared_set_service.rb
435
- - lib/adwords_api/v201601/campaign_shared_set_service_registry.rb
436
- - lib/adwords_api/v201601/constant_data_service.rb
437
- - lib/adwords_api/v201601/constant_data_service_registry.rb
438
- - lib/adwords_api/v201601/conversion_tracker_service.rb
439
- - lib/adwords_api/v201601/conversion_tracker_service_registry.rb
440
- - lib/adwords_api/v201601/customer_extension_setting_service.rb
441
- - lib/adwords_api/v201601/customer_extension_setting_service_registry.rb
442
- - lib/adwords_api/v201601/customer_feed_service.rb
443
- - lib/adwords_api/v201601/customer_feed_service_registry.rb
444
- - lib/adwords_api/v201601/customer_service.rb
445
- - lib/adwords_api/v201601/customer_service_registry.rb
446
- - lib/adwords_api/v201601/customer_sync_service.rb
447
- - lib/adwords_api/v201601/customer_sync_service_registry.rb
448
- - lib/adwords_api/v201601/data_service.rb
449
- - lib/adwords_api/v201601/data_service_registry.rb
450
- - lib/adwords_api/v201601/experiment_service.rb
451
- - lib/adwords_api/v201601/experiment_service_registry.rb
452
- - lib/adwords_api/v201601/feed_item_service.rb
453
- - lib/adwords_api/v201601/feed_item_service_registry.rb
454
- - lib/adwords_api/v201601/feed_mapping_service.rb
455
- - lib/adwords_api/v201601/feed_mapping_service_registry.rb
456
- - lib/adwords_api/v201601/feed_service.rb
457
- - lib/adwords_api/v201601/feed_service_registry.rb
458
- - lib/adwords_api/v201601/label_service.rb
459
- - lib/adwords_api/v201601/label_service_registry.rb
460
- - lib/adwords_api/v201601/location_criterion_service.rb
461
- - lib/adwords_api/v201601/location_criterion_service_registry.rb
462
- - lib/adwords_api/v201601/managed_customer_service.rb
463
- - lib/adwords_api/v201601/managed_customer_service_registry.rb
464
- - lib/adwords_api/v201601/media_service.rb
465
- - lib/adwords_api/v201601/media_service_registry.rb
466
- - lib/adwords_api/v201601/mutate_job_service.rb
467
- - lib/adwords_api/v201601/mutate_job_service_registry.rb
468
- - lib/adwords_api/v201601/offline_conversion_feed_service.rb
469
- - lib/adwords_api/v201601/offline_conversion_feed_service_registry.rb
470
- - lib/adwords_api/v201601/report_definition_service.rb
471
- - lib/adwords_api/v201601/report_definition_service_registry.rb
472
- - lib/adwords_api/v201601/shared_criterion_service.rb
473
- - lib/adwords_api/v201601/shared_criterion_service_registry.rb
474
- - lib/adwords_api/v201601/shared_set_service.rb
475
- - lib/adwords_api/v201601/shared_set_service_registry.rb
476
- - lib/adwords_api/v201601/targeting_idea_service.rb
477
- - lib/adwords_api/v201601/targeting_idea_service_registry.rb
478
- - lib/adwords_api/v201601/traffic_estimator_service.rb
479
- - lib/adwords_api/v201601/traffic_estimator_service_registry.rb
480
320
  - lib/adwords_api/v201603/account_label_service.rb
481
321
  - lib/adwords_api/v201603/account_label_service_registry.rb
482
322
  - lib/adwords_api/v201603/ad_customizer_feed_service.rb
@@ -753,9 +593,6 @@ files:
753
593
  - test/coverage.rb
754
594
  - test/suite_integration.rb
755
595
  - test/suite_unittests.rb
756
- - test/templates/v201601/basic_operations_get_campaigns.def
757
- - test/templates/v201601/basic_operations_update_keyword.def
758
- - test/templates/v201601/misc_use_oauth2_jwt.def
759
596
  - test/templates/v201603/basic_operations_get_campaigns.def
760
597
  - test/templates/v201603/basic_operations_update_keyword.def
761
598
  - test/templates/v201603/misc_use_oauth2_jwt.def