centralindex 0.0.14 → 0.0.15

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 +458 -307
  2. metadata +2 -2
data/lib/CentralIndex.rb CHANGED
@@ -59,6 +59,54 @@ class CentralIndex
59
59
  end
60
60
 
61
61
 
62
+ #
63
+ # Get the activity from the collection
64
+ #
65
+ # @param type - The activity type
66
+ # @param country - The country to filter by
67
+ # @param latitude_1 - The latitude_1 to filter by
68
+ # @param longitude_1 - The longitude_1 to filter by
69
+ # @param latitude_2 - The latitude_2 to filter by
70
+ # @param longitude_2 - The longitude_2 to filter by
71
+ # @param number_results - The number_results to filter by
72
+ # @return - the data from the api
73
+ #
74
+ def getActivity_stream( type, country, latitude_1, longitude_1, latitude_2, longitude_2, number_results)
75
+ params = Hash.new
76
+ params['type'] = type
77
+ params['country'] = country
78
+ params['latitude_1'] = latitude_1
79
+ params['longitude_1'] = longitude_1
80
+ params['latitude_2'] = latitude_2
81
+ params['longitude_2'] = longitude_2
82
+ params['number_results'] = number_results
83
+ return doCurl("get","/activity_stream",params)
84
+ end
85
+
86
+
87
+ #
88
+ # When we get some activity make a record of it
89
+ #
90
+ # @param entity_id - The entity to pull
91
+ # @param entity_name - The entity name this entry refers to
92
+ # @param type - The activity type
93
+ # @param country - The country for the activity
94
+ # @param longitude - The longitude for teh activity
95
+ # @param latitude - The latitude for teh activity
96
+ # @return - the data from the api
97
+ #
98
+ def postActivity_stream( entity_id, entity_name, type, country, longitude, latitude)
99
+ params = Hash.new
100
+ params['entity_id'] = entity_id
101
+ params['entity_name'] = entity_name
102
+ params['type'] = type
103
+ params['country'] = country
104
+ params['longitude'] = longitude
105
+ params['latitude'] = latitude
106
+ return doCurl("post","/activity_stream",params)
107
+ end
108
+
109
+
62
110
  #
63
111
  # Get all advertisers that have been updated from a give date for a given reseller
64
112
  #
@@ -212,19 +260,6 @@ class CentralIndex
212
260
  end
213
261
 
214
262
 
215
- #
216
- # Delete a business tool with a specified tool_id
217
- #
218
- # @param tool_id
219
- # @return - the data from the api
220
- #
221
- def deleteBusiness_tool( tool_id)
222
- params = Hash.new
223
- params['tool_id'] = tool_id
224
- return doCurl("delete","/business_tool",params)
225
- end
226
-
227
-
228
263
  #
229
264
  # Update/Add a Business Tool
230
265
  #
@@ -248,6 +283,19 @@ class CentralIndex
248
283
  end
249
284
 
250
285
 
286
+ #
287
+ # Delete a business tool with a specified tool_id
288
+ #
289
+ # @param tool_id
290
+ # @return - the data from the api
291
+ #
292
+ def deleteBusiness_tool( tool_id)
293
+ params = Hash.new
294
+ params['tool_id'] = tool_id
295
+ return doCurl("delete","/business_tool",params)
296
+ end
297
+
298
+
251
299
  #
252
300
  # Returns business tool that matches a given tool id
253
301
  #
@@ -382,36 +430,36 @@ class CentralIndex
382
430
 
383
431
 
384
432
  #
385
- # With a known category id, an synonym object can be added.
433
+ # With a known category id, a synonyms object can be removed.
386
434
  #
387
435
  # @param category_id
388
436
  # @param synonym
389
437
  # @param language
390
438
  # @return - the data from the api
391
439
  #
392
- def postCategorySynonym( category_id, synonym, language)
440
+ def deleteCategorySynonym( category_id, synonym, language)
393
441
  params = Hash.new
394
442
  params['category_id'] = category_id
395
443
  params['synonym'] = synonym
396
444
  params['language'] = language
397
- return doCurl("post","/category/synonym",params)
445
+ return doCurl("delete","/category/synonym",params)
398
446
  end
399
447
 
400
448
 
401
449
  #
402
- # With a known category id, a synonyms object can be removed.
450
+ # With a known category id, an synonym object can be added.
403
451
  #
404
452
  # @param category_id
405
453
  # @param synonym
406
454
  # @param language
407
455
  # @return - the data from the api
408
456
  #
409
- def deleteCategorySynonym( category_id, synonym, language)
457
+ def postCategorySynonym( category_id, synonym, language)
410
458
  params = Hash.new
411
459
  params['category_id'] = category_id
412
460
  params['synonym'] = synonym
413
461
  params['language'] = language
414
- return doCurl("delete","/category/synonym",params)
462
+ return doCurl("post","/category/synonym",params)
415
463
  end
416
464
 
417
465
 
@@ -779,6 +827,21 @@ class CentralIndex
779
827
  end
780
828
 
781
829
 
830
+ #
831
+ # Allows an affiliate link object to be reduced in confidence
832
+ #
833
+ # @param entity_id
834
+ # @param gen_id
835
+ # @return - the data from the api
836
+ #
837
+ def deleteEntityAffiliate_link( entity_id, gen_id)
838
+ params = Hash.new
839
+ params['entity_id'] = entity_id
840
+ params['gen_id'] = gen_id
841
+ return doCurl("delete","/entity/affiliate_link",params)
842
+ end
843
+
844
+
782
845
  #
783
846
  # With a known entity id, an affiliate link object can be added.
784
847
  #
