centralindex 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/CentralIndex.rb +942 -285
  2. metadata +2 -2
data/lib/CentralIndex.rb CHANGED
@@ -74,6 +74,23 @@ class CentralIndex
74
74
  end
75
75
 
76
76
 
77
+ #
78
+ # Get all advertisers that have been updated from a give date for a given publisher
79
+ #
80
+ # @param publisher_id
81
+ # @param from_date
82
+ # @param country
83
+ # @return - the data from the api
84
+ #
85
+ def getAdvertiserUpdatedBy_publisher( publisher_id, from_date, country)
86
+ params = Hash.new
87
+ params['publisher_id'] = publisher_id
88
+ params['from_date'] = from_date
89
+ params['country'] = country
90
+ return doCurl("get","/advertiser/updated/by_publisher",params)
91
+ end
92
+
93
+
77
94
  #
78
95
  # The search matches a category name on a given string and language.
79
96
  #
@@ -109,28 +126,32 @@ class CentralIndex
109
126
  #
110
127
  # @param str - A string to search against, E.g. Dub e.g. dub
111
128
  # @param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
129
+ # @param language - An ISO compatible language code, E.g. en e.g. en
112
130
  # @return - the data from the api
113
131
  #
114
- def getAutocompleteLocation( str, country)
132
+ def getAutocompleteLocation( str, country, language)
115
133
  params = Hash.new
116
134
  params['str'] = str
117
135
  params['country'] = country
136
+ params['language'] = language
118
137
  return doCurl("get","/autocomplete/location",params)
119
138
  end
120
139
 
121
140
 
122
141
  #
123
- # The search matches a postcode to the supplied string
142
+ # The search matches a location name or synonym on a given string and language.
124
143
  #
125
- # @param str - A string to search against, E.g. W1 e.g. W1
126
- # @param country - Which country to return results for. An ISO compatible country code, E.g. gb e.g. gb
144
+ # @param str - A string to search against, E.g. Middle e.g. dub
145
+ # @param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
146
+ # @param resolution
127
147
  # @return - the data from the api
128
148
  #
129
- def getAutocompletePostcode( str, country)
149
+ def getAutocompleteLocationBy_resolution( str, country, resolution)
130
150
  params = Hash.new
131
151
  params['str'] = str
132
152
  params['country'] = country
133
- return doCurl("get","/autocomplete/postcode",params)
153
+ params['resolution'] = resolution
154
+ return doCurl("get","/autocomplete/location/by_resolution",params)
134
155
  end
135
156
 
136
157
 
@@ -152,14 +173,17 @@ class CentralIndex
152
173
  # @param longitude
153
174
  # @param timezone
154
175
  # @param telephone_number
176
+ # @param additional_telephone_number
155
177
  # @param email
156
178
  # @param website
157
179
  # @param category_id
158
180
  # @param category_type
159
181
  # @param do_not_display
182
+ # @param referrer_url
183
+ # @param referrer_name
160
184
  # @return - the data from the api
161
185
  #
162
- def putBusiness( name, building_number, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, email, website, category_id, category_type, do_not_display)
186
+ def putBusiness( name, building_number, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name)
163
187
  params = Hash.new
164
188
  params['name'] = name
165
189
  params['building_number'] = building_number
@@ -176,25 +200,92 @@ class CentralIndex
176
200
  params['longitude'] = longitude
177
201
  params['timezone'] = timezone
178
202
  params['telephone_number'] = telephone_number
203
+ params['additional_telephone_number'] = additional_telephone_number
179
204
  params['email'] = email
180
205
  params['website'] = website
181
206
  params['category_id'] = category_id
182
207
  params['category_type'] = category_type
183
208
  params['do_not_display'] = do_not_display
209
+ params['referrer_url'] = referrer_url
210
+ params['referrer_name'] = referrer_name
184
211
  return doCurl("put","/business",params)
185
212
  end
186
213
 
187
214
 
188
215
  #
189
- # Returns the supplied wolf category object by fetching the supplied category_id from our categories object.
216
+ # Delete a business tool with a specified tool_id
190
217
  #
191
- # @param category_id
218
+ # @param tool_id
192
219
  # @return - the data from the api
193
220
  #
194
- def getCategory( category_id)
221
+ def deleteBusiness_tool( tool_id)
195
222
  params = Hash.new
196
- params['category_id'] = category_id
197
- return doCurl("get","/category",params)
223
+ params['tool_id'] = tool_id
224
+ return doCurl("delete","/business_tool",params)
225
+ end
226
+
227
+
228
+ #
229
+ # Update/Add a Business Tool
230
+ #
231
+ # @param tool_id
232
+ # @param country
233
+ # @param headline
234
+ # @param description
235
+ # @param link_url
236
+ # @param active
237
+ # @return - the data from the api
238
+ #
239
+ def postBusiness_tool( tool_id, country, headline, description, link_url, active)
240
+ params = Hash.new
241
+ params['tool_id'] = tool_id
242
+ params['country'] = country
243
+ params['headline'] = headline
244
+ params['description'] = description
245
+ params['link_url'] = link_url
246
+ params['active'] = active
247
+ return doCurl("post","/business_tool",params)
248
+ end
249
+
250
+
251
+ #
252
+ # Returns business tool that matches a given tool id
253
+ #
254
+ # @param tool_id
255
+ # @return - the data from the api
256
+ #
257
+ def getBusiness_tool( tool_id)
258
+ params = Hash.new
259
+ params['tool_id'] = tool_id
260
+ return doCurl("get","/business_tool",params)
261
+ end
262
+
263
+
264
+ #
265
+ # Returns active business tools for a specific masheryid in a given country
266
+ #
267
+ # @param country
268
+ # @return - the data from the api
269
+ #
270
+ def getBusiness_toolBy_masheryid( country)
271
+ params = Hash.new
272
+ params['country'] = country
273
+ return doCurl("get","/business_tool/by_masheryid",params)
274
+ end
275
+
276
+
277
+ #
278
+ # Assigns a Business Tool image
279
+ #
280
+ # @param tool_id
281
+ # @param filedata
282
+ # @return - the data from the api
283
+ #
284
+ def postBusiness_toolImage( tool_id, filedata)
285
+ params = Hash.new
286
+ params['tool_id'] = tool_id
287
+ params['filedata'] = filedata
288
+ return doCurl("post","/business_tool/image",params)
198
289
  end
199
290
 
200
291
 
@@ -215,6 +306,19 @@ class CentralIndex
215
306
  end
216
307
 
217
308
 
309
+ #
310
+ # Returns the supplied wolf category object by fetching the supplied category_id from our categories object.
311
+ #
312
+ # @param category_id
313
+ # @return - the data from the api
314
+ #
315
+ def getCategory( category_id)
316
+ params = Hash.new
317
+ params['category_id'] = category_id
318
+ return doCurl("get","/category",params)
319
+ end
320
+
321
+
218
322
  #
219
323
  # Returns all Central Index categories and associated data
220
324
  #
@@ -226,6 +330,23 @@ class CentralIndex
226
330
  end
227
331
 
228
332
 
333
+ #
334
+ # With a known category id, a mapping object can be deleted.
335
+ #
336
+ # @param category_id
337
+ # @param category_type
338
+ # @param mapped_id
339
+ # @return - the data from the api
340
+ #
341
+ def deleteCategoryMappings( category_id, category_type, mapped_id)
342
+ params = Hash.new
343
+ params['category_id'] = category_id
344
+ params['category_type'] = category_type
345
+ params['mapped_id'] = mapped_id
346
+ return doCurl("delete","/category/mappings",params)
347
+ end
348
+
349
+
229
350
  #
230
351
  # With a known category id, a mapping object can be added.
231
352
  #
@@ -261,36 +382,36 @@ class CentralIndex
261
382
 
262
383
 
263
384
  #
264
- # With a known category id, a synonyms object can be removed.
385
+ # With a known category id, an synonym object can be added.
265
386
  #
266
387
  # @param category_id
267
388
  # @param synonym
268
389
  # @param language
269
390
  # @return - the data from the api
270
391
  #
271
- def deleteCategorySynonym( category_id, synonym, language)
392
+ def postCategorySynonym( category_id, synonym, language)
272
393
  params = Hash.new
273
394
  params['category_id'] = category_id
274
395
  params['synonym'] = synonym
275
396
  params['language'] = language
276
- return doCurl("delete","/category/synonym",params)
397
+ return doCurl("post","/category/synonym",params)
277
398
  end
278
399
 
279
400
 
280
401
  #
281
- # With a known category id, an synonym object can be added.
402
+ # With a known category id, a synonyms object can be removed.
282
403
  #
283
404
  # @param category_id
284
405
  # @param synonym
285
406
  # @param language
286
407
  # @return - the data from the api
287
408
  #
288
- def postCategorySynonym( category_id, synonym, language)
409
+ def deleteCategorySynonym( category_id, synonym, language)
289
410
  params = Hash.new
290
411
  params['category_id'] = category_id
291
412
  params['synonym'] = synonym
292
413
  params['language'] = language
293
- return doCurl("post","/category/synonym",params)
414
+ return doCurl("delete","/category/synonym",params)
294
415
  end
295
416
 
296
417
 
@@ -319,9 +440,14 @@ class CentralIndex
319
440
  # @param nokia_country_code
320
441
  # @param twilio_sms
321
442
  # @param twilio_phone
443
+ # @param twilio_voice
444
+ # @param currency_symbol - the symbol of this country's currency
445
+ # @param currency_symbol_html - the html version of the symbol of this country's currency
446
+ # @param postcodeLookupActive - Whether the lookup is activated for this country
447
+ # @param addressFields - Whether fields are activated for this country
322
448
  # @return - the data from the api
323
449
  #
324
- def postCountry( country_id, name, synonyms, continentName, continent, geonameId, dbpediaURL, freebaseURL, population, currencyCode, languages, areaInSqKm, capital, east, west, north, south, claimPrice, claimMethods, nokia_country_code, twilio_sms, twilio_phone)
450
+ def postCountry( country_id, name, synonyms, continentName, continent, geonameId, dbpediaURL, freebaseURL, population, currencyCode, languages, areaInSqKm, capital, east, west, north, south, claimPrice, claimMethods, nokia_country_code, twilio_sms, twilio_phone, twilio_voice, currency_symbol, currency_symbol_html, postcodeLookupActive, addressFields)
325
451
  params = Hash.new
326
452
  params['country_id'] = country_id
327
453
  params['name'] = name
