bing_ads_api 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/README.md +57 -0
  2. data/lib/ads_common_for_bing_ads.rb +49 -0
  3. data/lib/ads_common_for_bing_ads/api_config.rb +41 -0
  4. data/lib/ads_common_for_bing_ads/auth/client_login_handler.rb +168 -0
  5. data/lib/ads_common_for_bing_ads/build/savon_registry.rb +15 -0
  6. data/lib/ads_common_for_bing_ads/parameters_validator.rb +36 -0
  7. data/lib/ads_common_for_bing_ads/savon_headers_base_header_handler.rb +9 -0
  8. data/lib/ads_common_for_bing_ads/savon_service.rb +141 -0
  9. data/lib/bing_ads_api.rb +175 -0
  10. data/lib/bing_ads_api/api_config.rb +162 -0
  11. data/lib/bing_ads_api/client_login_header_handler.rb +21 -0
  12. data/lib/bing_ads_api/credential_handler.rb +91 -0
  13. data/lib/bing_ads_api/errors.rb +564 -0
  14. data/lib/bing_ads_api/report_header_handler.rb +46 -0
  15. data/lib/bing_ads_api/report_utils.rb +202 -0
  16. data/lib/bing_ads_api/v7/administration_service.rb +37 -0
  17. data/lib/bing_ads_api/v7/administration_service_registry.rb +30 -0
  18. data/lib/bing_ads_api/v7/campaign_management_service.rb +398 -0
  19. data/lib/bing_ads_api/v7/campaign_management_service_registry.rb +30 -0
  20. data/lib/bing_ads_api/v7/customer_billing_service.rb +58 -0
  21. data/lib/bing_ads_api/v7/customer_billing_service_registry.rb +30 -0
  22. data/lib/bing_ads_api/v7/customer_management_service.rb +98 -0
  23. data/lib/bing_ads_api/v7/customer_management_service_registry.rb +30 -0
  24. data/lib/bing_ads_api/v7/notification_service.rb +38 -0
  25. data/lib/bing_ads_api/v7/notification_service_registry.rb +30 -0
  26. data/lib/bing_ads_api/v7/reporting_service.rb +38 -0
  27. data/lib/bing_ads_api/v7/reporting_service_registry.rb +30 -0
  28. data/lib/bing_ads_api/v8/ad_intelligence_service.rb +86 -0
  29. data/lib/bing_ads_api/v8/ad_intelligence_service_registry.rb +30 -0
  30. data/lib/bing_ads_api/v8/administration_service.rb +38 -0
  31. data/lib/bing_ads_api/v8/administration_service_registry.rb +30 -0
  32. data/lib/bing_ads_api/v8/bulk_service.rb +42 -0
  33. data/lib/bing_ads_api/v8/bulk_service_registry.rb +30 -0
  34. data/lib/bing_ads_api/v8/campaign_management_service.rb +390 -0
  35. data/lib/bing_ads_api/v8/campaign_management_service_registry.rb +30 -0
  36. data/lib/bing_ads_api/v8/customer_billing_service.rb +62 -0
  37. data/lib/bing_ads_api/v8/customer_billing_service_registry.rb +30 -0
  38. data/lib/bing_ads_api/v8/customer_management_service.rb +162 -0
  39. data/lib/bing_ads_api/v8/customer_management_service_registry.rb +30 -0
  40. data/lib/bing_ads_api/v8/notification_service.rb +38 -0
  41. data/lib/bing_ads_api/v8/notification_service_registry.rb +30 -0
  42. data/lib/bing_ads_api/v8/optimizer_service.rb +46 -0
  43. data/lib/bing_ads_api/v8/optimizer_service_registry.rb +30 -0
  44. data/lib/bing_ads_api/v8/reporting_service.rb +38 -0
  45. data/lib/bing_ads_api/v8/reporting_service_registry.rb +30 -0
  46. data/lib/bing_ads_api/version.rb +5 -0
  47. data/rakefile.rb +54 -0
  48. metadata +156 -0