@@ -800,21 +863,6 @@ class CentralIndex
800
863
  end
801
864
 
802
865
 
803
- #
804
- # Allows an affiliate link object to be reduced in confidence
805
- #
806
- # @param entity_id
807
- # @param gen_id
808
- # @return - the data from the api
809
- #
810
- def deleteEntityAffiliate_link( entity_id, gen_id)
811
- params = Hash.new
812
- params['entity_id'] = entity_id
813
- params['gen_id'] = gen_id
814
- return doCurl("delete","/entity/affiliate_link",params)
815
- end
816
-
817
-
818
866
  #
819
867
  # With a known entity id, an background object can be added. There can however only be one background object.
820
868
  #
@@ -932,34 +980,34 @@ class CentralIndex
932
980
 
933
981
 
934
982
  #
935
- # Allows a category object to be reduced in confidence
983
+ # With a known entity id, an category object can be added.
936
984
  #
937
985
  # @param entity_id
938
- # @param gen_id
986
+ # @param category_id
987
+ # @param category_type
939
988
  # @return - the data from the api
940
989
  #
941
- def deleteEntityCategory( entity_id, gen_id)
990
+ def postEntityCategory( entity_id, category_id, category_type)
942
991
  params = Hash.new
943
992
  params['entity_id'] = entity_id
944
- params['gen_id'] = gen_id
945
- return doCurl("delete","/entity/category",params)
993
+ params['category_id'] = category_id
994
+ params['category_type'] = category_type
995
+ return doCurl("post","/entity/category",params)
946
996
  end
947
997
 
948
998
 
949
999
  #
950
- # With a known entity id, an category object can be added.
1000
+ # Allows a category object to be reduced in confidence
951
1001
  #
952
1002
  # @param entity_id
953
- # @param category_id
954
- # @param category_type
1003
+ # @param gen_id
955
1004
  # @return - the data from the api
956
1005
  #
957
- def postEntityCategory( entity_id, category_id, category_type)
1006
+ def deleteEntityCategory( entity_id, gen_id)
958
1007
  params = Hash.new
959
1008
  params['entity_id'] = entity_id
960
- params['category_id'] = category_id
961
- params['category_type'] = category_type
962
- return doCurl("post","/entity/category",params)
1009
+ params['gen_id'] = gen_id
1010
+ return doCurl("delete","/entity/category",params)
963
1011
  end
964
1012
 
965
1013
 
@@ -1066,34 +1114,34 @@ class CentralIndex
1066
1114
 
1067
1115
 
1068
1116
  #
1069
- # With a known entity id, an email address object can be added.
1117
+ # Allows a email object to be reduced in confidence
1070
1118
  #
1071
1119
  # @param entity_id
1072
- # @param email_address
1073
- # @param email_description
1120
+ # @param gen_id
1074
1121
  # @return - the data from the api
1075
1122
  #
1076
- def postEntityEmail( entity_id, email_address, email_description)
1123
+ def deleteEntityEmail( entity_id, gen_id)
1077
1124
  params = Hash.new
1078
1125
  params['entity_id'] = entity_id
1079
- params['email_address'] = email_address
1080
- params['email_description'] = email_description
1081
- return doCurl("post","/entity/email",params)
1126
+ params['gen_id'] = gen_id
1127
+ return doCurl("delete","/entity/email",params)
1082
1128
  end
1083
1129
 
1084
1130
 
1085
1131
  #
1086
- # Allows a email object to be reduced in confidence
1132
+ # With a known entity id, an email address object can be added.
1087
1133
  #
1088
1134
  # @param entity_id
1089
- # @param gen_id
1135
+ # @param email_address
1136
+ # @param email_description
1090
1137
  # @return - the data from the api
1091
1138
  #
1092
- def deleteEntityEmail( entity_id, gen_id)
1139
+ def postEntityEmail( entity_id, email_address, email_description)
1093
1140
  params = Hash.new
1094
1141
  params['entity_id'] = entity_id
1095
- params['gen_id'] = gen_id
1096
- return doCurl("delete","/entity/email",params)
1142
+ params['email_address'] = email_address
1143
+ params['email_description'] = email_description
1144
+ return doCurl("post","/entity/email",params)
1097
1145
  end
1098
1146
 
1099
1147
 
@@ -1140,34 +1188,34 @@ class CentralIndex
1140
1188
 
1141
1189
 
1142
1190
  #
1143
- # Allows a fax object to be reduced in confidence
1191
+ # With a known entity id, an fax object can be added.
1144
1192
  #
1145
1193
  # @param entity_id
1146
- # @param gen_id
1194
+ # @param number
1195
+ # @param description
1147
1196
  # @return - the data from the api
1148
1197
  #
1149
- def deleteEntityFax( entity_id, gen_id)
1198
+ def postEntityFax( entity_id, number, description)
1150
1199
  params = Hash.new
1151
1200
  params['entity_id'] = entity_id
1152
- params['gen_id'] = gen_id
1153
- return doCurl("delete","/entity/fax",params)
1201
+ params['number'] = number
1202
+ params['description'] = description
1203
+ return doCurl("post","/entity/fax",params)
1154
1204
  end
1155
1205
 
1156
1206
 
1157
1207
  #
1158
- # With a known entity id, an fax object can be added.
1208
+ # Allows a fax object to be reduced in confidence
1159
1209
  #
1160
1210
  # @param entity_id
1161
- # @param number
1162
- # @param description
1211
+ # @param gen_id
1163
1212
  # @return - the data from the api
1164
1213
  #
1165
- def postEntityFax( entity_id, number, description)
1214
+ def deleteEntityFax( entity_id, gen_id)
1166
1215
  params = Hash.new