@@ -345,6 +471,11 @@ class CentralIndex
345
471
  params['nokia_country_code'] = nokia_country_code
346
472
  params['twilio_sms'] = twilio_sms
347
473
  params['twilio_phone'] = twilio_phone
474
+ params['twilio_voice'] = twilio_voice
475
+ params['currency_symbol'] = currency_symbol
476
+ params['currency_symbol_html'] = currency_symbol_html
477
+ params['postcodeLookupActive'] = postcodeLookupActive
478
+ params['addressFields'] = addressFields
348
479
  return doCurl("post","/country",params)
349
480
  end
350
481
 
@@ -362,6 +493,38 @@ class CentralIndex
362
493
  end
363
494
 
364
495
 
496
+ #
497
+ # For a given country add/update a background image to show in the add/edit path
498
+ #
499
+ # @param country_id
500
+ # @param filedata
501
+ # @param backgroundImageAttr
502
+ # @return - the data from the api
503
+ #
504
+ def postCountryBackgroundImage( country_id, filedata, backgroundImageAttr)
505
+ params = Hash.new
506
+ params['country_id'] = country_id
507
+ params['filedata'] = filedata
508
+ params['backgroundImageAttr'] = backgroundImageAttr
509
+ return doCurl("post","/country/backgroundImage",params)
510
+ end
511
+
512
+
513
+ #
514
+ # For a given country add/update a social login background image to show in the add/edit path
515
+ #
516
+ # @param country_id
517
+ # @param filedata
518
+ # @return - the data from the api
519
+ #
520
+ def postCountrySocialLoginImage( country_id, filedata)
521
+ params = Hash.new
522
+ params['country_id'] = country_id
523
+ params['filedata'] = filedata
524
+ return doCurl("post","/country/socialLoginImage",params)
525
+ end
526
+
527
+
365
528
  #
366
529
  # Send an email via amazon
367
530
  #
@@ -385,6 +548,19 @@ class CentralIndex
385
548
  end
386
549
 
387
550
 
551
+ #
552
+ # Allows a whole entity to be pulled from the datastore by its unique id
553
+ #
554
+ # @param entity_id - The unique entity ID e.g. 379236608286720
555
+ # @return - the data from the api
556
+ #
557
+ def getEntity( entity_id)
558
+ params = Hash.new
559
+ params['entity_id'] = entity_id
560
+ return doCurl("get","/entity",params)
561
+ end
562
+
563
+
388
564
  #
389
565
  # This entity isn't really supported anymore. You probably want PUT /business. Only to be used for testing.
390
566
  #
@@ -407,15 +583,19 @@ class CentralIndex
407
583
 
408
584
 
409
585
  #
410
- # Allows a whole entity to be pulled from the datastore by its unique id
586
+ # With a known entity id, an add can be updated.
411
587
  #
412
- # @param entity_id - The unique entity ID e.g. 379236608286720
588
+ # @param entity_id
589
+ # @param add_referrer_url
590
+ # @param add_referrer_name
413
591
  # @return - the data from the api
414
592
  #
415
- def getEntity( entity_id)
593
+ def postEntityAdd( entity_id, add_referrer_url, add_referrer_name)
416
594
  params = Hash.new
417
595
  params['entity_id'] = entity_id
418
- return doCurl("get","/entity",params)
596
+ params['add_referrer_url'] = add_referrer_url
597
+ params['add_referrer_name'] = add_referrer_name
598
+ return doCurl("post","/entity/add",params)
419
599
  end
420
600
 
421
601
 
@@ -712,6 +892,19 @@ class CentralIndex
712
892
  end
713
893
 
714
894
 
895
+ #
896
+ # Get all entities within a specified group
897
+ #
898
+ # @param group_id
899
+ # @return - the data from the api
900
+ #
901
+ def getEntityBy_groupid( group_id)
902
+ params = Hash.new
903
+ params['group_id'] = group_id
904
+ return doCurl("get","/entity/by_groupid",params)
905
+ end
906
+
907
+
715
908
  #
716
909
  # Fetches the documents that match the given masheryid and supplier_id
717
910
  #
@@ -791,15 +984,19 @@ class CentralIndex
791
984
  # @param claimed_date
792
985
  # @param claim_method
793
986
  # @param phone_number
987
+ # @param referrer_url
988
+ # @param referrer_name
794
989
  # @return - the data from the api
795
990
  #
796
- def postEntityClaim( entity_id, claimed_user_id, claimed_date, claim_method, phone_number)
991
+ def postEntityClaim( entity_id, claimed_user_id, claimed_date, claim_method, phone_number, referrer_url, referrer_name)
797
992
  params = Hash.new
798
993
  params['entity_id'] = entity_id
799
994
  params['claimed_user_id'] = claimed_user_id
800
995
  params['claimed_date'] = claimed_date
801
996
  params['claim_method'] = claim_method
802
997
  params['phone_number'] = phone_number
998
+ params['referrer_url'] = referrer_url
999
+ params['referrer_name'] = referrer_name
803
1000
  return doCurl("post","/entity/claim",params)
804
1001
  end
805
1002
 
@@ -836,6 +1033,21 @@ class CentralIndex
836
1033
  end
837
1034
 
838
1035
 
1036
+ #
1037
+ # Allows a phone object to be reduced in confidence
1038
+ #
1039
+ # @param entity_id
1040
+ # @param gen_id
1041
+ # @return - the data from the api
1042
+ #
1043
+ def deleteEntityDocument( entity_id, gen_id)
1044
+ params = Hash.new
1045
+ params['entity_id'] = entity_id
1046
+ params['gen_id'] = gen_id
1047
+ return doCurl("delete","/entity/document",params)
1048
+ end
1049
+
1050
+
839
1051
  #
840
1052
  # With a known entity id, an document object can be added.
841
1053
  #
@@ -854,17 +1066,19 @@ class CentralIndex
854
1066
 
855
1067
 
856
1068
  #
857
- # Allows a phone object to be reduced in confidence
1069
+ # With a known entity id, an email address object can be added.
858
1070
  #
859
1071
  # @param entity_id
860
- # @param gen_id
1072
+ # @param email_address
1073
+ # @param email_description
861
1074
  # @return - the data from the api
862
1075
  #
863
- def deleteEntityDocument( entity_id, gen_id)
1076
+ def postEntityEmail( entity_id, email_address, email_description)
864
1077
  params = Hash.new
865
1078
  params['entity_id'] = entity_id
866
- params['gen_id'] = gen_id
867
- return doCurl("delete","/entity/document",params)
1079
+ params['email_address'] = email_address
1080
+ params['email_description'] = email_description
1081
+ return doCurl("post","/entity/email",params)
868
1082
  end
869
1083
 
870
1084
 
@@ -884,19 +1098,17 @@ class CentralIndex
884
1098
 
885
1099
 
886
1100
  #
887
- # With a known entity id, an email address object can be added.
1101
+ # Allows an employee object to be reduced in confidence
888
1102
  #
889
1103
  # @param entity_id
890
- # @param email_address
891
- # @param email_description
1104
+ # @param gen_id
892
1105
  # @return - the data from the api
893
1106
  #
894
- def postEntityEmail( entity_id, email_address, email_description)
1107
+ def deleteEntityEmployee( entity_id, gen_id)
895
1108
  params = Hash.new
896
1109
  params['entity_id'] = entity_id
897
- params['email_address'] = email_address
898
- params['email_description'] = email_description
899
- return doCurl("post","/entity/email",params)
1110
+ params['gen_id'] = gen_id
1111
+ return doCurl("delete","/entity/employee",params)
900
1112
  end
901
1113
 
902
1114
 
@@ -927,21 +1139,6 @@ class CentralIndex
927
1139
  end
928
1140
 
929
1141
 
930
- #
931
- # Allows an employee object to be reduced in confidence
932
- #
933
- # @param entity_id
934
- # @param gen_id
935
- # @return - the data from the api
936
- #
937
- def deleteEntityEmployee( entity_id, gen_id)
938
- params = Hash.new
939
- params['entity_id'] = entity_id
940
- params['gen_id'] = gen_id
941
- return doCurl("delete","/entity/employee",params)
942
- end
943
-
944
-
945
1142
  #
946
1143
  # Allows a fax object to be reduced in confidence
947
1144
  #
@@ -1170,12 +1367,20 @@ class CentralIndex
1170
1367
  #
1171
1368
  # @param from
1172
1369
  # @param to
1370
+ # @param override_trust - Do you want to override the trust of the 'from' entity
1371
+ # @param uncontribute_masheryid - Do we want to uncontribute any data for a masheryid?
1372
+ # @param uncontribute_userid - Do we want to uncontribute any data for a user_id?
1373
+ # @param uncontribute_supplierid - Do we want to uncontribute any data for a supplier_id?
1173
1374
  # @return - the data from the api
1174
1375
  #
1175
- def postEntityMerge( from, to)
1376
+ def postEntityMerge( from, to, override_trust, uncontribute_masheryid, uncontribute_userid, uncontribute_supplierid)
1176
1377
  params = Hash.new
1177
1378
  params['from'] = from
1178
1379
  params['to'] = to
1380
+ params['override_trust'] = override_trust
1381
+ params['uncontribute_masheryid'] = uncontribute_masheryid
1382
+ params['uncontribute_userid'] = uncontribute_userid
1383
+ params['uncontribute_supplierid'] = uncontribute_supplierid
1179
1384
  return doCurl("post","/entity/merge",params)
1180
1385
  end
1181
1386
 
@@ -1246,19 +1451,15 @@ class CentralIndex
1246
1451
 
1247
1452
 
1248
1453
  #
1249
- # Allows a new phone object to be added to a specified entity. A new object id will be calculated and returned to you if successful.
1454
+ # With a known entity id, a opening times object can be removed.
1250
1455
  #
1251
- # @param entity_id
1252
- # @param number
1253
- # @param description
1456
+ # @param entity_id - The id of the entity to edit
1254
1457
  # @return - the data from the api
1255
1458
  #
1256
- def postEntityPhone( entity_id, number, description)
1459
+ def deleteEntityOpening_times( entity_id)
1257
1460
  params = Hash.new
1258
1461
  params['entity_id'] = entity_id
1259
- params['number'] = number
1260
- params['description'] = description
1261
- return doCurl("post","/entity/phone",params)
1462
+ return doCurl("delete","/entity/opening_times",params)
1262
1463
  end
1263
1464
 
1264
1465
 