@@ -0,0 +1,564 @@
1
+ # Specific error handling for the Bing Ads API.
2
+
3
+
4
+ module BingAdsApi
5
+ module Errors
6
+
7
+ # This class encapsulates base class for API exceptions. More specific
8
+ # exceptions are generated based on Service WSDL.
9
+ class ApiException < AdsCommonForBingAds::Errors::ApiException
10
+ attr_reader :array_fields
11
+
12
+ def initialize(exception_fault)
13
+ @array_fields ||= []
14
+ exception_fault.each { |key, value| set_field(key, value) }
15
+ end
16
+
17
+ private
18
+
19
+ # Sets instance's property to a value if it is defined
20
+ def set_field(field, value)
21
+ if respond_to?(field)
22
+ value = arrayize(value) if is_array_field(field)
23
+ instance_variable_set("@#{field}", value)
24
+ end
25
+ end
26
+
27
+ # Makes sure object is an array
28
+ def arrayize(object)
29
+ return [] if object.nil?
30
+ return object.is_a?(Array) ? object : [object]
31
+ end
32
+
33
+ # Should a field be forced to be an array
34
+ def is_array_field(field)
35
+ return @array_fields.include?(field.to_s)
36
+ end
37
+ end
38
+
39
+ # Error for invalid credentials sush as malformed ID.
40
+ class BadCredentialsError < AdsCommonForBingAds::Errors::ApiException
41
+ end
42
+
43
+ # Error for malformed report definition.
44
+ class InvalidReportDefinitionError < AdsCommonForBingAds::Errors::ApiException
45
+ end
46
+
47
+ # Error for server-side report error.
48
+ class ReportError < AdsCommonForBingAds::Errors::ApiException
49
+ attr_reader :http_code
50
+
51
+ def initialize(http_code, message)
52
+ super(message)
53
+ @http_code = http_code
54
+ end
55
+ end
56
+
57
+ CODES = {
58
+ # Common Error Codes
59
+ # http://msdn.microsoft.com/en-us/library/bb672016.aspx
60
+ "0" => "InternalError",
61
+ "100" => "NullRequest",
62
+ "105" => "InvalidCredentials",
63
+ "106" => "UserIsNotAuthorized",
64
+ "107" => "QuotaNotAvailable",
65
+ "113" => "InvalidDateObject",
66
+ "116" => "RequestMissingHeaders",
67
+ "201" => "ApiInputValidationError",
68
+ "202" => "ApiExecutionError",
69
+ "203" => "NullParameter",
70
+ "204" => "OperationNotSupported",
71
+ "205" => "InvalidVersion",
72
+ "206" => "NullArrayArgument",
73
+ "207" => "ConcurrentRequestOverLimit",
74
+ "208" => "InvalidAccount",
75
+ "209" => "TimestampNotMatch",
76
+ "210" => "EntityNotExistent",
77
+ "211" => "NameTooLong",
78
+ "512" => "FilterListOverLimit",
79
+ # Campaign Management Error Codes
80
+ # http://msdn.microsoft.com/en-us/library/bb671735.aspx
81
+ "1001" => "CampaignServiceCannotChangeStatusOnUpdate",
82
+ "1003" => "CampaignServiceCannotSpecifyStatusOnAdd",
83
+ "1004" => "CampaignServiceIdShouldBeNullOnAdd",
84
+ "1005" => "CampaignServiceInvalidNegativeKeyword",
85
+ "1006" => "CampaignServiceNegativeKeywordsTotalLengthExceeded",
86
+ "1007" => "CampaignServiceNegativeKeywordMatchesKeyword",
87
+ "1008" => "CampaignServiceInvalidAccountStatus",
88
+ "1009" => "CampaignServiceAccountIdMissingInRequestHeader",
89
+ "1010" => "CampaignServiceSystemInReadOnlyMode",
90
+ "1011" => "CampaignServiceFutureFeatureCode",
91
+ "1012" => "CampaignServiceInvalidNegativeSiteURL",
92
+ "1013" => "CampaignServiceNegativeSiteURLExceededMaxCount",
93
+ "1014" => "CampaignServiceTimeZoneValueInvalid",
94
+ "1015" => "CampaignServiceCurrencyValueInvalid",
95
+ "1016" => "CampaignServiceInvalidEntityState",
96
+ "1017" => "CampaignServiceInvalidSearchBids",
97
+ "1018" => "CampaignServiceInvalidContentBid",
98
+ "1019" => "CampaignServiceCashbackAllowedOnlyForSearchMedium",
99
+ "1020" => "CampaignServiceCashbackNotAllowedForAdgroupsDistributionChannel",
100
+ "1021" => "CampaignServiceAccountNotEligbleForKeywordLevelCashback",
101
+ "1022" => "CampaignServiceCampaignCashbackNeedToBeEnabledBeforeEnablingAdgroup",
102
+ "1023" => "CampaignServiceAccountNotEligibleToModifyCashBack",
103
+ "1024" => "CampaignServiceAccountNotEligibleToSetCashbackAmount",
104
+ "1025" => "CampaignServiceInvalidCashbackAmount",
105
+ "1026" => "CampaignServiceCashbackTextTooLong",
106
+ "1027" => "CampaignServiceCashBackStatusRequired",
107
+ "1028" => "CampaignServiceCashbackInfoShouldBeNullForBackwardCompatability",
108
+ "1029" => "CampaignServiceCustomerIdHasToBeSpecified",
109
+ "1033" => "CampaignServiceAccountIdHasToBeSpecified",
110
+ "1031" => "CampaignServiceCannotPerformCurrentOperation",
111
+ "2928" => "CampaignServiceCustomerDataBeingMigrated",
112
+ "1032" => "CampaignServiceNegativeKeywordsLimitExceeded",
113
+ "1033" => "CampaignServiceNegativeKeywordsEntityLimitExceeded",
114
+ "1034" => "CampaignServiceNegativeKeywordsNotPassed",
115
+ "1100" => "CampaignServiceInvalidCampaignId",
116
+ "1101" => "CampaignServiceInvalidCampaignName",
117
+ "1102" => "CampaignServiceInvalidAccountId",
118
+ "1103" => "CampaignServiceNullCampaign",
119
+ "1104" => "CampaignServiceInvalidCampaignDescription",
120
+ "1105" => "CampaignServiceInvalidMonthlyBudget",
121
+ "1106" => "CampaignServiceInvalidDailyBudget",
122
+ "1107" => "CampaignServiceDuplicateCampaignIds",
123
+ "1108" => "CampaignServiceInvalidConversionTrackingEnabled",
124
+ "1109" => "CampaignServiceTimeZoneNotEnabled",
125
+ "1110" => "CampaignServiceDaylightSavingNotEnabled",
126
+ "1111" => "CampaignServiceInvalidConversionTrackingScriptSet",
127
+ "1113" => "CampaignServiceCampaignsArrayShouldNotBeNullOrEmpty",
128
+ "1114" => "CampaignServiceCampaignsArrayExceedsLimit",
129
+ "1115" => "CampaignServiceCannotCreateDuplicateCampaign",
130
+ "1117" => "CampaignServiceMaximumCampaignsReached",
131
+ "1118" => "CampaignServiceCampaignIdsArrayShouldNotBeNullOrEmpty",
132
+ "1119" => "CampaignServiceCampaignIdsArrayExceedsLimit",
133
+ "1120" => "CampaignServiceInvalidCampaignStatus",
134
+ "1121" => "CampaignServiceInvalidBudgetType",
135
+ "1122" => "CampaignServiceCampaignNotEligibleForCashBack",
136
+ "1123" => "CampaignServiceCampaignBudgetAmountIsLessThanSpendAmount",
137
+ "1129" => "CampaignServiceCampaignAlreadyExists",
138
+ "1130" => "CampaignServiceNullCampaignNegativeKeywords",
139
+ "1200" => "CampaignServiceNullAdGroup",
140
+ "1201" => "CampaignServiceInvalidAdGroupId",
141
+ "1202" => "CampaignServiceInvalidAdGroupName",
142
+ "1203" => "CampaignServiceDuplicateInAdGroupIds",
143
+ "1204" => "CampaignServiceAdGroupEndDateShouldBeAfterStartDate",
144
+ "1205" => "CampaignServiceCannotUpdateLanguageAndRegion",
145
+ "1208" => "CampaignServiceCampaignBudgetLessThanAdGroupBudget",
146
+ "1209" => "CampaignServiceAdGroupsArrayShouldNotBeNullOrEmpty",
147
+ "1210" => "CampaignServiceAdGroupsArrayExceedsLimit",
148
+ "1211" => "CampaignServiceAdGroupUserNotAllowedContentMedium",
149
+ "1212" => "CampaignServiceAdGroupStartDateLessThanCurrentDate",
150
+ "1213" => "CampaignServiceMaximumAdGroupsReached",
151
+ "1214" => "CampaignServiceCannotCreateDuplicateAdGroup",
152
+ "1215" => "CampaignServiceCannotUpdateAdGroupInExpiredState",
153
+ "1216" => "CampaignServiceCannotUpdateAdGroupInSubmittedState",
154
+ "1217" => "CampaignServiceCannotOperateOnAdGroupInCurrentState",
155
+ "1218" => "CampaignServiceAdGroupIdsArrayShouldNotBeNullOrEmpty",
156
+ "1219" => "CampaignServiceAdGroupIdsArrayExceedsLimit",
157
+ "1220" => "CampaignServiceMissingDistributionChannel",
158
+ "1221" => "CampaignServiceAdGroupInvalidDistributionChannel",
159
+ "1222" => "CampaignServiceAdGroupInvalidMedium",
160
+ "1223" => "CampaignServiceAdGroupMediumNotAllowedForDistributionChannel",
161
+ "1224" => "CampaignServiceAdGroupMissingAdMedium",
162
+ "1225" => "CampaignServiceUserNotAuthorizedForDistributionChannel",
163
+ "1226" => "CampaignServiceNeedAtleastOneAdAndOneKeywordToSubmit",
164
+ "1227" => "CampaignServiceAdGroupStartDateCannotBeEarlierThanSubmitDate",
165
+ "1228" => "CampaignServiceCannotSetPricingModelOnAdGroup",
166
+ "1229" => "CampaignServiceCannotSetSearchBidOnAdGroup",
167
+ "1230" => "CampaignServiceCannotSetContentBidOnAdGroup",
168
+ "1231" => "CampaignServiceAdGroupExpired",
169
+ "1232" => "CampaignServiceAdGroupInvalidStartDate",
170
+ "1233" => "CampaignServiceAdGroupInvalidEndDate",
171
+ "1234" => "CampaignServiceAdGroupPricingModelCpmRequiresContentMedium",
172
+ "1235" => "CampaignServiceAdGroupInvalidMediumForCustomer",
173
+ "1236" => "CampaignServiceAdGroupPricingModelCpmIsNotEnabledForCustomer",
174
+ "1237" => "CampaignServiceAdGroupPricingModelIsNull",
175
+ "1239" => "CampaignServiceTypeCanBeBehavioralBidOnlyForContentAdGroups",
176
+ "1240" => "CampaignServiceTypeCanBeSitePlacementOnlyForContentAdGroups",
177
+ "1241" => "CampaignServiceCannotUpdateBiddingModel",
178
+ "1242" => "CampaignServiceCannotUpdateAdDistributionForThisType",
179
+ "1243" => "CampaignServiceTooManyAdGroupsInAccount",
180
+ "1244" => "AdGroupServiceNullAdGroupNegativeKeywords",
181
+ "1245" => "AdGroupServiceNegativeSiteUrlsNotPassed",
182
+ "1300" => "CampaignServiceNullAd",
183
+ "1301" => "CampaignServiceInvalidAdTitle",
184
+ "1302" => "CampaignServiceInvalidAdDestinationUrl",
185
+ "1303" => "CampaignServiceAdIdIsNull",
186
+ "1304" => "CampaignServiceAdIdIsNonNull",
187
+ "1305" => "CampaignServiceAdTypeIsNonNull",
188
+ "1306" => "CampaignServiceInvalidAdText",
189
+ "1307" => "CampaignServiceInvalidAdDisplayUrl",
190
+ "1308" => "CampaignServiceInvalidAdId",
191
+ "1309" => "CampaignServiceDuplicateInAdIds",
192
+ "1310" => "CampaignServiceAdsArrayShouldNotBeNullOrEmpty",
193
+ "1311" => "CampaignServiceAdsArrayExceedsLimit",
194
+ "1312" => "CampaignServiceMaxAdsReached",
195
+ "1313" => "CampaignServiceDuplicateAd",
196
+ "1314" => "CampaignServiceDefaultAdExists",
197
+ "1315" => "CampaignServiceSyntaxErrorInAdTitle",
198
+ "1316" => "CampaignServiceSyntaxErrorInAdText",
199
+ "1317" => "CampaignServiceSyntaxErrorInAdDisplayUrl",
200
+ "1318" => "CampaignServiceForbiddenTextInAdTitle",
201
+ "1319" => "CampaignServiceForbiddenTextInAdText",
202
+ "1320" => "CampaignServiceForbiddenTextInAdDisplayUrl",
203
+ "1321" => "CampaignServiceIncorrectAdFormatInTitle",
204
+ "1322" => "CampaignServiceIncorrectAdFormatInText",
205
+ "1323" => "CampaignServiceIncorrectAdFormatInDisplayUrl",
206
+ "1324" => "CampaignServiceTooMuchAdTextInTitle",
207
+ "1325" => "CampaignServiceTooMuchAdTextInText",
208
+ "1326" => "CampaignServiceTooMuchAdTextInDisplayUrl",
209
+ "1327" => "CampaignServiceTooMuchAdTextInDestinationUrl",
210
+ "1328" => "CampaignServiceNotEnoughAdText",
211
+ "1329" => "CampaignServiceExclusiveWordInAdTitle",
212
+ "1330" => "CampaignServiceExclusiveWordInAdText",
213
+ "1331" => "CampaignServiceExclusiveWordInAdDisplayUrl",
214
+ "1332" => "CampaignServiceInvalidAdDisplayUrlFormat",
215
+ "1333" => "CampaignServiceDefaultAdSyntaxErrorInTitle",
216
+ "1334" => "CampaignServiceDefaultAdSyntaxErrorInText",
217
+ "1335" => "CampaignServiceDefaultAdSyntaxErrorInDisplayUrl",
218
+ "1336" => "CampaignServiceDefaultAdForbiddenWordInTitle",
219
+ "1337" => "CampaignServiceDefaultAdForbiddenWordInText",
220
+ "1338" => "CampaignServiceDefaultAdForbiddenWordInDisplayUrl",
221
+ "1339" => "CampaignServiceDefaultAdIncorrectAdFormatInTitle",
222
+ "1340" => "CampaignServiceDefaultAdIncorrectAdFormatInText",
223
+ "1341" => "CampaignServiceDefaultAdIncorrectAdFormatInDisplayUrl",
224
+ "1342" => "CampaignServiceDefaultAdTooMuchTextInTitle",
225
+ "1343" => "CampaignServiceDefaultAdTooMuchTextInText",
226
+ "1344" => "CampaignServiceDefaultAdTooMuchTextInDisplayUrl",
227
+ "1345" => "CampaignServiceDefaultAdTooMuchTextInDestinationUrl",
228
+ "1346" => "CampaignServiceDefaultAdNotEnoughAdText",
229
+ "1347" => "CampaignServiceDefaultAdExclusiveWordInTitle",
230
+ "1348" => "CampaignServiceDefaultAdExclusiveWordInText",
231
+ "1349" => "CampaignServiceDefaultAdExclusiveWordInDisplayUrl",
232
+ "1350" => "CampaignServiceDefaultAdInvalidDisplayUrlFormat",
233
+ "1351" => "CampaignServiceAdIdsArrayShouldNotBeNullOrEmpty",
234
+ "1352" => "CampaignServiceAdIdsArrayExceedsLimit",
235
+ "1353" => "CampaignServiceTooMuchTextInTitleAcrossAllAssociations",
236
+ "1354" => "CampaignServiceTooMuchTextInTextAcrossAllAssociations",
237
+ "1355" => "CampaignServiceTooMuchTextInDisplayUrlAcrossAllAssociations",
238
+ "1356" => "CampaignServiceNothingToUpdateInAdRequest",
239
+ "1357" => "CampaignServiceCannotOperateOnAdInCurrentState",
240
+ "1358" => "CampaignServiceDefaultAdInvalidDestinationUrlFormat",
241
+ "1359" => "CampaignServiceInvalidAdDestinationUrlFormat",
242
+ "1360" => "CampaignServiceAdTypeDoesNotMatch",
243
+ "1361" => "CampaignServiceInvalidBusinessName",
244
+ "1362" => "CampaignServiceInvalidPhoneNumber",
245
+ "1363" => "CampaignServiceMobileAdRequiredDataMissing",
246
+ "1364" => "CampaignServiceMobileAdSupportedForSearchOnlyAdGroups",
247
+ "1365" => "CampaignServiceMobileAdNotSupportedForThisMarket",
248
+ "1366" => "CampaignServiceAdTypeInvalidForCustomer",
249
+ "1367" => "CampaignServiceTooMuchAdTextInBusinessName",
250
+ "1368" => "CampaignServiceTooMuchAdTextInPhoneNumber",
251
+ "1370" => "CampaignServicePhoneNumberNotAllowedForCountry",
252
+ "1371" => "CampaignServiceBlockedPhoneNumber",
253
+ "1372" => "CampaignServicePhoneNumberNotAllowedInAdTitle",
254
+ "1373" => "CampaignServicePhoneNumberNotAllowedInAdText",
255
+ "1374" => "CampaignServicePhoneNumberNotAllowedInAdDisplayUrl",
256
+ "1375" => "CampaignServicePhoneNumberNotAllowedInAdBusinessName",
257
+ "1376" => "CampaignServiceEditorialErrorInAdTitle",
258
+ "1377" => "CampaignServiceEditorialErrorInAdText",
259
+ "1378" => "CampaignServiceEditorialErrorInAdDisplayUrl",
260
+ "1379" => "CampaignServiceEditorialErrorInAdDestinationUrl",
261
+ "1380" => "CampaignServiceEditorialErrorInAdBusinessName",
262
+ "1381" => "CampaignServiceEditorialErrorInAdPhoneNumber",
263
+ "1382" => "CampaignServiceInvalidAdStatus",
264
+ "1383" => "CampaignServiceInvalidAdEditorialStatus",
265
+ "1384" => "CampaignServiceCannotSetExemptionRequestOnAd",
266
+ "1385" => "CampaignServiceUpdateAdEmpty",
267
+ "1386" => "CampaignServiceAdTypeDoesNotMatchExistingValue",
268
+ "1387" => "CampaignServiceEditorialAdTitleBlankAcrossAllAssociations",
269
+ "1388" => "CampaignServiceEditorialAdTitleBlank",
270
+ "1389" => "CampaignServiceEditorialAdTextBlankAcrossAllAssociations",
271
+ "1390" => "CampaignServiceEditorialAdTextBlank",
272
+ "1391" => "CampaignServiceEditorialAdDisplayUrlBlankAcrossAllAssociations",
273
+ "1392" => "CampaignServiceEditorialAdDisplayUrlBlank",
274
+ "1393" => "CampaignServiceEditorialAdDestinationUrlBlank",
275
+ "1394" => "CampaignServiceAdDeleted",
276
+ "1395" => "CampaignServiceAdInInvalidStatus",
277
+ "1396" => "CampaignServiceDefaultAdTooMuchTextInBusniessName",
278
+ "1397" => "CampaignServiceEditorialGenericError",
279
+ "2802" => "CampaignServiceCannotChangeImageUrlOnUpdate",
280
+ "2803" => "CampaignServiceDefaultAdTooMuchTextInAltText",
281
+ "1400" => "CampaignServiceNullTarget",
282
+ "1401" => "CampaignServiceInvalidTargetId",
283
+ "1402" => "CampaignServiceNoBidsInTarget",
284
+ "1403" => "CampaignServiceInvalidDayTarget",
285
+ "1404" => "CampaignServiceInvalidHourTarget",
286
+ "1405" => "CampaignServiceInvalidLocationTarget",
287
+ "1406" => "CampaignServiceInvalidGenderTarget",
288
+ "1407" => "CampaignServiceInvalidAgeTarget",
289
+ "1408" => "CampaignServiceDuplicateDayTarget",
290
+ "1409" => "CampaignServiceDuplicateHourTarget",
291
+ "1410" => "CampaignServiceDuplicateMetroAreaLocationTarget",
292
+ "1411" => "CampaignServiceDuplicateCountryLocationTarget",
293
+ "1412" => "CampaignServiceDuplicateGenderTarget",
294
+ "1413" => "CampaignServiceDuplicateAgeTarget",
295
+ "1414" => "CampaignServiceCountryAndMetroAreaTargetsExclusive",
296
+ "1415" => "CampaignServiceMetroTargetsFromMultipleCountries",
297
+ "1416" => "CampaignServiceIncrementalBudgetAmountRequiredForDayTarget",
298
+ "1417" => "CampaignServiceGeoTargetsInAdGroupExceedsLimit",
299
+ "1418" => "CampaignServiceDuplicateInTargetIds",
300
+ "1419" => "CampaignServiceTargetGroupAssignedEntitiesPermissionMismatch",
301
+ "1420" => "CampaignServiceTargetsNotPassed",
302
+ "1421" => "CampaignServiceTargetAlreadyExists",
303
+ "1422" => "CampaignServiceTargetsLimitReached",
304
+ "1423" => "CampaignServiceInvalidGeoLocationLevel",
305
+ "1424" => "CampaignServiceAdGroupMediumInvalidWithBusinessTargets",
306
+ "1425" => "CampaignServiceTargetsArrayExceedsLimit",
307
+ "1426" => "CampaignServiceTargetNotAssociatedWithEntity",
308
+ "1427" => "CampaignServiceTargetAlreadyAssociatedWithEntity",
309
+ "1428" => "CampaignServiceTargetHasActiveAssociations",
310
+ "1429" => "CampaignServiceInvalidTarget",
311
+ "1430" => "CampaignServiceBTTargettingNotEnabledForPilot",
312
+ "1431" => "CampaignServiceInvalidBehaviorTarget",
313
+ "1432" => "CampaignServiceDuplicateBehaviorTarget",
314
+ "1433" => "CampaignServiceInvalidSegmentTarget",
315
+ "1434" => "CampaignServiceDuplicateSegmentTarget",
316
+ "1435" => "CampaignServiceNegativeBiddingNotAllowedForThisTargetType",
317
+ "1436" => "CampaignServiceInvalidCashbackTextinSegmentTarget",
318
+ "1437" => "CampaignServiceInvalidParam1inSegmentTarget",
319
+ "1438" => "CampaignServiceInvalidParam2inSegmentTarget",
320
+ "1439" => "CampaignServiceInvalidParam3inSegmentTarget",
321
+ "1440" => "CampaignServiceInvalidSegmentParam1inSegmentTarget",
322
+ "1441" => "CampaignServiceInvalidSegmentParam2inSegmentTarget",
323
+ "1442" => "CampaignServiceCannotSpecifySegmentTargetsWithAnyOtherTarget",
324
+ "1443" => "CampaignServiceBusinessLocationsNotPassed",
325
+ "1444" => "CampaignServiceInvalidBusinessLocationHours",
326
+ "1445" => "CampaignServiceInvalidAddress",
327
+ "1446" => "CampaignServiceBusinessLocationTargetsLimitReachedForCustomer",
328
+ "1447" => "CampaignServiceBusinessLocationTargetsLimitReachedForAdGroup",
329
+ "1448" => "CampaignServiceBusinessLocationTargetsLimitReachedForCampaign",
330
+ "1449" => "CampaignServiceTargetsAgeBidsBatchLimitExceeded",
331
+ "1450" => "CampaignServiceTargetsDayBidsBatchLimitExceeded",
332
+ "1451" => "CampaignServiceTargetsHourBidsBatchLimitExceeded",
333
+ "1452" => "CampaignServiceTargetsGenderBidsBatchLimitExceeded",
334
+ "1453" => "CampaignServiceTargetsLocationBidsBatchLimitExceeded",
335
+ "1454" => "CampaignServiceTargetsSegmentBidsBatchLimitExceeded",
336
+ "1455" => "CampaignServiceTargetsBehaviorBidsBatchLimitExceeded",
337
+ "1456" => "CampaignServiceInvalidBusinessLocationId",
338
+ "1457" => "CampaignServiceInvalidTargetRadius",
339
+ "1458" => "CampaignServiceInvalidLatitude",
340
+ "1459" => "CampaignServiceInvalidLongitude",
341
+ "1460" => "CampaignServiceDuplicateSubGeographyTarget",
342
+ "1461" => "CampaignServiceDuplicateCityTarget",
343
+ "1462" => "CampaignServiceDuplicateBusinessLocationTarget",
344
+ "1463" => "CampaignServiceDuplicateCustomLocationTarget",
345
+ "1464" => "CampaignServiceInvalidLocationId",
346
+ "1465" => "CampaignServiceGeoLocationOptionsRequired",
347
+ "1466" => "CampaignServiceUnsupportedCombinationOfLocationIdAndOptions",
348
+ "1467" => "CampaignServiceInvalidGeographicalLocationSearchString",
349
+ "1468" => "CampaignServiceGeoTargetsAndBusinessTargetsMutuallyExclusive",
350
+ "1469" => "CampaignServiceBusinessLocationNotSet",
351
+ "1470" => "CampaignServiceBusinessNameRequired",
352
+ "1471" => "CampaignServiceLattitudeLongitudeRequired",
353
+ "1472" => "CampaignServiceBusinessNameTooLong",
354
+ "1473" => "CampaignServiceDomainNameAlreadyTaken",
355
+ "1474" => "CampaignServiceBusinessDescriptionTooLong",
356
+ "1475" => "CampaignServiceInvalidBusinessTypeId",
357
+ "1476" => "CampaignServiceInvalidPaymentTypeId",
358
+ "1477" => "CampaignServiceInvalidBusinessHoursEntry",
359
+ "1478" => "CampaignServiceAddressRequired",
360
+ "1479" => "CampaignServiceAddressTooLong",
361
+ "1480" => "CampaignServiceCityNameRequired",
362
+ "1481" => "CampaignServiceCityNameTooLong",
363
+ "1482" => "CampaignServiceCountryCodeRequired",
364
+ "1483" => "CampaignServiceCountryCodeTooLong",
365
+ "1484" => "CampaignServiceStateOrProvinceRequired",
366
+ "1485" => "CampaignServiceStateOrProvinceTooLong",
367
+ "1486" => "CampaignServiceLocationIsNotSpecified",
368
+ "1487" => "CampaignServiceOpen24HoursAndBusinessHoursMutuallyExclusive",
369
+ "1488" => "CampaignServiceBusinessNameAndAddressAlreadyExists",
370
+ "1489" => "CampaignServiceBusinessLocationListTooLong",
371
+ "1490" => "CampaignServiceInvalidCustomerId",
372
+ "1491" => "InvalidDomainName",
373
+ "1492" => "CampaignServiceBusinessDomainNameNotSet",
374
+ "1493" => "CampaignServiceBusinessDomainTimestampMismatch",
375
+ "1494" => "CampaignServiceTimestampRequiredForBusinessDomainNameModification",
376
+ "1495" => "CampaignServiceBusinessDomainAlreadySet",
377
+ "1496" => "CampaignServiceDomainNameUnknown",
378
+ "1497" => "CampaignServiceOnlyOneBusinessLocationPerCustomerIsAllowed",
379
+ "1498" => "CampaignServiceBiddingOtherThanZeroNotAllowedForThisTargetType",
380
+ "1499" => "CampaignServiceTargetingShouldBeExclusiveForThisTargetType",
381
+ "2900" => "CampaignServiceInvalidCashbackAmountInSegmentTarget",
382
+ "2902" => "CampaignServiceInvalidTargetName",
383
+ "2904" => "CampaignServiceTargetInvalidForCustomer",
384
+ "2909" => "CampaignServiceIsLibraryTargetNotNull",
385
+ "2918" => "CampaignServiceBusinessAndRadiusTargetsAllowedOnlyForSearchMedium",
386
+ "2919" => "CampaignServiceAssociatingNonLibraryTargetNotAllowed",
387
+ "1500" => "CampaignServiceNullKeyword",
388
+ "1501" => "CampaignServiceInvalidKeywordId",
389
+ "1502" => "CampaignServiceDuplicateInKeywordIds",
390
+ "1503" => "CampaignServiceInvalidKeywordText",
391
+ "1504" => "CampaignServiceCannotChangeTextOnUpdate",
392
+ "1505" => "CampaignServiceKeywordsArrayShouldNotBeNullOrEmpty",
393
+ "1506" => "CampaignServiceKeywordsArrayExceedsLimit",
394
+ "1507" => "CampaignServiceInvalidBidAmounts",
395
+ "1508" => "CampaignServiceInvalidBidAmountForSearchAdGroup",
396
+ "1509" => "CampaignServiceInvalidBidAmountForContentAdGroup",
397
+ "1510" => "CampaignServiceInvalidBidAmountForHybridAdGroup",
398
+ "1511" => "CampaignServiceInvalidParam1",
399
+ "1512" => "CampaignServiceInvalidParam2",
400
+ "1513" => "CampaignServiceInvalidParam3",
401
+ "1514" => "CampaignServiceNegativeKeywordRequiresPartialMatchBid",
402
+ "1515" => "CampaignServiceBidAmountsLessThanFloorPrice",
403
+ "1516" => "CampaignServiceBidAmountsGreaterThanCeilingPrice",
404
+ "1517" => "CampaignServiceDuplicateKeyword",
405
+ "1518" => "CampaignServiceMaxKeywordsReachedForAccount",
406
+ "1519" => "CampaignServiceMaxKeywordsReachedForAdGroup",
407
+ "1520" => "CampaignServiceForbiddenWordInKeywordText",
408
+ "1521" => "CampaignServiceForbiddenWordInParam1",
409
+ "1522" => "CampaignServiceForbiddenWordInParam2",
410
+ "1523" => "CampaignServiceForbiddenWordInParam3",
411
+ "1524" => "CampaignServiceExclusiveWordInKeywordText",
412
+ "1525" => "CampaignServiceExclusiveWordInParam1",
413
+ "1526" => "CampaignServiceExclusiveWordInParam2",
414
+ "1527" => "CampaignServiceExclusiveWordInParam3",
415
+ "1528" => "CampaignServiceKeywordDoesNotBelongToAdGroupId",
416
+ "1529" => "CampaignServiceKeywordIdsArrayShouldNotBeNullOrEmpty",
417
+ "1530" => "CampaignServiceKeywordIdsArrayExceedsLimit",
418
+ "1531" => "CampaignServiceInvalidKeywordStatus",
419
+ "1532" => "CampaignServiceInvalidKeywordEditorialStatus",
420
+ "1533" => "CampaignServiceCannotSetExemptionRequestOnKeyword",
421
+ "1534" => "CampaignServiceUpdateKeywordEmpty",
422
+ "1535" => "CampaignServiceKeywordQualityScoreOperationNotEnabledForCustomer",
423
+ "1536" => "CampaignServiceDuplicateKeywordIdInRequest",
424
+ "1537" => "CampaignServiceCCannotAddKeywordToSpecifiedAdGroup",
425
+ "1700" => "CampaignServiceNullKeywordBid",
426
+ "1701" => "CampaignServiceKeywordBidsArrayShouldNotBeNullOrEmpty",
427
+ "1702" => "CampaignServiceKeywordBidsArrayExceedsLimit",
428
+ "1703" => "CampaignServiceKeywordBidsInvalidKeyword",
429
+ "1704" => "CampaignServiceAtleastOneKeywordBidShouldBeSpecified",
430
+ "1705" => "CampaignServiceInvalidLanguageAndRegionValue",
431
+ "1900" => "CampaignServiceNullSegment",
432
+ "1901" => "CampaignServiceInvalidSegmentId",
433
+ "1902" => "CampaignServiceDuplicateInSegmentIds",
434
+ "1903" => "CampaignServiceInvalidSegmentName",
435
+ "1904" => "CampaignServiceInvalidUserHash",
436
+ "1905" => "CampaignServiceSegmentsArrayShouldNotBeNullOrEmpty",
437
+ "1906" => "CampaignServiceSegmentsArrayExceedsLimit",
438
+ "1907" => "CampaignServiceDuplicateSegmentName",
439
+ "1908" => "CampaignServiceSegmentOperationNotAllowedForPilot",
440
+ "1909" => "CampaignServiceUserHashArrayShouldNotBeNullOrEmpty",
441
+ "1910" => "CampaignServiceUserHashArrayExceedsLimit",
442
+ "1911" => "CampaignServiceSegmentIdsArrayShouldNotBeNullOrEmpty",
443
+ "1912" => "CampaignServiceSegmentIdsArrayExceedsLimit",
444
+ "1913" => "CampaignServiceMaxSegmentsForCustomerHasBeenReached",
445
+ "1914" => "CampaignServiceSegmentNotAllowedForDistributionChannel",
446
+ "2500" => "CampaignServiceNullBusiness",
447
+ "2501" => "CampaignServiceInvalidBusinessId",
448
+ "2502" => "CampaignServiceDuplicateInBusinessIds",
449
+ "2503" => "CampaignServiceBusinessesArrayShouldNotBeNullOrEmpty",
450
+ "2504" => "CampaignServiceBusinessesArrayExceedsLimit",
451
+ "2505" => "CampaignServiceBusinessIdsArrayShouldNotBeNullOrEmpty",
452
+ "2506" => "CampaignServiceBusinessIdsArrayExceedsLimit",
453
+ "2507" => "CampaignServiceInvalidBusinessStatus",
454
+ "2508" => "CampaignServiceInvalidBusinessGeoCodeStatus",
455
+ "2509" => "CampaignServiceInvalidBusinessLatitude",
456
+ "2510" => "CampaignServiceInvalidBusinessLongitude",
457
+ "2511" => "CampaignServiceInvalidCustomIconAssetId",
458
+ "2901" => "CampaignServiceBusinessLocationBeginAndEndHoursMismatch",
459
+ "2903" => "CampaignServiceDuplicatePaymentTypes",
460
+ "2905" => "CampaignServiceInvalidEmail",
461
+ "2906" => "CampaignServiceEmailTooLong",
462
+ "2907" => "CampaignServiceBusinessPhoneNumberInvalid",
463
+ "2908" => "CampaignServicePhoneNumberTooLong",
464
+ "2910" => "CampaignServiceInvalidLatitudeLongitudeForBusinessLocation",
465
+ "2914" => "CampaignServiceZipOrPostalCodeTooLong",
466
+ "2915" => "CampaignServiceBusinessDescriptionRequired",
467
+ "2916" => "CampaignServiceDuplicateBusinessHours",
468
+ "2917" => "CampaignServiceAddressInvalid",
469
+ "2920" => "CampaignServiceBusinessAddressShouldBeValidForUpdate",
470
+ "2921" => "CampaignServiceBusinessHasActiveAssociations",
471
+ "2600" => "CampaignServiceNullSitePlacement",
472
+ "2601" => "CampaignServiceInvalidSitePlacementId",
473
+ "2602" => "CampaignServiceDuplicateInSitePlacementIds",
474
+ "2603" => "CampaignServiceSitePlacementsArrayShouldNotBeNullOrEmpty",
475
+ "2604" => "CampaignServiceSitePlacementsArrayExceedsLimit",
476
+ "2605" => "CampaignServiceSitePlacementOperationNotAllowedForPilot",
477
+ "2606" => "CampaignServiceSitePlacementIdsArrayShouldNotBeNullOrEmpty",
478
+ "2607" => "CampaignServiceSitePlacementIdsArrayExceedsLimit",
479
+ "2608" => "CampaignServiceUrlsArrayShouldNotBeNullOrEmpty",
480
+ "2609" => "CampaignServiceUrlsArrayExceedsLimit",
481
+ "2610" => "CampaignServiceNullUrl",
482
+ "2611" => "CampaignServiceInvalidUrl",
483
+ "2612" => "CampaignServiceInvalidPlacementId",
484
+ "2613" => "CampaignServiceCannotChangeUrlOnUpdate",
485
+ "2614" => "CampaignServiceCannotChangePlacementIdOnUpdate",
486
+ "2615" => "CampaignServiceNothingToUpdateInSitePlacementRequest",
487
+ "2616" => "CampaignServiceCannotAddSitePlacementToSpecifiedAdGroup",
488
+ "2617" => "CampaignServiceInvalidSitePlacementStatus",
489
+ "2618" => "CampaignServiceDuplicateSitePlacement",
490
+ "2700" => "CampaignServiceNullBehavioralBid",
491
+ "2701" => "CampaignServiceInvalidBehavioralBidId",
492
+ "2702" => "CampaignServiceDuplicateInBehavioralBidIds",
493
+ "2703" => "CampaignServiceBehavioralBidsArrayShouldNotBeNullOrEmpty",
494
+ "2704" => "CampaignServiceBehavioralBidsArrayExceedsLimit",
495
+ "2705" => "CampaignServiceBehavioralBidOperationNotAllowedForPilot",
496
+ "2706" => "CampaignServiceBehavioralBidIdsArrayShouldNotBeNullOrEmpty",
497
+ "2707" => "CampaignServiceBehavioralBidIdsArrayExceedsLimit",
498
+ "2708" => "CampaignServiceInvalidBehavioralBidName",
499
+ "2709" => "CampaignServiceCannotChangeBehavioralName",
500
+ "2710" => "CampaignServiceNothingToUpdateInBehavioralBidRequest",
501
+ "2711" => "CampaignServiceCannotAddBehavioralBidToSpecifiedAdGroup",
502
+ "2712" => "CampaignServiceBTBiddingNotEnabledForPilot",
503
+ "2713" => "CampaignServiceDuplicateBehavioralBid",
504
+ "2714" => "CampaignServiceInvalidBehavioralBidStatus",
505
+ "2715" => "CampaignServiceInvalidMediumAndBiddingStrategyCombination",
506
+ # Reporting API Error Codes
507
+ # http://msdn.microsoft.com/en-US/library/bb672083(v=msads.70)
508
+ "2001" => "ReportingServiceNullReportRequest",
509
+ "2002" => "ReportingServiceUnknownReportType",
510
+ "2003" => "ReportingServiceAccountNotAuthorized",
511
+ "2004" => "ReportingServiceNoCompleteDataAvaliable",
512
+ "2005" => "ReportingServiceInvalidDataAvailabilityAndTimePeriodCombination",
513
+ "2006" => "ReportingServiceInvalidReportName",
514
+ "2007" => "ReportingServiceInvalidReportAggregation",
515
+ "2008" => "ReportingServiceInvalidReportTimeSelection",
516
+ "2009" => "ReportingServiceInvalidCustomDateRangeStart",
517
+ "2010" => "ReportingServiceInvalidCustomDateRangeEnd",
518
+ "2011" => "ReportingServiceEndDateBeforeStartDate",
519
+ "2012" => "ReportingServiceEmptyCustomDates",
520
+ "2013" => "ReportingServiceCustomDatesOverlimit",
521
+ "2014" => "ReportingServiceNullColumns",
522
+ "2015" => "ReportingServiceRequiredColumnsNotSelected",
523
+ "2016" => "ReportingServiceDuplicateColumns",
524
+ "2017" => "ReportingServiceNoMeasureSelected",
525
+ "2018" => "ReportingServiceInvalidAccountIdInCampaignReportScope",
526
+ "2019" => "ReportingServiceInvalidCampaignIdInCampaignReportScope",
527
+ "2020" => "ReportingServiceInvalidAccountIdInAdGroupReportScope",
528
+ "2021" => "ReportingServiceInvalidCampaignIdInAdGroupReportScope",
529
+ "2022" => "ReportingServiceInvalidAdGroupIdInAdGroupReportScope",
530
+ "2023" => "ReportingServiceInvalidAccountIdInAccountReportScope",
531
+ "2024" => "ReportingServiceNullCampaignReportScope",
532
+ "2025" => "ReportingServiceNullAdGroupReportScope",
533
+ "2026" => "ReportingServiceInvalidAccountReportScope",
534
+ "2027" => "ReportingServiceInvalidAccountThruCampaignReportScope",
535
+ "2028" => "ReportingServiceInvalidAccountThruAdGroupReportScope",
536
+ "2029" => "ReportingServiceAccountsOverLimit",
537
+ "2030" => "ReportingServiceMaximumCampaignsLimitReached",
538
+ "2031" => "ReportingServiceAdGroupsOverLimit",
539
+ "2032" => "ReportingServiceCrossSiteScriptNotAllowed",
540
+ "2033" => "ReportingServiceInvalidKeywordFilterValue",
541
+ "2034" => "ReportingServiceInvalidTimePeriodColumnForSummaryReport",
542
+ "2035" => "ReportingServiceInvalidAccountIds",
543
+ "2036" => "ReportingServiceBehavioralIdMaxArraySizeReached",
544
+ "2037" => "ReportingServiceInvalidBehavioralIdValue",
545
+ "2038" => "ReportingServiceSiteIdMaxArraySizeReached",
546
+ "2039" => "ReportingServiceInvalidSiteIdValue",
547
+ "2040" => "ReportingServiceInvalidCustomDateRange",
548
+ "2041" => "ReportingServiceInvalidFutureStartDate",
549
+ "2042" => "ReportingServiceInvalidSearchQueryFilterValue",
550
+ "2043" => "ReportingServiceSearchQueryFilterValueLengthExceeded",
551
+ "2044" => "ReportingServiceSearchQueryOverLimit",
552
+ "2045" => "ReportingServiceKeywordFilterValueLengthExceeded",
553
+ "2046" => "ReportingServiceKeywordOverLimit",
554
+ "2100" => "ReportingServiceInvalidReportId",
555
+ "2101" => "ReportingServiceReportNotFound",
556
+ }
557
+ CODES.each do |_, constant|
558
+ unless const_defined?(constant)
559
+ const_set(constant,Class.new(AdsCommonForBingAds::Errors::ApiException))
560
+ end
561
+ end
562
+
563
+ end
564
+ end