1167
1216
  params['entity_id'] = entity_id
1168
- params['number'] = number
1169
- params['description'] = description
1170
- return doCurl("post","/entity/fax",params)
1217
+ params['gen_id'] = gen_id
1218
+ return doCurl("delete","/entity/fax",params)
1171
1219
  end
1172
1220
 
1173
1221
 
@@ -1190,21 +1238,6 @@ class CentralIndex
1190
1238
  end
1191
1239
 
1192
1240
 
1193
- #
1194
- # With a known entity id, a group can be added to group members.
1195
- #
1196
- # @param entity_id
1197
- # @param group_id
1198
- # @return - the data from the api
1199
- #
1200
- def postEntityGroup( entity_id, group_id)
1201
- params = Hash.new
1202
- params['entity_id'] = entity_id
1203
- params['group_id'] = group_id
1204
- return doCurl("post","/entity/group",params)
1205
- end
1206
-
1207
-
1208
1241
  #
1209
1242
  # Allows a group object to be removed from an entities group members
1210
1243
  #
@@ -1221,19 +1254,17 @@ class CentralIndex
1221
1254
 
1222
1255
 
1223
1256
  #
1224
- # With a known entity id, a image object can be added.
1257
+ # With a known entity id, a group can be added to group members.
1225
1258
  #
1226
1259
  # @param entity_id
1227
- # @param filedata
1228
- # @param image_name
1260
+ # @param group_id
1229
1261
  # @return - the data from the api
1230
1262
  #
1231
- def postEntityImage( entity_id, filedata, image_name)
1263
+ def postEntityGroup( entity_id, group_id)
1232
1264
  params = Hash.new
1233
1265
  params['entity_id'] = entity_id
1234
- params['filedata'] = filedata
1235
- params['image_name'] = image_name
1236
- return doCurl("post","/entity/image",params)
1266
+ params['group_id'] = group_id
1267
+ return doCurl("post","/entity/group",params)
1237
1268
  end
1238
1269
 
1239
1270
 
@@ -1253,15 +1284,19 @@ class CentralIndex
1253
1284
 
1254
1285
 
1255
1286
  #
1256
- # With a known entity id and a known invoice_address ID, we can delete a specific invoice_address object from an enitity.
1287
+ # With a known entity id, a image object can be added.
1257
1288
  #
1258
1289
  # @param entity_id
1290
+ # @param filedata
1291
+ # @param image_name
1259
1292
  # @return - the data from the api
1260
1293
  #
1261
- def deleteEntityInvoice_address( entity_id)
1294
+ def postEntityImage( entity_id, filedata, image_name)
1262
1295
  params = Hash.new
1263
1296
  params['entity_id'] = entity_id
1264
- return doCurl("delete","/entity/invoice_address",params)
1297
+ params['filedata'] = filedata
1298
+ params['image_name'] = image_name
1299
+ return doCurl("post","/entity/image",params)
1265
1300
  end
1266
1301
 
1267
1302
 
@@ -1299,17 +1334,15 @@ class CentralIndex
1299
1334
 
1300
1335
 
1301
1336
  #
1302
- # Allows a list description object to be reduced in confidence
1337
+ # With a known entity id and a known invoice_address ID, we can delete a specific invoice_address object from an enitity.
1303
1338
  #
1304
- # @param gen_id
1305
1339
  # @param entity_id
1306
1340
  # @return - the data from the api
1307
1341
  #
1308
- def deleteEntityList( gen_id, entity_id)
1342
+ def deleteEntityInvoice_address( entity_id)
1309
1343
  params = Hash.new
1310
- params['gen_id'] = gen_id
1311
1344
  params['entity_id'] = entity_id
1312
- return doCurl("delete","/entity/list",params)
1345
+ return doCurl("delete","/entity/invoice_address",params)
1313
1346
  end
1314
1347
 
1315
1348
 
@@ -1331,19 +1364,17 @@ class CentralIndex
1331
1364
 
1332
1365
 
1333
1366
  #
1334
- # With a known entity id, a logo object can be added.
1367
+ # Allows a list description object to be reduced in confidence
1335
1368
  #
1369
+ # @param gen_id
1336
1370
  # @param entity_id
1337
- # @param filedata
1338
- # @param logo_name
1339
1371
  # @return - the data from the api
1340
1372
  #
1341
- def postEntityLogo( entity_id, filedata, logo_name)
1373
+ def deleteEntityList( gen_id, entity_id)
1342
1374
  params = Hash.new
1375
+ params['gen_id'] = gen_id
1343
1376
  params['entity_id'] = entity_id
1344
- params['filedata'] = filedata
1345
- params['logo_name'] = logo_name
1346
- return doCurl("post","/entity/logo",params)
1377
+ return doCurl("delete","/entity/list",params)
1347
1378
  end
1348
1379
 
1349
1380
 
@@ -1362,6 +1393,23 @@ class CentralIndex
1362
1393
  end
1363
1394
 
1364
1395
 
1396
+ #
1397
+ # With a known entity id, a logo object can be added.
1398
+ #
1399
+ # @param entity_id
1400
+ # @param filedata
1401
+ # @param logo_name
1402
+ # @return - the data from the api
1403
+ #
1404
+ def postEntityLogo( entity_id, filedata, logo_name)
1405
+ params = Hash.new
1406
+ params['entity_id'] = entity_id
1407
+ params['filedata'] = filedata
1408
+ params['logo_name'] = logo_name
1409
+ return doCurl("post","/entity/logo",params)
1410
+ end
1411
+
1412
+
1365
1413
  #
1366
1414
  # Merge two entities into one