@@ -1277,6 +1478,23 @@ class CentralIndex
1277
1478
  end
1278
1479
 
1279
1480
 
1481
+ #
1482
+ # Allows a new phone object to be added to a specified entity. A new object id will be calculated and returned to you if successful.
1483
+ #
1484
+ # @param entity_id
1485
+ # @param number
1486
+ # @param description
1487
+ # @return - the data from the api
1488
+ #
1489
+ def postEntityPhone( entity_id, number, description)
1490
+ params = Hash.new
1491
+ params['entity_id'] = entity_id
1492
+ params['number'] = number
1493
+ params['description'] = description
1494
+ return doCurl("post","/entity/phone",params)
1495
+ end
1496
+
1497
+
1280
1498
  #
1281
1499
  # Create/Update a postal address
1282
1500
  #
@@ -1312,6 +1530,19 @@ class CentralIndex
1312
1530
  end
1313
1531
 
1314
1532
 
1533
+ #
1534
+ # Fetches the documents that match the given masheryid and supplier_id
1535
+ #
1536
+ # @param supplier_id - The Supplier ID
1537
+ # @return - the data from the api
1538
+ #
1539
+ def getEntityProvisionalBy_supplier_id( supplier_id)
1540
+ params = Hash.new
1541
+ params['supplier_id'] = supplier_id
1542
+ return doCurl("get","/entity/provisional/by_supplier_id",params)
1543
+ end
1544
+
1545
+
1315
1546
  #
1316
1547
  # Allows a list of available revisions to be returned by its entity id
1317
1548
  #
@@ -1404,15 +1635,19 @@ class CentralIndex
1404
1635
  # @param page - What page number to retrieve
1405
1636
  # @param country - Which country to return results for. An ISO compatible country code, E.g. ie
1406
1637
  # @param language - An ISO compatible language code, E.g. en
1638
+ # @param latitude - The decimal latitude of the search context (optional)
1639
+ # @param longitude - The decimal longitude of the search context (optional)
1407
1640
  # @return - the data from the api
1408
1641
  #
1409
- def getEntitySearchBylocation( where, per_page, page, country, language)
1642
+ def getEntitySearchBylocation( where, per_page, page, country, language, latitude, longitude)
1410
1643
  params = Hash.new
1411
1644
  params['where'] = where
1412
1645
  params['per_page'] = per_page
1413
1646
  params['page'] = page
1414
1647
  params['country'] = country
1415
1648
  params['language'] = language
1649
+ params['latitude'] = latitude
1650
+ params['longitude'] = longitude
1416
1651
  return doCurl("get","/entity/search/bylocation",params)
1417
1652
  end
1418
1653
 
@@ -1476,9 +1711,11 @@ class CentralIndex
1476
1711
  # @param page - Which page number to retrieve
1477
1712
  # @param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
1478
1713
  # @param language - An ISO compatible language code, E.g. en
1714
+ # @param latitude - The decimal latitude of the search context (optional)
1715
+ # @param longitude - The decimal longitude of the search context (optional)
1479
1716
  # @return - the data from the api
1480
1717
  #
1481
- def getEntitySearchWhatBylocation( what, where, per_page, page, country, language)
1718
+ def getEntitySearchWhatBylocation( what, where, per_page, page, country, language, latitude, longitude)
1482
1719
  params = Hash.new
1483
1720
  params['what'] = what
1484
1721
  params['where'] = where
@@ -1486,6 +1723,8 @@ class CentralIndex
1486
1723
  params['page'] = page
1487
1724
  params['country'] = country
1488
1725
  params['language'] = language
1726
+ params['latitude'] = latitude
1727
+ params['longitude'] = longitude
1489
1728
  return doCurl("get","/entity/search/what/bylocation",params)
1490
1729
  end
1491
1730
 
@@ -1497,14 +1736,16 @@ class CentralIndex
1497
1736
  # @param per_page - How many results per page
1498
1737
  # @param page - What page number to retrieve
1499
1738
  # @param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
1739
+ # @param language - An ISO compatible language code, E.g. en
1500
1740
  # @return - the data from the api
1501
1741
  #
1502
- def getEntitySearchWho( who, per_page, page, country)
1742
+ def getEntitySearchWho( who, per_page, page, country, language)
1503
1743
  params = Hash.new
1504
1744
  params['who'] = who
1505
1745
  params['per_page'] = per_page
1506
1746
  params['page'] = page
1507
1747
  params['country'] = country
1748
+ params['language'] = language
1508
1749
  return doCurl("get","/entity/search/who",params)
1509
1750
  end
1510
1751
 
@@ -1520,9 +1761,10 @@ class CentralIndex
1520
1761
  # @param per_page
1521
1762
  # @param page
1522
1763
  # @param country
1764
+ # @param language - An ISO compatible language code, E.g. en
1523
1765
  # @return - the data from the api
1524
1766
  #
1525
- def getEntitySearchWhoByboundingbox( who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country)
1767
+ def getEntitySearchWhoByboundingbox( who, latitude_1, longitude_1, latitude_2, longitude_2, per_page, page, country, language)
1526
1768
  params = Hash.new
1527
1769
  params['who'] = who
1528
1770
  params['latitude_1'] = latitude_1
@@ -1532,6 +1774,7 @@ class CentralIndex
1532
1774
  params['per_page'] = per_page
1533
1775
  params['page'] = page
1534
1776
  params['country'] = country
1777
+ params['language'] = language
1535
1778
  return doCurl("get","/entity/search/who/byboundingbox",params)
1536
1779
  end
1537
1780
 
@@ -1544,15 +1787,21 @@ class CentralIndex
1544
1787
  # @param per_page - Number of results returned per page
1545
1788
  # @param page - Which page number to retrieve
1546
1789
  # @param country - Which country to return results for. An ISO compatible country code, E.g. ie e.g. ie
1790
+ # @param latitude - The decimal latitude of the search context (optional)
1791
+ # @param longitude - The decimal longitude of the search context (optional)
1792
+ # @param language - An ISO compatible language code, E.g. en
1547
1793
  # @return - the data from the api
1548
1794
  #
1549
- def getEntitySearchWhoBylocation( who, where, per_page, page, country)
1795
+ def getEntitySearchWhoBylocation( who, where, per_page, page, country, latitude, longitude, language)
1550
1796
  params = Hash.new
1551
1797
  params['who'] = who
1552
1798
  params['where'] = where
1553
1799
  params['per_page'] = per_page
1554
1800
  params['page'] = page
1555
1801
  params['country'] = country
1802
+ params['latitude'] = latitude
1803
+ params['longitude'] = longitude
1804
+ params['language'] = language
1556
1805
  return doCurl("get","/entity/search/who/bylocation",params)
1557
1806
  end
1558
1807
 
@@ -1699,6 +1948,21 @@ class CentralIndex
1699
1948
  end
1700
1949
 
1701
1950
 
1951
+ #
1952
+ # Allows a testimonial object to be reduced in confidence
1953
+ #
1954
+ # @param entity_id
1955
+ # @param gen_id
1956
+ # @return - the data from the api
1957
+ #
1958
+ def deleteEntityTestimonial( entity_id, gen_id)
1959
+ params = Hash.new
1960
+ params['entity_id'] = entity_id
1961
+ params['gen_id'] = gen_id
1962
+ return doCurl("delete","/entity/testimonial",params)
1963
+ end
1964
+
1965
+
1702
1966
  #
1703
1967
  # With a known entity id, a testimonial object can be added.
1704
1968
  #
@@ -1721,17 +1985,21 @@ class CentralIndex
1721
1985
 
1722
1986
 
1723
1987
  #
1724
- # Allows a testimonial object to be reduced in confidence
1988
+ # Get the updates a uncontribute would perform
1725
1989
  #
1726
- # @param entity_id
1727
- # @param gen_id
1990
+ # @param entity_id - The entity to pull
1991
+ # @param object_name - The entity object to update
1992
+ # @param supplier_id - The supplier_id to remove
1993
+ # @param user_id - The user_id to remove
1728
1994
  # @return - the data from the api
1729
1995
  #
1730
- def deleteEntityTestimonial( entity_id, gen_id)
1996
+ def getEntityUncontribute( entity_id, object_name, supplier_id, user_id)
1731
1997
  params = Hash.new
1732
1998
  params['entity_id'] = entity_id
1733
- params['gen_id'] = gen_id
1734
- return doCurl("delete","/entity/testimonial",params)
1999
+ params['object_name'] = object_name
2000
+ params['supplier_id'] = supplier_id
2001
+ params['user_id'] = user_id
2002
+ return doCurl("get","/entity/uncontribute",params)
1735
2003
  end
1736
2004
 
1737
2005
 
@@ -1833,6 +2101,19 @@ class CentralIndex
1833
2101
  end
1834
2102
 
1835
2103
 
2104
+ #
2105
+ # Get a flatpack
2106
+ #
2107
+ # @param flatpack_id - the unique id to search for
2108
+ # @return - the data from the api
2109
+ #
2110
+ def getFlatpack( flatpack_id)
2111
+ params = Hash.new
2112
+ params['flatpack_id'] = flatpack_id
2113
+ return doCurl("get","/flatpack",params)
2114
+ end
2115
+
2116
+
1836
2117
  #
1837
2118
  # Remove a flatpack using a supplied flatpack_id
1838
2119
  #
@@ -1851,6 +2132,7 @@ class CentralIndex
1851
2132
  #
1852
2133
  # @param flatpack_id - this record's unique, auto-generated id - if supplied, then this is an edit, otherwise it's an add
1853
2134
  # @param domainName - the domain name to serve this flatpack site on (no leading http:// or anything please)
2135
+ # @param stub - the stub that is appended to the flatpack's url e.g. http://dev.localhost/stub
1854
2136
  # @param flatpackName - the name of the Flat pack instance
1855
2137
  # @param less - the LESS configuration to use to overrides the Bootstrap CSS
1856
2138
  # @param language - the language in which to render the flatpack site
@@ -1877,6 +2159,7 @@ class CentralIndex
1877
2159
  # @param bodyTop - the payload to put in the top of the body of a flatpack
1878
2160
  # @param bodyBottom - the payload to put in the bottom of the body of a flatpack
1879
2161
  # @param header_menu - the JSON that describes a navigation at the top of the page
2162
+ # @param header_menu_bottom - the JSON that describes a navigation below the masthead
1880
2163
  # @param footer_menu - the JSON that describes a navigation at the bottom of the page
1881
2164
  # @param bdpTitle - The page title of the entity business profile pages
1882
2165
  # @param bdpDescription - The meta description of entity business profile pages
@@ -1886,6 +2169,8 @@ class CentralIndex
1886
2169
  # @param serpNumberResults - The number of results per search page
1887
2170
  # @param serpNumberAdverts - The number of adverts to show on the first search page
1888
2171
  # @param serpAds - The block of HTML/JS that renders Ads on Serps
2172
+ # @param serpTitleNoWhat - The text to display in the title for where only searches
2173
+ # @param serpDescriptionNoWhat - The text to display in the description for where only searches
1889
2174
  # @param cookiePolicyUrl - The cookie policy url of the flatpack
1890
2175
  # @param cookiePolicyNotice - Whether to show the cookie policy on this flatpack
1891
2176
  # @param addBusinessButtonText - The text used in the 'Add your business' button
@@ -1898,12 +2183,18 @@ class CentralIndex
1898
2183
  # @param advertUpgradeMaxLocations - the number of locations upgrading gives you
1899
2184
  # @param advertUpgradeContractLength - the length of the contract (days)
1900
2185
  # @param advertUpgradeRefId - a unique reference for the upgrade
2186
+ # @param phoneReveal - record phone number reveal
2187
+ # @param loginLinkText - the link text for the Login link
2188
+ # @param contextLocationId - The location ID to use as the context for searches on this flatpack
2189
+ # @param addBusinessButtonPosition - The location ID to use as the context for searches on this flatpack
2190
+ # @param denyIndexing - Whether to noindex a flatpack
1901
2191
  # @return - the data from the api
1902
2192
  #
1903
- def postFlatpack( flatpack_id, domainName, flatpackName, less, language, country, mapsType, mapKey, searchFormShowOn, searchFormShowKeywordsBox, searchFormShowLocationBox, searchFormKeywordsAutoComplete, searchFormLocationsAutoComplete, searchFormDefaultLocation, searchFormPlaceholderKeywords, searchFormPlaceholderLocation, searchFormKeywordsLabel, searchFormLocationLabel, cannedLinksHeader, homepageTitle, homepageDescription, homepageIntroTitle, homepageIntroText, head, adblock, bodyTop, bodyBottom, header_menu, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId)
2193
+ def postFlatpack( flatpack_id, domainName, stub, flatpackName, less, language, country, mapsType, mapKey, searchFormShowOn, searchFormShowKeywordsBox, searchFormShowLocationBox, searchFormKeywordsAutoComplete, searchFormLocationsAutoComplete, searchFormDefaultLocation, searchFormPlaceholderKeywords, searchFormPlaceholderLocation, searchFormKeywordsLabel, searchFormLocationLabel, cannedLinksHeader, homepageTitle, homepageDescription, homepageIntroTitle, homepageIntroText, head, adblock, bodyTop, bodyBottom, header_menu, header_menu_bottom, footer_menu, bdpTitle, bdpDescription, bdpAds, serpTitle, serpDescription, serpNumberResults, serpNumberAdverts, serpAds, serpTitleNoWhat, serpDescriptionNoWhat, cookiePolicyUrl, cookiePolicyNotice, addBusinessButtonText, twitterUrl, facebookUrl, copyright, advertUpgradeActive, advertUpgradePrice, advertUpgradeMaxTags, advertUpgradeMaxLocations, advertUpgradeContractLength, advertUpgradeRefId, phoneReveal, loginLinkText, contextLocationId, addBusinessButtonPosition, denyIndexing)
1904
2194
  params = Hash.new
1905
2195
  params['flatpack_id'] = flatpack_id
1906
2196
  params['domainName'] = domainName
2197
+ params['stub'] = stub
1907
2198
  params['flatpackName'] = flatpackName
1908
2199
  params['less'] = less
1909
2200
  params['language'] = language
@@ -1930,6 +2221,7 @@ class CentralIndex
1930
2221
  params['bodyTop'] = bodyTop
1931
2222
  params['bodyBottom'] = bodyBottom
1932
2223
  params['header_menu'] = header_menu
2224
+ params['header_menu_bottom'] = header_menu_bottom
1933
2225
  params['footer_menu'] = footer_menu
1934
2226
  params['bdpTitle'] = bdpTitle
1935
2227
  params['bdpDescription'] = bdpDescription
@@ -1939,6 +2231,8 @@ class CentralIndex
1939
2231
  params['serpNumberResults'] = serpNumberResults
1940
2232
  params['serpNumberAdverts'] = serpNumberAdverts
1941
2233
  params['serpAds'] = serpAds
2234
+ params['serpTitleNoWhat'] = serpTitleNoWhat
2235
+ params['serpDescriptionNoWhat'] = serpDescriptionNoWhat
1942
2236
  params['cookiePolicyUrl'] = cookiePolicyUrl
1943
2237
  params['cookiePolicyNotice'] = cookiePolicyNotice
1944
2238
  params['addBusinessButtonText'] = addBusinessButtonText
@@ -1951,20 +2245,57 @@ class CentralIndex
1951
2245
  params['advertUpgradeMaxLocations'] = advertUpgradeMaxLocations
1952
2246
  params['advertUpgradeContractLength'] = advertUpgradeContractLength
1953
2247
  params['advertUpgradeRefId'] = advertUpgradeRefId
2248
+ params['phoneReveal'] = phoneReveal
2249
+ params['loginLinkText'] = loginLinkText
2250
+ params['contextLocationId'] = contextLocationId
2251
+ params['addBusinessButtonPosition'] = addBusinessButtonPosition
2252
+ params['denyIndexing'] = denyIndexing
1954
2253
  return doCurl("post","/flatpack",params)
1955
2254
  end
1956
2255
 
1957
2256
 
1958
2257
  #
1959
- # Get a flatpack
2258
+ # Upload a CSS file for the Admin for this flatpack
1960
2259
  #
1961
- # @param flatpack_id - the unique id to search for
2260
+ # @param flatpack_id - the id of the flatpack to update
2261
+ # @param filedata
1962
2262
  # @return - the data from the api
1963
2263
  #
1964
- def getFlatpack( flatpack_id)
2264
+ def postFlatpackAdminCSS( flatpack_id, filedata)
1965
2265
  params = Hash.new
1966
2266
  params['flatpack_id'] = flatpack_id
1967
- return doCurl("get","/flatpack",params)
2267
+ params['filedata'] = filedata
2268
+ return doCurl("post","/flatpack/adminCSS",params)
2269
+ end
2270
+
2271
+
2272
+ #
2273
+ # Upload an image to serve out as the large logo in the Admin for this flatpack
2274
+ #
2275
+ # @param flatpack_id - the id of the flatpack to update
2276
+ # @param filedata
2277
+ # @return - the data from the api
2278
+ #
2279
+ def postFlatpackAdminLargeLogo( flatpack_id, filedata)
2280
+ params = Hash.new
2281
+ params['flatpack_id'] = flatpack_id
2282
+ params['filedata'] = filedata
2283
+ return doCurl("post","/flatpack/adminLargeLogo",params)
2284
+ end
2285
+
2286
+
2287
+ #
2288
+ # Upload an image to serve out as the small logo in the Admin for this flatpack
2289
+ #
2290
+ # @param flatpack_id - the id of the flatpack to update
2291
+ # @param filedata
2292
+ # @return - the data from the api
2293
+ #
2294
+ def postFlatpackAdminSmallLogo( flatpack_id, filedata)
2295
+ params = Hash.new
2296
+ params['flatpack_id'] = flatpack_id
2297
+ params['filedata'] = filedata
2298
+ return doCurl("post","/flatpack/adminSmallLogo",params)
1968
2299
  end
1969
2300
 
1970
2301
 
@@ -1993,32 +2324,32 @@ class CentralIndex
1993
2324
 
1994
2325
 
1995
2326
  #
1996
- # Upload an icon to serve out with this flatpack
2327
+ # Clone an existing flatpack
1997
2328
  #
1998
- # @param flatpack_id - the id of the flatpack to update
1999
- # @param filedata
2329
+ # @param flatpack_id - the flatpack_id to clone
2330
+ # @param domainName - the domain of the new flatpack site (no leading http:// or anything please)
2000
2331
  # @return - the data from the api
2001
2332
  #
2002
- def postFlatpackIcon( flatpack_id, filedata)
2333
+ def getFlatpackClone( flatpack_id, domainName)
2003
2334
  params = Hash.new
2004
2335
  params['flatpack_id'] = flatpack_id
2005
- params['filedata'] = filedata
2006
- return doCurl("post","/flatpack/icon",params)
2336
+ params['domainName'] = domainName
2337
+ return doCurl("get","/flatpack/clone",params)
2007
2338
  end
2008
2339
 
2009
2340
 
2010
2341
  #
2011
- # Remove a canned link to an existing flatpack site.
2342
+ # Upload an icon to serve out with this flatpack
2012
2343
  #
2013
- # @param flatpack_id - the id of the flatpack to delete
2014
- # @param gen_id - the id of the canned link to remove
2344
+ # @param flatpack_id - the id of the flatpack to update
2345
+ # @param filedata
2015
2346
  # @return - the data from the api
2016
2347
  #
2017
- def deleteFlatpackLink( flatpack_id, gen_id)
2348
+ def postFlatpackIcon( flatpack_id, filedata)
2018
2349
  params = Hash.new
2019
2350
  params['flatpack_id'] = flatpack_id
2020
- params['gen_id'] = gen_id
2021
- return doCurl("delete","/flatpack/link",params)
2351
+ params['filedata'] = filedata
2352
+ return doCurl("post","/flatpack/icon",params)
2022
2353
  end
2023
2354
 
2024
2355
 
@@ -2041,6 +2372,21 @@ class CentralIndex
2041
2372
  end
2042
2373
 
2043
2374
 
2375
+ #
2376
+ # Remove a canned link to an existing flatpack site.
2377
+ #
2378
+ # @param flatpack_id - the id of the flatpack to delete
2379
+ # @param gen_id - the id of the canned link to remove
2380
+ # @return - the data from the api
2381
+ #
2382
+ def deleteFlatpackLink( flatpack_id, gen_id)
2383
+ params = Hash.new
2384
+ params['flatpack_id'] = flatpack_id
2385
+ params['gen_id'] = gen_id
2386
+ return doCurl("delete","/flatpack/link",params)
2387
+ end
2388
+
2389
+
2044
2390
  #
2045
2391
  # Upload a logo to serve out with this flatpack
2046
2392
  #