1367
1415
  #
@@ -1464,34 +1512,34 @@ class CentralIndex
1464
1512
 
1465
1513
 
1466
1514
  #
1467
- # Allows a phone object to be reduced in confidence
1515
+ # 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.
1468
1516
  #
1469
1517
  # @param entity_id
1470
- # @param gen_id
1518
+ # @param number
1519
+ # @param description
1471
1520
  # @return - the data from the api
1472
1521
  #
1473
- def deleteEntityPhone( entity_id, gen_id)
1522
+ def postEntityPhone( entity_id, number, description)
1474
1523
  params = Hash.new
1475
1524
  params['entity_id'] = entity_id
1476
- params['gen_id'] = gen_id
1477
- return doCurl("delete","/entity/phone",params)
1525
+ params['number'] = number
1526
+ params['description'] = description
1527
+ return doCurl("post","/entity/phone",params)
1478
1528
  end
1479
1529
 
1480
1530
 
1481
1531
  #
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.
1532
+ # Allows a phone object to be reduced in confidence
1483
1533
  #
1484
1534
  # @param entity_id
1485
- # @param number
1486
- # @param description
1535
+ # @param gen_id
1487
1536
  # @return - the data from the api
1488
1537
  #
1489
- def postEntityPhone( entity_id, number, description)
1538
+ def deleteEntityPhone( entity_id, gen_id)
1490
1539
  params = Hash.new
1491
1540
  params['entity_id'] = entity_id
1492
- params['number'] = number
1493
- params['description'] = description
1494
- return doCurl("post","/entity/phone",params)
1541
+ params['gen_id'] = gen_id
1542
+ return doCurl("delete","/entity/phone",params)
1495
1543
  end
1496
1544
 
1497
1545
 
@@ -1571,35 +1619,6 @@ class CentralIndex
1571
1619
  end
1572
1620
 
1573
1621
 
1574
- #
1575
- # Search for matching entities
1576
- #
1577
- # @param what
1578
- # @param entity_name
1579
- # @param where
1580
- # @param per_page
1581
- # @param page
1582
- # @param longitude
1583
- # @param latitude
1584
- # @param country
1585
- # @param language
1586
- # @return - the data from the api
1587
- #
1588
- def getEntitySearch( what, entity_name, where, per_page, page, longitude, latitude, country, language)
1589
- params = Hash.new
1590
- params['what'] = what
1591
- params['entity_name'] = entity_name
1592
- params['where'] = where
1593
- params['per_page'] = per_page
1594
- params['page'] = page
1595
- params['longitude'] = longitude
1596
- params['latitude'] = latitude
1597
- params['country'] = country
1598
- params['language'] = language
1599
- return doCurl("get","/entity/search",params)
1600
- end
1601
-
1602
-
1603
1622
  #
1604
1623
  # Search for matching entities
1605
1624
  #
@@ -1827,23 +1846,6 @@ class CentralIndex
1827
1846
  end
1828
1847
 
1829
1848
 
1830
- #
1831
- # With a known entity id, a social media object can be added.
1832
- #
1833
- # @param entity_id
1834
- # @param type
1835
- # @param website_url
1836
- # @return - the data from the api
1837
- #
1838
- def postEntitySocialmedia( entity_id, type, website_url)
1839
- params = Hash.new
1840
- params['entity_id'] = entity_id
1841
- params['type'] = type
1842
- params['website_url'] = website_url
1843
- return doCurl("post","/entity/socialmedia",params)
1844
- end
1845
-
1846
-
1847
1849
  #
1848
1850
  # Allows a social media object to be reduced in confidence
1849
1851
  #
@@ -1860,17 +1862,19 @@ class CentralIndex
1860
1862
 
1861
1863
 
1862
1864
  #
1863
- # Allows a special offer object to be reduced in confidence
1865
+ # With a known entity id, a social media object can be added.
1864
1866
  #
1865
1867
  # @param entity_id
1866
- # @param gen_id
1868
+ # @param type
1869
+ # @param website_url
1867
1870
  # @return - the data from the api
1868
1871
  #
1869
- def deleteEntitySpecial_offer( entity_id, gen_id)
1872
+ def postEntitySocialmedia( entity_id, type, website_url)
1870
1873
  params = Hash.new
1871
1874
  params['entity_id'] = entity_id
1872
- params['gen_id'] = gen_id
1873
- return doCurl("delete","/entity/special_offer",params)
1875
+ params['type'] = type
1876
+ params['website_url'] = website_url
1877
+ return doCurl("post","/entity/socialmedia",params)
1874
1878
  end
1875
1879
 
1876
1880
 
@@ -1901,17 +1905,36 @@ class CentralIndex
1901
1905
  end
1902
1906
 
1903
1907
 
1908
+ #
1909
+ # Allows a special offer object to be reduced in confidence
1910
+ #
1911
+ # @param entity_id
1912
+ # @param gen_id
1913
+ # @return - the data from the api
1914
+ #
1915
+ def deleteEntitySpecial_offer( entity_id, gen_id)
1916
+ params = Hash.new
1917
+ params['entity_id'] = entity_id
1918
+ params['gen_id'] = gen_id
1919
+ return doCurl("delete","/entity/special_offer",params)
1920
+ end
1921
+
1922
+
1904
1923
  #
1905
1924
  # With a known entity id, a status object can be updated.
1906
1925
  #
1907
1926
  # @param entity_id
1908
1927
  # @param status
1928
+ # @param inactive_reason
1929
+ # @param inactive_description
1909
1930
  # @return - the data from the api
1910
1931
  #