@@ -2056,6 +2402,21 @@ class CentralIndex
2056
2402
  end
2057
2403
 
2058
2404
 
2405
+ #
2406
+ # Upload a TXT file to act as the sitemap for this flatpack
2407
+ #
2408
+ # @param flatpack_id - the id of the flatpack to update
2409
+ # @param filedata
2410
+ # @return - the data from the api
2411
+ #
2412
+ def postFlatpackSitemap( flatpack_id, filedata)
2413
+ params = Hash.new
2414
+ params['flatpack_id'] = flatpack_id
2415
+ params['filedata'] = filedata
2416
+ return doCurl("post","/flatpack/sitemap",params)
2417
+ end
2418
+
2419
+
2059
2420
  #
2060
2421
  # Upload a file to our asset server and return the url
2061
2422
  #
@@ -2114,6 +2475,130 @@ class CentralIndex
2114
2475
  end
2115
2476
 
2116
2477
 
2478
+ #
2479
+ # Bulk update entities with a specified group
2480
+ #
2481
+ # @param group_id
2482
+ # @param data
2483
+ # @return - the data from the api
2484
+ #
2485
+ def postGroupBulk_update( group_id, data)
2486
+ params = Hash.new
2487
+ params['group_id'] = group_id
2488
+ params['data'] = data
2489
+ return doCurl("post","/group/bulk_update",params)
2490
+ end
2491
+
2492
+
2493
+ #
2494
+ # Get number of claims today
2495
+ #
2496
+ # @param from_date
2497
+ # @param to_date
2498
+ # @param country_id
2499
+ # @return - the data from the api
2500
+ #
2501
+ def getHeartbeatBy_date( from_date, to_date, country_id)
2502
+ params = Hash.new
2503
+ params['from_date'] = from_date
2504
+ params['to_date'] = to_date
2505
+ params['country_id'] = country_id
2506
+ return doCurl("get","/heartbeat/by_date",params)
2507
+ end
2508
+
2509
+
2510
+ #
2511
+ # Get number of claims today
2512
+ #
2513
+ # @param country
2514
+ # @param claim_type
2515
+ # @return - the data from the api
2516
+ #
2517
+ def getHeartbeatTodayClaims( country, claim_type)
2518
+ params = Hash.new
2519
+ params['country'] = country
2520
+ params['claim_type'] = claim_type
2521
+ return doCurl("get","/heartbeat/today/claims",params)
2522
+ end
2523
+
2524
+
2525
+ #
2526
+ # Process a bulk file
2527
+ #
2528
+ # @param job_id
2529
+ # @param filedata - A tab separated file for ingest
2530
+ # @return - the data from the api
2531
+ #
2532
+ def postIngest_file( job_id, filedata)
2533
+ params = Hash.new
2534
+ params['job_id'] = job_id
2535
+ params['filedata'] = filedata
2536
+ return doCurl("post","/ingest_file",params)
2537
+ end
2538
+
2539
+
2540
+ #
2541
+ # Get an ingest job from the collection
2542
+ #
2543
+ # @param job_id
2544
+ # @return - the data from the api
2545
+ #
2546
+ def getIngest_job( job_id)
2547
+ params = Hash.new
2548
+ params['job_id'] = job_id
2549
+ return doCurl("get","/ingest_job",params)
2550
+ end
2551
+
2552
+
2553
+ #
2554
+ # Add a ingest job to the collection
2555
+ #
2556
+ # @param description
2557
+ # @param category_type
2558
+ # @return - the data from the api
2559
+ #
2560
+ def postIngest_job( description, category_type)
2561
+ params = Hash.new
2562
+ params['description'] = description
2563
+ params['category_type'] = category_type
2564
+ return doCurl("post","/ingest_job",params)
2565
+ end
2566
+
2567
+
2568
+ #
2569
+ # Get an ingest log from the collection
2570
+ #
2571
+ # @param job_id
2572
+ # @param success
2573
+ # @param errors
2574
+ # @param limit
2575
+ # @param skip
2576
+ # @return - the data from the api
2577
+ #
2578
+ def getIngest_logBy_job_id( job_id, success, errors, limit, skip)
2579
+ params = Hash.new
2580
+ params['job_id'] = job_id
2581
+ params['success'] = success
2582
+ params['errors'] = errors
2583
+ params['limit'] = limit
2584
+ params['skip'] = skip
2585
+ return doCurl("get","/ingest_log/by_job_id",params)
2586
+ end
2587
+
2588
+
2589
+ #
2590
+ # Check the status of the Ingest queue, and potentially flush it
2591
+ #
2592
+ # @param flush
2593
+ # @return - the data from the api
2594
+ #
2595
+ def getIngest_queue( flush)
2596
+ params = Hash.new
2597
+ params['flush'] = flush
2598
+ return doCurl("get","/ingest_queue",params)
2599
+ end
2600
+
2601
+
2117
2602
  #
2118
2603
  # Read a location with the supplied ID in the locations reference database.
2119
2604
  #
@@ -2128,20 +2613,20 @@ class CentralIndex
2128
2613
 
2129
2614
 
2130
2615
  #
2131
- # Create/update a new location entity with the supplied ID in the locations reference database.
2616
+ # Create/update a new locz document with the supplied ID in the locations reference database.
2132
2617
  #
2133
2618
  # @param location_id
2619
+ # @param type
2620
+ # @param country
2621
+ # @param language
2134
2622
  # @param name
2135
2623
  # @param formal_name
2136
- # @param latitude
2137
- # @param longitude
2138
2624
  # @param resolution
2139
- # @param country
2140
2625
  # @param population
2141
2626
  # @param description
2142
2627
  # @param timezone
2143
- # @param is_duplicate
2144
- # @param is_default
2628
+ # @param latitude
2629
+ # @param longitude
2145
2630
  # @param parent_town
2146
2631
  # @param parent_county
2147
2632
  # @param parent_province
@@ -2149,22 +2634,24 @@ class CentralIndex
2149
2634
  # @param parent_neighbourhood
2150
2635
  # @param parent_district
2151
2636
  # @param postalcode
2637
+ # @param searchable_id
2638
+ # @param searchable_ids
2152
2639
  # @return - the data from the api
2153
2640
  #
2154
- def postLocation( location_id, name, formal_name, latitude, longitude, resolution, country, population, description, timezone, is_duplicate, is_default, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode)
2641
+ def postLocation( location_id, type, country, language, name, formal_name, resolution, population, description, timezone, latitude, longitude, parent_town, parent_county, parent_province, parent_region, parent_neighbourhood, parent_district, postalcode, searchable_id, searchable_ids)
2155
2642
  params = Hash.new
2156
2643
  params['location_id'] = location_id
2644
+ params['type'] = type
2645
+ params['country'] = country
2646
+ params['language'] = language
2157
2647
  params['name'] = name
2158
2648
  params['formal_name'] = formal_name
2159
- params['latitude'] = latitude
2160
- params['longitude'] = longitude
2161
2649
  params['resolution'] = resolution
2162
- params['country'] = country
2163
2650
  params['population'] = population
2164
2651
  params['description'] = description
2165
2652
  params['timezone'] = timezone
2166
- params['is_duplicate'] = is_duplicate
2167
- params['is_default'] = is_default
2653
+ params['latitude'] = latitude
2654
+ params['longitude'] = longitude
2168
2655
  params['parent_town'] = parent_town
2169
2656
  params['parent_county'] = parent_county
2170
2657
  params['parent_province'] = parent_province
@@ -2172,6 +2659,8 @@ class CentralIndex
2172
2659
  params['parent_neighbourhood'] = parent_neighbourhood
2173
2660
  params['parent_district'] = parent_district
2174
2661
  params['postalcode'] = postalcode
2662
+ params['searchable_id'] = searchable_id
2663
+ params['searchable_ids'] = searchable_ids
2175
2664
  return doCurl("post","/location",params)
2176
2665
  end
2177
2666
 
@@ -2190,55 +2679,15 @@ class CentralIndex
2190
2679
 
2191
2680
 
2192
2681
  #
2193
- # Add a new source to a known location
2194
- #
2195
- # @param location_id
2196
- # @param type
2197
- # @param url
2198
- # @param ref
2199
- # @return - the data from the api
2200
- #
2201
- def postLocationSource( location_id, type, url, ref)
2202
- params = Hash.new
2203
- params['location_id'] = location_id
2204
- params['type'] = type
2205
- params['url'] = url
2206
- params['ref'] = ref
2207
- return doCurl("post","/location/source",params)
2208
- end
2209
-
2210
-
2211
- #
2212
- # Remove a new synonym from a known location
2213
- #
2214
- # @param location_id
2215
- # @param synonym
2216
- # @param language
2217
- # @return - the data from the api
2218
- #
2219
- def deleteLocationSynonym( location_id, synonym, language)
2220
- params = Hash.new
2221
- params['location_id'] = location_id
2222
- params['synonym'] = synonym
2223
- params['language'] = language
2224
- return doCurl("delete","/location/synonym",params)
2225
- end
2226
-
2227
-
2228
- #
2229
- # Add a new synonym to a known location
2682
+ # Fetch the project logo, the symbol of the Wolf
2230
2683
  #
2231
- # @param location_id
2232
- # @param synonym
2233
- # @param language
2684
+ # @param a
2234
2685
  # @return - the data from the api
2235
2686
  #
2236
- def postLocationSynonym( location_id, synonym, language)
2687
+ def putLogo( a)
2237
2688
  params = Hash.new
2238
- params['location_id'] = location_id
2239
- params['synonym'] = synonym
2240
- params['language'] = language
2241
- return doCurl("post","/location/synonym",params)
2689
+ params['a'] = a
2690
+ return doCurl("put","/logo",params)
2242
2691
  end
2243
2692
 
2244
2693
 
@@ -2261,19 +2710,6 @@ class CentralIndex
2261
2710
  end
2262
2711
 
2263
2712
 
2264
- #
2265
- # Fetch the project logo, the symbol of the Wolf
2266
- #
2267
- # @param a
2268
- # @return - the data from the api
2269
- #
2270
- def putLogo( a)
2271
- params = Hash.new
2272
- params['a'] = a
2273
- return doCurl("put","/logo",params)
2274
- end
2275
-
2276
-
2277
2713
  #
2278
2714
  # Find a category from cache or cloudant depending if it is in the cache
2279
2715
  #
@@ -2305,48 +2741,26 @@ class CentralIndex
2305
2741
 
2306
2742
 
2307
2743
  #