1911
- def postEntityStatus( entity_id, status)
1932
+ def postEntityStatus( entity_id, status, inactive_reason, inactive_description)
1912
1933
  params = Hash.new
1913
1934
  params['entity_id'] = entity_id
1914
1935
  params['status'] = status
1936
+ params['inactive_reason'] = inactive_reason
1937
+ params['inactive_description'] = inactive_description
1915
1938
  return doCurl("post","/entity/status",params)
1916
1939
  end
1917
1940
 
@@ -1948,21 +1971,6 @@ class CentralIndex
1948
1971
  end
1949
1972
 
1950
1973
 
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
-
1966
1974
  #
1967
1975
  # With a known entity id, a testimonial object can be added.
1968
1976
  #
@@ -1984,6 +1992,21 @@ class CentralIndex
1984
1992
  end
1985
1993
 
1986
1994
 
1995
+ #
1996
+ # Allows a testimonial object to be reduced in confidence
1997
+ #
1998
+ # @param entity_id
1999
+ # @param gen_id
2000
+ # @return - the data from the api
2001
+ #
2002
+ def deleteEntityTestimonial( entity_id, gen_id)
2003
+ params = Hash.new
2004
+ params['entity_id'] = entity_id
2005
+ params['gen_id'] = gen_id
2006
+ return doCurl("delete","/entity/testimonial",params)
2007
+ end
2008
+
2009
+
1987
2010
  #
1988
2011
  # Get the updates a uncontribute would perform
1989
2012
  #
@@ -2354,36 +2377,36 @@ class CentralIndex
2354
2377
 
2355
2378
 
2356
2379
  #
2357
- # Add a canned link to an existing flatpack site.
2380
+ # Remove a canned link to an existing flatpack site.
2358
2381
  #
2359
2382
  # @param flatpack_id - the id of the flatpack to delete
2360
- # @param keywords - the keywords to use in the canned search
2361
- # @param location - the location to use in the canned search
2362
- # @param linkText - the link text to be used to in the canned search link
2383
+ # @param gen_id - the id of the canned link to remove
2363
2384
  # @return - the data from the api
2364
2385
  #
2365
- def postFlatpackLink( flatpack_id, keywords, location, linkText)
2386
+ def deleteFlatpackLink( flatpack_id, gen_id)
2366
2387
  params = Hash.new
2367
2388
  params['flatpack_id'] = flatpack_id
2368
- params['keywords'] = keywords
2369
- params['location'] = location
2370
- params['linkText'] = linkText
2371
- return doCurl("post","/flatpack/link",params)
2389
+ params['gen_id'] = gen_id
2390
+ return doCurl("delete","/flatpack/link",params)
2372
2391
  end
2373
2392
 
2374
2393
 
2375
2394
  #
2376
- # Remove a canned link to an existing flatpack site.
2395
+ # Add a canned link to an existing flatpack site.
2377
2396
  #
2378
2397
  # @param flatpack_id - the id of the flatpack to delete
2379
- # @param gen_id - the id of the canned link to remove
2398
+ # @param keywords - the keywords to use in the canned search
2399
+ # @param location - the location to use in the canned search
2400
+ # @param linkText - the link text to be used to in the canned search link
2380
2401
  # @return - the data from the api
2381
2402
  #
2382
- def deleteFlatpackLink( flatpack_id, gen_id)
2403
+ def postFlatpackLink( flatpack_id, keywords, location, linkText)
2383
2404
  params = Hash.new
2384
2405
  params['flatpack_id'] = flatpack_id
2385
- params['gen_id'] = gen_id
2386
- return doCurl("delete","/flatpack/link",params)
2406
+ params['keywords'] = keywords
2407
+ params['location'] = location
2408
+ params['linkText'] = linkText
2409
+ return doCurl("post","/flatpack/link",params)
2387
2410
  end
2388
2411
 
2389
2412
 
@@ -2430,6 +2453,19 @@ class CentralIndex
2430
2453
  end
2431
2454
 
2432
2455
 
2456
+ #
2457
+ # Returns group that matches a given group id
2458
+ #
2459
+ # @param group_id
2460
+ # @return - the data from the api
2461
+ #
2462
+ def getGroup( group_id)
2463
+ params = Hash.new
2464
+ params['group_id'] = group_id
2465
+ return doCurl("get","/group",params)
2466
+ end
2467
+
2468
+
2433
2469
  #
2434
2470
  # Update/Add a Group
2435
2471
  #
@@ -2462,19 +2498,6 @@ class CentralIndex
2462
2498
  end
2463
2499
 
2464
2500
 
2465
- #
2466
- # Returns group that matches a given group id
2467
- #
2468
- # @param group_id
2469
- # @return - the data from the api
2470
- #
2471
- def getGroup( group_id)
2472
- params = Hash.new
2473
- params['group_id'] = group_id
2474
- return doCurl("get","/group",params)
2475
- end
2476
-
2477
-
2478
2501
  #
2479
2502
  # Bulk update entities with a specified group
2480
2503
  #
@@ -2538,30 +2561,30 @@ class CentralIndex
2538
2561
 
2539
2562
 
2540
2563
  #
2541
- # Get an ingest job from the collection
2564
+ # Add a ingest job to the collection
2542
2565
  #
2543
- # @param job_id
2566
+ # @param description
2567
+ # @param category_type
2544
2568
  # @return - the data from the api
2545
2569
  #
2546
- def getIngest_job( job_id)
2570
+ def postIngest_job( description, category_type)
2547
2571
  params = Hash.new
2548
- params['job_id'] = job_id
2549
- return doCurl("get","/ingest_job",params)
2572
+ params['description'] = description
2573
+ params['category_type'] = category_type
2574
+ return doCurl("post","/ingest_job",params)
2550
2575
  end
2551
2576
 
2552
2577
 
2553
2578
  #
2554
- # Add a ingest job to the collection
2579
+ # Get an ingest job from the collection
2555
2580
  #
2556
- # @param description
2557
- # @param category_type
2581
+ # @param job_id
2558
2582
  # @return - the data from the api
2559
2583
  #
2560
- def postIngest_job( description, category_type)
2584
+ def getIngest_job( job_id)
2561
2585
  params = Hash.new
2562
- params['description'] = description
2563
- params['category_type'] = category_type
2564
- return doCurl("post","/ingest_job",params)
2586
+ params['job_id'] = job_id
2587
+ return doCurl("get","/ingest_job",params)
2565
2588
  end
2566
2589
 
2567
2590
 
@@ -2865,30 +2888,30 @@ class CentralIndex
2865
2888
 
2866
2889
 
2867
2890
  #
2868
- # With a known entity id, a private object can be added.
2891
+ # Allows a private object to be removed
2869
2892
  #
2870
- # @param entity_id - The entity to associate the private object with
2871
- # @param data - The data to store
2893
+ # @param private_object_id - The id of the private object to remove
2872
2894
  # @return - the data from the api
2873
2895
  #
2874
- def putPrivate_object( entity_id, data)
2896
+ def deletePrivate_object( private_object_id)
2875
2897
  params = Hash.new
2876
- params['entity_id'] = entity_id
2877
- params['data'] = data
2878
- return doCurl("put","/private_object",params)
2898
+ params['private_object_id'] = private_object_id
2899
+ return doCurl("delete","/private_object",params)
2879
2900
  end
2880
2901
 
2881
2902
 
2882
2903
  #
2883
- # Allows a private object to be removed
2904
+ # With a known entity id, a private object can be added.
2884
2905
  #
2885
- # @param private_object_id - The id of the private object to remove
2906
+ # @param entity_id - The entity to associate the private object with
2907
+ # @param data - The data to store
2886
2908
  # @return - the data from the api
2887
2909
  #
2888
- def deletePrivate_object( private_object_id)
2910
+ def putPrivate_object( entity_id, data)
2889
2911
  params = Hash.new
2890
- params['private_object_id'] = private_object_id
2891
- return doCurl("delete","/private_object",params)
2912
+ params['entity_id'] = entity_id
2913
+ params['data'] = data
2914
+ return doCurl("put","/private_object",params)
2892
2915
  end
2893
2916
 
2894
2917
 
@@ -2945,10 +2968,10 @@ class CentralIndex
2945
2968
  # @param destructive
2946
2969
  # @return - the data from the api
2947
2970
  #
2948
- def getPtbModule( entity_id, module, destructive)
2971
+ def getPtbModule( entity_id, __module, destructive)
2949
2972
  params = Hash.new
2950
2973
  params['entity_id'] = entity_id
2951
- params['module'] = module
2974
+ params['module'] = __module
2952
2975
  params['destructive'] = destructive
2953
2976
  return doCurl("get","/ptb/module",params)
2954
2977
  end
@@ -2993,28 +3016,28 @@ class CentralIndex
2993
3016
 
2994
3017
 
2995
3018
  #
2996
- # Returns publisher that matches a given publisher id
3019
+ # Delete a publisher with a specified publisher_id
2997
3020
  #
2998
3021
  # @param publisher_id
2999
3022
  # @return - the data from the api
3000
3023
  #
3001
- def getPublisher( publisher_id)
3024
+ def deletePublisher( publisher_id)
3002
3025
  params = Hash.new
3003
3026
  params['publisher_id'] = publisher_id
3004
- return doCurl("get","/publisher",params)
3027
+ return doCurl("delete","/publisher",params)
3005
3028
  end
3006
3029
 
3007
3030
 
3008
3031
  #
3009
- # Delete a publisher with a specified publisher_id
3032
+ # Returns publisher that matches a given publisher id
3010
3033
  #
3011
3034
  # @param publisher_id
3012
3035
  # @return - the data from the api
3013
3036
  #
3014
- def deletePublisher( publisher_id)
3037
+ def getPublisher( publisher_id)
3015
3038
  params = Hash.new
3016
3039
  params['publisher_id'] = publisher_id
3017
- return doCurl("delete","/publisher",params)
3040
+ return doCurl("get","/publisher",params)
3018
3041
  end
3019
3042
 
3020
3043
 
@@ -3066,17 +3089,15 @@ class CentralIndex
3066
3089
 
3067
3090
 
3068
3091
  #
3069
- # Create a queue item
3092
+ # With a known queue id, a queue item can be removed.
3070
3093
  #
3071
- # @param queue_name
3072
- # @param data
3094
+ # @param queue_id
3073
3095
  # @return - the data from the api
3074
3096
  #
3075
- def putQueue( queue_name, data)
3097
+ def deleteQueue( queue_id)
3076
3098
  params = Hash.new
3077
- params['queue_name'] = queue_name
3078
- params['data'] = data
3079
- return doCurl("put","/queue",params)
3099
+ params['queue_id'] = queue_id
3100
+ return doCurl("delete","/queue",params)
3080
3101
  end
3081
3102
 
3082
3103
 
@@ -3096,15 +3117,17 @@ class CentralIndex
3096
3117
 
3097
3118
 
3098
3119
  #
3099
- # With a known queue id, a queue item can be removed.
3120
+ # Create a queue item
3100
3121
  #
3101
- # @param queue_id
3122
+ # @param queue_name
3123
+ # @param data
3102
3124
  # @return - the data from the api