2308
- # Find a location from cache or cloudant depending if it is in the cache
2744
+ # Find a location from cache or cloudant depending if it is in the cache (locz)
2309
2745
  #
2310
2746
  # @param string
2747
+ # @param language
2311
2748
  # @param country
2749
+ # @param latitude
2750
+ # @param longitude
2312
2751
  # @return - the data from the api
2313
2752
  #
2314
- def getLookupLocation( string, country)
2753
+ def getLookupLocation( string, language, country, latitude, longitude)
2315
2754
  params = Hash.new
2316
2755
  params['string'] = string
2756
+ params['language'] = language
2317
2757
  params['country'] = country
2758
+ params['latitude'] = latitude
2759
+ params['longitude'] = longitude
2318
2760
  return doCurl("get","/lookup/location",params)
2319
2761
  end
2320
2762
 
2321
2763
 
2322
- #
2323
- # Find all the child locations of the selected location
2324
- #
2325
- # @param location_id
2326
- # @param resolution
2327
- # @return - the data from the api
2328
- #
2329
- def getLookupLocationChildren( location_id, resolution)
2330
- params = Hash.new
2331
- params['location_id'] = location_id
2332
- params['resolution'] = resolution
2333
- return doCurl("get","/lookup/location/children",params)
2334
- end
2335
-
2336
-
2337
- #
2338
- # Find all the parents locations of the selected location
2339
- #
2340
- # @param location_id
2341
- # @return - the data from the api
2342
- #
2343
- def getLookupLocationParents( location_id)
2344
- params = Hash.new
2345
- params['location_id'] = location_id
2346
- return doCurl("get","/lookup/location/parents",params)
2347
- end
2348
-
2349
-
2350
2764
  #
2351
2765
  # Find all matches by location and then return all matches that also match company name. Default location_strictness is set to 7, which equates to +/- 20m
2352
2766
  #
@@ -2375,17 +2789,19 @@ class CentralIndex
2375
2789
  # @param company_name
2376
2790
  # @param latitude
2377
2791
  # @param longitude
2792
+ # @param postcode
2378
2793
  # @param country
2379
2794
  # @param name_strictness
2380
2795
  # @param location_strictness
2381
2796
  # @return - the data from the api
2382
2797
  #
2383
- def getMatchByphone( phone, company_name, latitude, longitude, country, name_strictness, location_strictness)
2798
+ def getMatchByphone( phone, company_name, latitude, longitude, postcode, country, name_strictness, location_strictness)
2384
2799
  params = Hash.new
2385
2800
  params['phone'] = phone
2386
2801
  params['company_name'] = company_name
2387
2802
  params['latitude'] = latitude
2388
2803
  params['longitude'] = longitude
2804
+ params['postcode'] = postcode
2389
2805
  params['country'] = country
2390
2806
  params['name_strictness'] = name_strictness
2391
2807
  params['location_strictness'] = location_strictness
@@ -2393,6 +2809,19 @@ class CentralIndex
2393
2809
  end
2394
2810
 
2395
2811
 
2812
+ #
2813
+ # Fetching a message
2814
+ #
2815
+ # @param message_id - The message id to pull the message for
2816
+ # @return - the data from the api
2817
+ #
2818
+ def getMessage( message_id)
2819
+ params = Hash.new
2820
+ params['message_id'] = message_id
2821
+ return doCurl("get","/message",params)
2822
+ end
2823
+
2824
+
2396
2825
  #
2397
2826
  # Update/Add a message
2398
2827
  #
@@ -2423,69 +2852,143 @@ class CentralIndex
2423
2852
 
2424
2853
 
2425
2854
  #
2426
- # Fetching a message
2855
+ # Fetching messages by ses_id
2856
+ #
2857
+ # @param ses_id - The amazon id to pull the message for
2858
+ # @return - the data from the api
2859
+ #
2860
+ def getMessageBy_ses_id( ses_id)
2861
+ params = Hash.new
2862
+ params['ses_id'] = ses_id
2863
+ return doCurl("get","/message/by_ses_id",params)
2864
+ end
2865
+
2866
+
2867
+ #
2868
+ # With a known entity id, a private object can be added.
2869
+ #
2870
+ # @param entity_id - The entity to associate the private object with
2871
+ # @param data - The data to store
2872
+ # @return - the data from the api
2873
+ #
2874
+ def putPrivate_object( entity_id, data)
2875
+ params = Hash.new
2876
+ params['entity_id'] = entity_id
2877
+ params['data'] = data
2878
+ return doCurl("put","/private_object",params)
2879
+ end
2880
+
2881
+
2882
+ #
2883
+ # Allows a private object to be removed
2884
+ #
2885
+ # @param private_object_id - The id of the private object to remove
2886
+ # @return - the data from the api
2887
+ #
2888
+ def deletePrivate_object( private_object_id)
2889
+ params = Hash.new
2890
+ params['private_object_id'] = private_object_id
2891
+ return doCurl("delete","/private_object",params)
2892
+ end
2893
+
2894
+
2895
+ #
2896
+ # Allows a private object to be returned based on the entity_id and masheryid
2897
+ #
2898
+ # @param entity_id - The entity associated with the private object
2899
+ # @return - the data from the api
2900
+ #
2901
+ def getPrivate_objectAll( entity_id)
2902
+ params = Hash.new
2903
+ params['entity_id'] = entity_id
2904
+ return doCurl("get","/private_object/all",params)
2905
+ end
2906
+
2907
+
2908
+ #
2909
+ # Perform the whole PTB process on the supplied entity
2427
2910
  #
2428
- # @param message_id - The message id to pull the message for
2911
+ # @param entity_id
2912
+ # @param destructive
2429
2913
  # @return - the data from the api
2430
2914
  #
2431
- def getMessage( message_id)
2915
+ def getPtbAll( entity_id, destructive)
2432
2916
  params = Hash.new
2433
- params['message_id'] = message_id
2434
- return doCurl("get","/message",params)
2917
+ params['entity_id'] = entity_id
2918
+ params['destructive'] = destructive
2919
+ return doCurl("get","/ptb/all",params)
2435
2920
  end
2436
2921
 
2437
2922
 
2438
2923
  #
2439
- # Fetching messages by ses_id
2924
+ # Report on what happened to specific entity_id
2440
2925
  #
2441
- # @param ses_id - The amazon id to pull the message for
2926
+ # @param year - the year to examine
2927
+ # @param month - the month to examine
2928
+ # @param entity_id - the entity to research
2442
2929
  # @return - the data from the api
2443
2930
  #
2444
- def getMessageBy_ses_id( ses_id)
2931
+ def getPtbLog( year, month, entity_id)
2445
2932
  params = Hash.new
2446
- params['ses_id'] = ses_id
2447
- return doCurl("get","/message/by_ses_id",params)
2933
+ params['year'] = year
2934
+ params['month'] = month
2935
+ params['entity_id'] = entity_id
2936
+ return doCurl("get","/ptb/log",params)
2448
2937
  end
2449
2938
 
2450
2939
 
2451
2940
  #
2452
- # With a known entity id, a private object can be added.
2941
+ # Process an entity with a specific PTB module
2453
2942
  #
2454
- # @param entity_id - The entity to associate the private object with
2455
- # @param data - The data to store
2943
+ # @param entity_id
2944
+ # @param module
2945
+ # @param destructive
2456
2946
  # @return - the data from the api
2457
2947
  #
2458
- def putPrivate_object( entity_id, data)
2948
+ def getPtbModule( entity_id, module, destructive)
2459
2949
  params = Hash.new
2460
2950
  params['entity_id'] = entity_id
2461
- params['data'] = data
2462
- return doCurl("put","/private_object",params)
2951
+ params['module'] = module
2952
+ params['destructive'] = destructive
2953
+ return doCurl("get","/ptb/module",params)
2463
2954
  end
2464
2955
 
2465
2956
 
2466
2957
  #
2467
- # Allows a private object to be removed
2958
+ # Report on the run-rate of the Paint the Bridge System
2468
2959
  #
2469
- # @param private_object_id - The id of the private object to remove
2960
+ # @param country - the country to get the runrate for
2961
+ # @param year - the year to examine
2962
+ # @param month - the month to examine
2963
+ # @param day - the day to examine
2470
2964
  # @return - the data from the api
2471
2965
  #
2472
- def deletePrivate_object( private_object_id)
2966
+ def getPtbRunrate( country, year, month, day)
2473
2967
  params = Hash.new
2474
- params['private_object_id'] = private_object_id
2475
- return doCurl("delete","/private_object",params)
2968
+ params['country'] = country
2969
+ params['year'] = year
2970
+ params['month'] = month
2971
+ params['day'] = day
2972
+ return doCurl("get","/ptb/runrate",params)
2476
2973
  end
2477
2974
 
2478
2975
 
2479
2976
  #
2480
- # Allows a private object to be returned based on the entity_id and masheryid
2977
+ # Report on the value being added by Paint The Bridge
2481
2978
  #
2482
- # @param entity_id - The entity associated with the private object
2979
+ # @param country - the country to get the runrate for
2980
+ # @param year - the year to examine
2981
+ # @param month - the month to examine
2982
+ # @param day - the day to examine
2483
2983
  # @return - the data from the api
2484
2984
  #
2485
- def getPrivate_objectAll( entity_id)
2985
+ def getPtbValueadded( country, year, month, day)
2486
2986
  params = Hash.new
2487
- params['entity_id'] = entity_id
2488
- return doCurl("get","/private_object/all",params)
2987
+ params['country'] = country
2988
+ params['year'] = year
2989
+ params['month'] = month
2990
+ params['day'] = day
2991
+ return doCurl("get","/ptb/valueadded",params)
2489
2992
  end
2490
2993
 
2491
2994
 
@@ -2562,6 +3065,21 @@ class CentralIndex
2562
3065
  end
2563
3066
 
2564
3067
 
3068
+ #
3069
+ # Create a queue item
3070
+ #
3071
+ # @param queue_name
3072
+ # @param data
3073
+ # @return - the data from the api
3074
+ #
3075
+ def putQueue( queue_name, data)
3076
+ params = Hash.new
3077
+ params['queue_name'] = queue_name
3078
+ params['data'] = data
3079
+ return doCurl("put","/queue",params)
3080
+ end
3081
+
3082
+
2565
3083
  #
2566
3084
  # Retrieve queue items.
2567
3085
  #
@@ -2590,21 +3108,6 @@ class CentralIndex
2590
3108
  end
2591
3109
 
2592
3110
 
2593
- #
2594
- # Create a queue item
2595
- #
2596
- # @param queue_name
2597
- # @param data
2598
- # @return - the data from the api
2599
- #
2600
- def putQueue( queue_name, data)
2601
- params = Hash.new
2602
- params['queue_name'] = queue_name
2603
- params['data'] = data
2604
- return doCurl("put","/queue",params)
2605
- end
2606
-
2607
-
2608
3111
  #
2609
3112
  # Add an error to a queue item
2610
3113
  #
@@ -2650,10 +3153,24 @@ class CentralIndex
2650
3153
  end
2651
3154
 
2652
3155
 
3156
+ #
3157
+ # Return a sales log by id
3158
+ #
3159
+ # @param sales_log_id - The sales log id to pull
3160
+ # @return - the data from the api
3161
+ #
3162
+ def getSales_log( sales_log_id)
3163
+ params = Hash.new
3164
+ params['sales_log_id'] = sales_log_id
3165
+ return doCurl("get","/sales_log",params)
3166
+ end
3167
+
3168
+
2653
3169
  #
2654
3170
  # Log a sale
2655
3171
  #
2656
3172
  # @param entity_id - The entity the sale was made against
3173
+ # @param country - The country code the sales log orginated
2657
3174
  # @param action_type - The type of action we are performing
2658
3175
  # @param publisher_id - The publisher id that has made the sale
2659
3176
  # @param mashery_id - The mashery id
@@ -2666,9 +3183,10 @@ class CentralIndex
2666
3183
  # @param expiry_date - The date the product expires
2667
3184
  # @return - the data from the api
2668
3185
  #
2669
- def postSales_log( entity_id, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date)
3186
+ def postSales_log( entity_id, country, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date)
2670
3187
  params = Hash.new
2671
3188
  params['entity_id'] = entity_id
3189
+ params['country'] = country
2672
3190
  params['action_type'] = action_type
2673
3191
  params['publisher_id'] = publisher_id
2674
3192
  params['mashery_id'] = mashery_id
@@ -2686,13 +3204,32 @@ class CentralIndex
2686
3204
  #
2687
3205
  # Return a sales log by id
2688
3206
  #
2689
- # @param sales_log_id - The sales log id to pull
3207
+ # @param from_date
3208
+ # @param country
3209
+ # @param action_type
2690
3210
  # @return - the data from the api
2691
3211
  #
2692
- def getSales_log( sales_log_id)
3212
+ def getSales_logBy_countryBy_date( from_date, country, action_type)
2693
3213
  params = Hash.new
2694
- params['sales_log_id'] = sales_log_id
2695
- return doCurl("get","/sales_log",params)
3214
+ params['from_date'] = from_date
3215
+ params['country'] = country
3216
+ params['action_type'] = action_type
3217
+ return doCurl("get","/sales_log/by_country/by_date",params)
3218
+ end
3219
+
3220
+
3221
+ #
3222
+ # Return a sales log by id
3223
+ #
3224
+ # @param from_date
3225
+ # @param to_date
3226
+ # @return - the data from the api
3227
+ #
3228
+ def getSales_logBy_date( from_date, to_date)
3229
+ params = Hash.new
3230
+ params['from_date'] = from_date
3231
+ params['to_date'] = to_date
3232
+ return doCurl("get","/sales_log/by_date",params)
2696
3233
  end
2697
3234
 
2698
3235
 
@@ -2700,14 +3237,16 @@ class CentralIndex
2700
3237
  # For insance, reporting a phone number as wrong
2701
3238
  #
2702
3239
  # @param entity_id - A valid entity_id e.g. 379236608286720
3240
+ # @param country - The country code from where the signal originated e.g. ie
2703
3241
  # @param gen_id - The gen_id for the item being reported
2704
3242
  # @param signal_type - The signal that is to be reported e.g. wrong
2705
3243
  # @param data_type - The type of data being reported
2706
3244
  # @return - the data from the api
2707
3245
  #
2708
- def postSignal( entity_id, gen_id, signal_type, data_type)
3246
+ def postSignal( entity_id, country, gen_id, signal_type, data_type)
2709
3247
  params = Hash.new
2710
3248
  params['entity_id'] = entity_id
3249
+ params['country'] = country
2711
3250
  params['gen_id'] = gen_id
2712
3251
  params['signal_type'] = signal_type
2713
3252
  params['data_type'] = data_type
@@ -2732,6 +3271,21 @@ class CentralIndex
2732
3271
  end
2733
3272
 
2734
3273
 
3274
+ #
3275
+ # Get the stats on an entity in a given year
3276
+ #
3277
+ # @param entity_id - A valid entity_id e.g. 379236608286720
3278
+ # @param year - The year to report on
3279
+ # @return - the data from the api
3280
+ #
3281
+ def getStatsEntityBy_year( entity_id, year)
3282
+ params = Hash.new
3283
+ params['entity_id'] = entity_id
3284
+ params['year'] = year
3285
+ return doCurl("get","/stats/entity/by_year",params)
3286
+ end
3287
+
3288
+
2735
3289
  #
2736
3290
  # Confirms that the API is active, and returns the current version number
2737
3291
  #
@@ -2749,13 +3303,15 @@ class CentralIndex
2749
3303
  # @param language - The language to use to render the add path e.g. en
2750
3304
  # @param portal_name - The name of the website that data is to be added on e.g. YourLocal
2751
3305
  # @param country - The country of the entity to be added e.g. gb
3306
+ # @param flatpack_id - The id of the flatpack site where the request originated
2752
3307
  # @return - the data from the api
2753
3308
  #
2754
- def getTokenAdd( language, portal_name, country)
3309
+ def getTokenAdd( language, portal_name, country, flatpack_id)
2755
3310
  params = Hash.new
2756
3311
  params['language'] = language
2757
3312
  params['portal_name'] = portal_name
2758
3313
  params['country'] = country
3314
+ params['flatpack_id'] = flatpack_id
2759
3315
  return doCurl("get","/token/add",params)
2760
3316
  end
2761
3317
 
@@ -2766,13 +3322,15 @@ class CentralIndex
2766
3322
  # @param entity_id - Entity ID to be claimed e.g. 380348266819584
2767
3323
  # @param language - The language to use to render the claim path e.g. en
2768
3324
  # @param portal_name - The name of the website that entity is being claimed on e.g. YourLocal
3325
+ # @param flatpack_id - The id of the flatpack site where the request originated
2769
3326
  # @return - the data from the api
2770
3327
  #
2771
- def getTokenClaim( entity_id, language, portal_name)
3328
+ def getTokenClaim( entity_id, language, portal_name, flatpack_id)
2772
3329
  params = Hash.new
2773
3330
  params['entity_id'] = entity_id
2774
3331
  params['language'] = language
2775
3332
  params['portal_name'] = portal_name
3333
+ params['flatpack_id'] = flatpack_id
2776
3334
  return doCurl("get","/token/claim",params)
2777
3335
  end
2778
3336
 
@@ -2790,17 +3348,38 @@ class CentralIndex
2790
3348
  end
2791
3349
 
2792
3350
 
3351
+ #
3352
+ # Fetch token for edit path
3353
+ #
3354
+ # @param entity_id - The id of the entity being upgraded
3355
+ # @param language - The language for the app
3356
+ # @param flatpack_id - The id of the flatpack site where the request originated
3357
+ # @param edit_page - the page in the edit path that the user should land on
3358
+ # @return - the data from the api
3359
+ #
3360
+ def getTokenEdit( entity_id, language, flatpack_id, edit_page)
3361
+ params = Hash.new
3362
+ params['entity_id'] = entity_id
3363
+ params['language'] = language
3364
+ params['flatpack_id'] = flatpack_id
3365
+ params['edit_page'] = edit_page
3366
+ return doCurl("get","/token/edit",params)
3367
+ end
3368
+
3369
+
2793
3370
  #
2794
3371
  # Fetch token for login path
2795
3372
  #
2796
3373
  # @param portal_name - The name of the application that has initiated the login process, example: 'Your Local'
2797
3374
  # @param language - The language for the app
3375
+ # @param flatpack_id - The id of the flatpack site where the request originated
2798
3376
  # @return - the data from the api
2799
3377
  #
2800
- def getTokenLogin( portal_name, language)
3378
+ def getTokenLogin( portal_name, language, flatpack_id)
2801
3379
  params = Hash.new
2802
3380
  params['portal_name'] = portal_name
2803
3381
  params['language'] = language
3382
+ params['flatpack_id'] = flatpack_id
2804
3383
  return doCurl("get","/token/login",params)
2805
3384
  end
2806
3385
 
@@ -2811,13 +3390,15 @@ class CentralIndex
2811
3390
  # @param entity_id - The id of the entity being messaged
2812
3391
  # @param portal_name - The name of the application that has initiated the email process, example: 'Your Local'
2813
3392
  # @param language - The language for the app
3393
+ # @param flatpack_id - The id of the flatpack site where the request originated
2814
3394
  # @return - the data from the api
2815
3395
  #
2816
- def getTokenMessage( entity_id, portal_name, language)
3396
+ def getTokenMessage( entity_id, portal_name, language, flatpack_id)
2817
3397
  params = Hash.new
2818
3398
  params['entity_id'] = entity_id
2819
3399
  params['portal_name'] = portal_name
2820
3400
  params['language'] = language
3401
+ params['flatpack_id'] = flatpack_id
2821
3402
  return doCurl("get","/token/message",params)
2822
3403
  end
2823
3404
 
@@ -2828,13 +3409,15 @@ class CentralIndex
2828
3409
  # @param entity_id - The unique Entity ID e.g. 379236608286720
2829
3410
  # @param portal_name - The name of the portal that the user is coming from e.g. YourLocal
2830
3411
  # @param language - The language to use to render the report path
3412
+ # @param flatpack_id - The id of the flatpack site where the request originated
2831
3413
  # @return - the data from the api
2832
3414
  #
2833
- def getTokenReport( entity_id, portal_name, language)
3415
+ def getTokenReport( entity_id, portal_name, language, flatpack_id)
2834
3416
  params = Hash.new
2835
3417
  params['entity_id'] = entity_id
2836
3418
  params['portal_name'] = portal_name
2837
3419
  params['language'] = language
3420
+ params['flatpack_id'] = flatpack_id
2838
3421
  return doCurl("get","/token/report",params)
2839
3422
  end
2840
3423
 