3103
3125
  #
3104
- def deleteQueue( queue_id)
3126
+ def putQueue( queue_name, data)
3105
3127
  params = Hash.new
3106
- params['queue_id'] = queue_id
3107
- return doCurl("delete","/queue",params)
3128
+ params['queue_name'] = queue_name
3129
+ params['data'] = data
3130
+ return doCurl("put","/queue",params)
3108
3131
  end
3109
3132
 
3110
3133
 
@@ -3166,6 +3189,38 @@ class CentralIndex
3166
3189
  end
3167
3190
 
3168
3191
 
3192
+ #
3193
+ # Return a sales log by id
3194
+ #
3195
+ # @param from_date
3196
+ # @param country
3197
+ # @param action_type
3198
+ # @return - the data from the api
3199
+ #
3200
+ def getSales_logBy_countryBy_date( from_date, country, action_type)
3201
+ params = Hash.new
3202
+ params['from_date'] = from_date
3203
+ params['country'] = country
3204
+ params['action_type'] = action_type
3205
+ return doCurl("get","/sales_log/by_country/by_date",params)
3206
+ end
3207
+
3208
+
3209
+ #
3210
+ # Return a sales log by id
3211
+ #
3212
+ # @param from_date
3213
+ # @param to_date
3214
+ # @return - the data from the api
3215
+ #
3216
+ def getSales_logBy_date( from_date, to_date)
3217
+ params = Hash.new
3218
+ params['from_date'] = from_date
3219
+ params['to_date'] = to_date
3220
+ return doCurl("get","/sales_log/by_date",params)
3221
+ end
3222
+
3223
+
3169
3224
  #
3170
3225
  # Log a sale
3171
3226
  #
@@ -3183,7 +3238,7 @@ class CentralIndex
3183
3238
  # @param expiry_date - The date the product expires
3184
3239
  # @return - the data from the api
3185
3240
  #
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)
3241
+ def postSales_logEntity( entity_id, country, action_type, publisher_id, mashery_id, reseller_ref, reseller_agent_id, max_tags, max_locations, extra_tags, extra_locations, expiry_date)
3187
3242
  params = Hash.new
3188
3243
  params['entity_id'] = entity_id
3189
3244
  params['country'] = country
@@ -3197,39 +3252,38 @@ class CentralIndex
3197
3252
  params['extra_tags'] = extra_tags
3198
3253
  params['extra_locations'] = extra_locations
3199
3254
  params['expiry_date'] = expiry_date
3200
- return doCurl("post","/sales_log",params)
3255
+ return doCurl("post","/sales_log/entity",params)
3201
3256
  end
3202
3257
 
3203
3258
 
3204
3259
  #
3205
- # Return a sales log by id
3260
+ # Add a Sales Log document for a syndication action
3206
3261
  #
3207
- # @param from_date
3208
- # @param country
3209
3262
  # @param action_type
3263
+ # @param syndication_type
3264
+ # @param publisher_id
3265
+ # @param expiry_date
3266
+ # @param entity_id
3267
+ # @param group_id
3268
+ # @param seed_masheryid
3269
+ # @param supplier_masheryid
3270
+ # @param country
3271
+ # @param reseller_masheryid
3210
3272
  # @return - the data from the api
3211
3273
  #
3212
- def getSales_logBy_countryBy_date( from_date, country, action_type)
3274
+ def postSales_logSyndication( action_type, syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)
3213
3275
  params = Hash.new
3214
- params['from_date'] = from_date
3215
- params['country'] = country
3216
3276
  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)
3277
+ params['syndication_type'] = syndication_type
3278
+ params['publisher_id'] = publisher_id
3279
+ params['expiry_date'] = expiry_date
3280
+ params['entity_id'] = entity_id
3281
+ params['group_id'] = group_id
3282
+ params['seed_masheryid'] = seed_masheryid
3283
+ params['supplier_masheryid'] = supplier_masheryid
3284
+ params['country'] = country
3285
+ params['reseller_masheryid'] = reseller_masheryid
3286
+ return doCurl("post","/sales_log/syndication",params)
3233
3287
  end
3234
3288
 
3235
3289
 
@@ -3297,6 +3351,58 @@ class CentralIndex
3297
3351
  end
3298
3352
 
3299
3353
 
3354
+ #
3355
+ # Add a Syndicate
3356
+ #
3357
+ # @param syndication_type
3358
+ # @param publisher_id
3359
+ # @param expiry_date
3360
+ # @param entity_id
3361
+ # @param group_id
3362
+ # @param seed_masheryid
3363
+ # @param supplier_masheryid
3364
+ # @param country
3365
+ # @param reseller_masheryid
3366
+ # @return - the data from the api
3367
+ #
3368
+ def postSyndicationCreate( syndication_type, publisher_id, expiry_date, entity_id, group_id, seed_masheryid, supplier_masheryid, country, reseller_masheryid)
3369
+ params = Hash.new
3370
+ params['syndication_type'] = syndication_type
3371
+ params['publisher_id'] = publisher_id
3372
+ params['expiry_date'] = expiry_date
3373
+ params['entity_id'] = entity_id
3374
+ params['group_id'] = group_id
3375
+ params['seed_masheryid'] = seed_masheryid
3376
+ params['supplier_masheryid'] = supplier_masheryid
3377
+ params['country'] = country
3378
+ params['reseller_masheryid'] = reseller_masheryid
3379
+ return doCurl("post","/syndication/create",params)
3380
+ end
3381
+
3382
+
3383
+ #
3384
+ # When we get a syndication update make a record of it
3385
+ #
3386
+ # @param entity_id - The entity to pull
3387
+ # @param publisher_id - The publisher this log entry refers to
3388
+ # @param action - The log type
3389
+ # @param success - If the syndication was successful
3390
+ # @param message - An optional message e.g. submitted to the syndication partner
3391
+ # @param syndicated_id - The entity as known to the publisher
3392
+ # @return - the data from the api
3393
+ #
3394
+ def postSyndication_log( entity_id, publisher_id, action, success, message, syndicated_id)
3395
+ params = Hash.new
3396
+ params['entity_id'] = entity_id
3397
+ params['publisher_id'] = publisher_id
3398
+ params['action'] = action
3399
+ params['success'] = success
3400
+ params['message'] = message
3401
+ params['syndicated_id'] = syndicated_id
3402
+ return doCurl("post","/syndication_log",params)
3403
+ end
3404
+
3405
+
3300
3406
  #