@@ -2850,9 +3433,10 @@ class CentralIndex
2850
3433
  # @param max_locations - The number of locations attached to the advert
2851
3434
  # @param contract_length - The number of days from the initial sale date that the contract is valid for
2852
3435
  # @param ref_id - The campaign or reference id
3436
+ # @param flatpack_id - The id of the flatpack site where the request originated
2853
3437
  # @return - the data from the api
2854
3438
  #
2855
- def getTokenUpgrade( entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id)
3439
+ def getTokenUpgrade( entity_id, portal_name, language, price, max_tags, max_locations, contract_length, ref_id, flatpack_id)
2856
3440
  params = Hash.new
2857
3441
  params['entity_id'] = entity_id
2858
3442
  params['portal_name'] = portal_name
@@ -2862,6 +3446,7 @@ class CentralIndex
2862
3446
  params['max_locations'] = max_locations
2863
3447
  params['contract_length'] = contract_length
2864
3448
  params['ref_id'] = ref_id
3449
+ params['flatpack_id'] = flatpack_id
2865
3450
  return doCurl("get","/token/upgrade",params)
2866
3451
  end
2867
3452
 
@@ -2957,6 +3542,21 @@ class CentralIndex
2957
3542
  end
2958
3543
 
2959
3544
 
3545
+ #
3546
+ # Given some image data we can resize and upload the images
3547
+ #
3548
+ # @param filedata - The image data to upload and resize
3549
+ # @param type - The type of image to upload and resize
3550
+ # @return - the data from the api
3551
+ #
3552
+ def postToolsImage( filedata, type)
3553
+ params = Hash.new
3554
+ params['filedata'] = filedata
3555
+ params['type'] = type
3556
+ return doCurl("post","/tools/image",params)
3557
+ end
3558
+
3559
+
2960
3560
  #
2961
3561
  # Generate JSON in the format to generate Mashery's IODocs
2962
3562
  #
@@ -2995,15 +3595,15 @@ class CentralIndex
2995
3595
  # @param to - The phone number to verify
2996
3596
  # @param from - The phone number to call from
2997
3597
  # @param pin - The pin to verify the phone number with
2998
- # @param language - The language to read the verification in
3598
+ # @param twilio_voice - The language to read the verification in
2999
3599
  # @return - the data from the api
3000
3600
  #
3001
- def getToolsPhonecallVerify( to, from, pin, language)
3601
+ def getToolsPhonecallVerify( to, from, pin, twilio_voice)
3002
3602
  params = Hash.new
3003
3603
  params['to'] = to
3004
3604
  params['from'] = from
3005
3605
  params['pin'] = pin
3006
- params['language'] = language
3606
+ params['twilio_voice'] = twilio_voice
3007
3607
  return doCurl("get","/tools/phonecall/verify",params)
3008
3608
  end
3009
3609
 
@@ -3147,15 +3747,41 @@ class CentralIndex
3147
3747
 
3148
3748
 
3149
3749
  #
3150
- # Fetching a traction
3750
+ # Update/Add a traction
3151
3751
  #
3152
3752
  # @param traction_id
3753
+ # @param trigger_type
3754
+ # @param action_type
3755
+ # @param country
3756
+ # @param email_addresses
3757
+ # @param title
3758
+ # @param body
3759
+ # @param api_method
3760
+ # @param api_url
3761
+ # @param api_params
3762
+ # @param active
3763
+ # @param reseller_masheryid
3764
+ # @param publisher_masheryid
3765
+ # @param description
3153
3766
  # @return - the data from the api
3154
3767
  #
3155
- def getTraction( traction_id)
3768
+ def postTraction( traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active, reseller_masheryid, publisher_masheryid, description)
3156
3769
  params = Hash.new
3157
3770
  params['traction_id'] = traction_id
3158
- return doCurl("get","/traction",params)
3771
+ params['trigger_type'] = trigger_type
3772
+ params['action_type'] = action_type
3773
+ params['country'] = country
3774
+ params['email_addresses'] = email_addresses
3775
+ params['title'] = title
3776
+ params['body'] = body
3777
+ params['api_method'] = api_method
3778
+ params['api_url'] = api_url
3779
+ params['api_params'] = api_params
3780
+ params['active'] = active
3781
+ params['reseller_masheryid'] = reseller_masheryid
3782
+ params['publisher_masheryid'] = publisher_masheryid
3783
+ params['description'] = description
3784
+ return doCurl("post","/traction",params)
3159
3785
  end
3160
3786
 
3161
3787
 
@@ -3173,35 +3799,15 @@ class CentralIndex
3173
3799
 
3174
3800
 
3175
3801
  #
3176
- # Update/Add a traction
3802
+ # Fetching a traction
3177
3803
  #
3178
3804
  # @param traction_id
3179
- # @param trigger_type
3180
- # @param action_type
3181
- # @param country
3182
- # @param email_addresses
3183
- # @param title
3184
- # @param body
3185
- # @param api_method
3186
- # @param api_url
3187
- # @param api_params
3188
- # @param active
3189
3805
  # @return - the data from the api
3190
3806
  #
3191
- def postTraction( traction_id, trigger_type, action_type, country, email_addresses, title, body, api_method, api_url, api_params, active)
3807
+ def getTraction( traction_id)
3192
3808
  params = Hash.new
3193
3809
  params['traction_id'] = traction_id
3194
- params['trigger_type'] = trigger_type
3195
- params['action_type'] = action_type
3196
- params['country'] = country
3197
- params['email_addresses'] = email_addresses
3198
- params['title'] = title
3199
- params['body'] = body
3200
- params['api_method'] = api_method
3201
- params['api_url'] = api_url
3202
- params['api_params'] = api_params
3203
- params['active'] = active
3204
- return doCurl("post","/traction",params)
3810
+ return doCurl("get","/traction",params)
3205
3811
  end
3206
3812
 
3207
3813
 
@@ -3327,23 +3933,11 @@ class CentralIndex
3327
3933
  end
3328
3934
 
3329
3935
 
3330
- #
3331
- # With a unique ID address an user can be retrieved
3332
- #
3333
- # @param user_id
3334
- # @return - the data from the api
3335
- #
3336
- def getUser( user_id)
3337
- params = Hash.new
3338
- params['user_id'] = user_id
3339
- return doCurl("get","/user",params)
3340
- end
3341
-
3342
-
3343
3936
  #
3344
3937
  # Update user based on email address or social_network/social_network_id
3345
3938
  #
3346
3939
  # @param email
3940
+ # @param user_id
3347
3941
  # @param first_name
3348
3942
  # @param last_name
3349
3943
  # @param active
@@ -3353,11 +3947,14 @@ class CentralIndex
3353
3947
  # @param social_network
3354
3948
  # @param social_network_id
3355
3949
  # @param reseller_admin_masheryid
3950
+ # @param group_id
3951
+ # @param admin_upgrader
3356
3952
  # @return - the data from the api
3357
3953
  #
3358
- def postUser( email, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid)
3954
+ def postUser( email, user_id, first_name, last_name, active, trust, creation_date, user_type, social_network, social_network_id, reseller_admin_masheryid, group_id, admin_upgrader)
3359
3955
  params = Hash.new
3360
3956
  params['email'] = email
3957
+ params['user_id'] = user_id
3361
3958
  params['first_name'] = first_name
3362
3959
  params['last_name'] = last_name
3363
3960
  params['active'] = active
@@ -3367,10 +3964,25 @@ class CentralIndex
3367
3964
  params['social_network'] = social_network
3368
3965
  params['social_network_id'] = social_network_id
3369
3966
  params['reseller_admin_masheryid'] = reseller_admin_masheryid
3967
+ params['group_id'] = group_id
3968
+ params['admin_upgrader'] = admin_upgrader
3370
3969
  return doCurl("post","/user",params)
3371
3970
  end
3372
3971
 
3373
3972
 
3973
+ #
3974
+ # With a unique ID address an user can be retrieved
3975
+ #
3976
+ # @param user_id
3977
+ # @return - the data from the api
3978
+ #
3979
+ def getUser( user_id)
3980
+ params = Hash.new
3981
+ params['user_id'] = user_id
3982
+ return doCurl("get","/user",params)
3983
+ end
3984
+
3985
+
3374
3986
  #
3375
3987
  # With a unique email address an user can be retrieved
3376
3988
  #
@@ -3384,6 +3996,19 @@ class CentralIndex
3384
3996
  end
3385
3997
 
3386
3998
 
3999
+ #
4000
+ # Returns all the users that match the supplied group_id
4001
+ #
4002
+ # @param group_id
4003
+ # @return - the data from the api
4004
+ #
4005
+ def getUserBy_groupid( group_id)
4006
+ params = Hash.new
4007
+ params['group_id'] = group_id
4008
+ return doCurl("get","/user/by_groupid",params)
4009
+ end
4010
+
4011
+
3387
4012
  #
3388
4013
  # Returns all the users that match the supplied reseller_admin_masheryid
3389
4014
  #
@@ -3412,6 +4037,19 @@ class CentralIndex
3412
4037
  end
3413
4038
 
3414
4039
 
4040
+ #
4041
+ # Removes group_admin privileges from a specified user
4042
+ #
4043
+ # @param user_id
4044
+ # @return - the data from the api
4045
+ #
4046
+ def postUserGroup_admin_remove( user_id)
4047
+ params = Hash.new
4048
+ params['user_id'] = user_id
4049
+ return doCurl("post","/user/group_admin_remove",params)
4050
+ end
4051
+
4052
+
3415
4053
  #
3416
4054
  # Removes reseller privileges from a specified user
3417
4055
  #
@@ -3425,5 +4063,24 @@ class CentralIndex
3425
4063
  end
3426
4064
 
3427
4065
 
4066
+ #
4067
+ # Shows what would be emitted by a view, given a document
4068
+ #
4069
+ # @param database - the database being worked on e.g. entities
4070
+ # @param designdoc - the design document containing the view e.g. _design/report
4071
+ # @param view - the name of the view to be tested e.g. bydate
4072
+ # @param doc - the JSON document to be analysed e.g. {}
4073
+ # @return - the data from the api
4074
+ #
4075
+ def getViewhelper( database, designdoc, view, doc)
4076
+ params = Hash.new
4077
+ params['database'] = database
4078
+ params['designdoc'] = designdoc
4079
+ params['view'] = view
4080
+ params['doc'] = doc
4081
+ return doCurl("get","/viewhelper",params)
4082
+ end
4083
+
4084
+
3428
4085
  end
3429
4086