3301
3407
  # Provides a tokenised URL to redirect a user so they can add an entity to Central Index
3302
3408
  #
@@ -3451,6 +3557,36 @@ class CentralIndex
3451
3557
  end
3452
3558
 
3453
3559
 
3560
+ #
3561
+ # The JaroWinklerDistance between two entities postal address objects
3562
+ #
3563
+ # @param first_entity_id - The entity id of the first entity to be used in the postal address difference
3564
+ # @param second_entity_id - The entity id of the second entity to be used in the postal address difference
3565
+ # @return - the data from the api
3566
+ #
3567
+ def getToolsAddressdiff( first_entity_id, second_entity_id)
3568
+ params = Hash.new
3569
+ params['first_entity_id'] = first_entity_id
3570
+ params['second_entity_id'] = second_entity_id
3571
+ return doCurl("get","/tools/addressdiff",params)
3572
+ end
3573
+
3574
+
3575
+ #
3576
+ # The JaroWinklerDistance between two entities postal address objects
3577
+ #
3578
+ # @param first_entity_id - The entity id of the first entity to be used in the postal address difference
3579
+ # @param second_entity_id - The entity id of the second entity to be used in the postal address difference
3580
+ # @return - the data from the api
3581
+ #
3582
+ def getToolsAddressdiff2( first_entity_id, second_entity_id)
3583
+ params = Hash.new
3584
+ params['first_entity_id'] = first_entity_id
3585
+ params['second_entity_id'] = second_entity_id
3586
+ return doCurl("get","/tools/addressdiff2",params)
3587
+ end
3588
+
3589
+
3454
3590
  #
3455
3591
  # Use this call to get information (in HTML or JSON) about the data structure of given entity object (e.g. a phone number or an address)
3456
3592
  #
@@ -3746,6 +3882,34 @@ class CentralIndex
3746
3882
  end
3747
3883
 
3748
3884
 
3885
+ #
3886
+ # Calls a number to make sure it is active
3887
+ #
3888
+ # @param phone_number - The phone number to validate
3889
+ # @param country - The country code of the phone number to be validated
3890
+ # @return - the data from the api
3891
+ #
3892
+ def getToolsValidate_phone( phone_number, country)
3893
+ params = Hash.new
3894
+ params['phone_number'] = phone_number
3895
+ params['country'] = country
3896
+ return doCurl("get","/tools/validate_phone",params)
3897
+ end
3898
+
3899
+
3900
+ #
3901
+ # Deleting a traction
3902
+ #
3903
+ # @param traction_id
3904
+ # @return - the data from the api
3905
+ #
3906
+ def deleteTraction( traction_id)
3907
+ params = Hash.new
3908
+ params['traction_id'] = traction_id
3909
+ return doCurl("delete","/traction",params)
3910
+ end
3911
+
3912
+
3749
3913
  #
3750
3914
  # Update/Add a traction
3751
3915
  #
@@ -3785,19 +3949,6 @@ class CentralIndex
3785
3949
  end
3786
3950
 
3787
3951
 
3788
- #
3789
- # Deleting a traction
3790
- #
3791
- # @param traction_id
3792
- # @return - the data from the api
3793
- #
3794
- def deleteTraction( traction_id)
3795
- params = Hash.new
3796
- params['traction_id'] = traction_id
3797
- return doCurl("delete","/traction",params)
3798
- end
3799
-
3800
-
3801
3952
  #
3802
3953
  # Fetching a traction
3803
3954
  #
@@ -3822,19 +3973,6 @@ class CentralIndex
3822
3973
  end
3823
3974
 
3824
3975
 
3825
- #
3826
- # Given a transaction_id retrieve information on it
3827
- #
3828
- # @param transaction_id
3829
- # @return - the data from the api
3830
- #
3831
- def getTransaction( transaction_id)
3832
- params = Hash.new
3833
- params['transaction_id'] = transaction_id
3834
- return doCurl("get","/transaction",params)
3835
- end
3836
-
3837
-
3838
3976
  #
3839
3977
  # Create a new transaction
3840
3978
  #
@@ -3858,6 +3996,19 @@ class CentralIndex
3858
3996
  end
3859
3997
 
3860
3998
 
3999
+ #
4000
+ # Given a transaction_id retrieve information on it
4001
+ #
4002
+ # @param transaction_id
4003
+ # @return - the data from the api
4004
+ #
4005
+ def getTransaction( transaction_id)
4006
+ params = Hash.new
4007
+ params['transaction_id'] = transaction_id
4008
+ return doCurl("get","/transaction",params)
4009
+ end
4010
+
4011
+
3861
4012
  #
3862
4013
  # Set a transactions status to authorised
3863
4014
  #
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 14
9
- version: 0.0.14
8
+ - 15
9
+ version: 0.0.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Glynn Bird