Subversion Repositories SmartDukaan

Rev

Rev 10050 | Rev 10485 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5944 mandeep.dh 1
#!/usr/bin/env python
2
#
3
# Autogenerated by Thrift Compiler (0.7.0)
4
#
5
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6
#
7
 
8
import sys
9
import pprint
10
from urlparse import urlparse
11
from thrift.transport import TTransport
12
from thrift.transport import TSocket
13
from thrift.transport import THttpClient
14
from thrift.protocol import TBinaryProtocol
15
 
16
import InventoryService
17
from ttypes import *
18
 
19
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
20
  print ''
21
  print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
22
  print ''
23
  print 'Functions:'
24
  print '  i64 addWarehouse(Warehouse warehouse)'
25
  print '  i64 addVendor(Vendor vendor)'
26
  print '  void updateInventoryHistory(i64 warehouse_id, string timestamp,  availability)'
27
  print '  void updateInventory(i64 warehouse_id, string timestamp,  availability)'
28
  print '  void addInventory(i64 itemId, i64 warehouseId, i64 quantity)'
29
  print '  void retireWarehouse(i64 warehouse_id)'
30
  print '  ItemInventory getItemInventoryByItemId(i64 item_id)'
31
  print '  i64 getItemAvailibilityAtWarehouse(i64 warehouse_id, i64 item_id)'
5978 rajveer 32
  print '   getItemAvailabilityAtLocation(i64 itemId, i64 sourceId)'
5944 mandeep.dh 33
  print '   getAllWarehouses(bool isActive)'
34
  print '  Warehouse getWarehouse(i64 warehouse_id)'
35
  print '   getAllItemsForWarehouse(i64 warehouse_id)'
5966 rajveer 36
  print '  bool isOrderBillable(i64 itemId, i64 warehouseId, i64 sourceId, i64 orderId)'
37
  print '  bool reserveItemInWarehouse(i64 itemId, i64 warehouseId, i64 sourceId, i64 orderId, i64 createdTimestamp, i64 promisedShippingTimestamp, double quantity)'
8282 kshitij.so 38
  print '  bool updateReservationForOrder(i64 itemId, i64 warehouseId, i64 sourceId, i64 orderId, i64 createdTimestamp, i64 promisedShippingTimestamp, double quantity)'
5966 rajveer 39
  print '  bool reduceReservationCount(i64 itemId, i64 warehouseId, i64 sourceId, i64 orderId, double quantity)'
5944 mandeep.dh 40
  print '  VendorItemPricing getItemPricing(i64 itemId, i64 vendorId)'
41
  print '   getAllItemPricing(i64 itemId)'
42
  print '  void addVendorItemPricing(VendorItemPricing vendorItemPricing)'
43
  print '  Vendor getVendor(i64 vendorId)'
44
  print '   getAllVendors()'
45
  print '  void addVendorItemMapping(string key, VendorItemMapping vendorItemMapping)'
46
  print '   getVendorItemMappings(i64 itemId)'
47
  print '   getPendingOrdersInventory(i64 vendorid)'
48
  print '   getWarehouses(WarehouseType warehouseType, InventoryType inventoryType, i64 vendorId, i64 billingWarehouseId, i64 shippingWarehouseId)'
49
  print '  void resetAvailability(string itemKey, i64 vendorId, i64 quantity, i64 warehouseId)'
50
  print '  void resetAvailabilityForWarehouse(i64 warehouseId)'
51
  print '   getItemKeysToBeProcessed(i64 warehouseId)'
52
  print '  void markMissedInventoryUpdatesAsProcessed(string itemKey, i64 warehouseId)'
53
  print '   getIgnoredItemKeys()'
54
  print '  void addBadInventory(i64 itemId, i64 warehouseId, i64 quantity)'
55
  print '   getShippingLocations()'
56
  print '   getAllVendorItemMappings()'
57
  print '   getInventorySnapshot(i64 warehouseId)'
58
  print '  void clearItemAvailabilityCache()'
59
  print '  void updateVendorString(i64 warehouseId, string vendorString)'
6096 amit.gupta 60
  print '  void clearItemAvailabilityCacheForItem(i64 item_id)'
7808 anupam.sin 61
  print '  i64 getOurWarehouseIdForVendor(i64 vendorId, i64 billingWarehouseId)'
6531 vikram.rag 62
  print '   getItemAvailabilitiesAtOurWarehouses( item_ids)'
63
  print '   getMonitoredWarehouseForVendors( vendorIds)'
64
  print '   getIgnoredWarehouseidsAndItemids()'
65
  print '  bool insertItemtoIgnoreInventoryUpdatelist(i64 item_id, i64 warehouse_id)'
66
  print '  bool deleteItemFromIgnoredInventoryUpdateList(i64 item_id, i64 warehouse_id)'
67
  print '  i32 getAllIgnoredInventoryupdateItemsCount()'
68
  print '   getIgnoredInventoryUpdateItemids(i32 offset, i32 limit)'
7330 amit.gupta 69
  print '  void updateItemStockPurchaseParams(i64 item_id, i32 numOfDaysStock, i64 minStockLevel)'
70
  print '  ItemStockPurchaseParams getItemStockPurchaseParams(i64 itemId)'
71
  print '  void addOosStatusForItem( oosStatusMap, i64 date)'
9665 rajveer 72
  print '   getOosStatusesForXDaysForItem(i64 itemId, i32 sourceId, i32 days)'
10450 vikram.rag 73
  print '   getOosStatusesForXDays(i32 sourceId, i32 days)'
74
  print '   getAllVendorItemPricing(i64 itemId, i64 vendorId)'
7330 amit.gupta 75
  print '   getNonZeroItemStockPurchaseParams()'
76
  print '   getBillableInventoryAndPendingOrders()'
77
  print '  string getWarehouseName(i64 warehouse_id)'
78
  print '  AmazonInventorySnapshot getAmazonInventoryForItem(i64 item_id)'
79
  print '   getAllAmazonInventory()'
10450 vikram.rag 80
  print '  void addOrUpdateAmazonInventoryForItem(AmazonInventorySnapshot amazonInventorySnapshot, i64 time)'
8282 kshitij.so 81
  print '  string getLastNdaySaleForItem(i64 itemId, i64 numberOfDays)'
82
  print '  void addOrUpdateAmazonFbaInventory(AmazonFbaInventorySnapshot amazonfbainventorysnapshot)'
83
  print '  void addUpdateHoldInventory(i64 itemId, i64 warehouseId, i64 holdQuantity, i64 source)'
84
  print '  i64 getAmazonFbaItemInventory(i64 itemId)'
8955 vikram.rag 85
  print '   getAllAmazonFbaItemInventory()'
86
  print '   getOursGoodWarehouseIdsForLocation(i64 state_id)'
87
  print '  i64 getHoldInventoryDetailForItemForWarehouseIdExceptSource(i64 id, i64 warehouse_id, i64 source)'
9404 vikram.rag 88
  print '  SnapdealInventoryItem getSnapdealInventoryForItem(i64 item_id)'
89
  print '  void addOrUpdateSnapdealInventoryForItem(SnapdealInventoryItem snapdealinventoryitem)'
90
  print '  double getNlcForWarehouse(i64 warehouse_id, i64 item_id)'
9665 rajveer 91
  print '   getHeldInventoryMapForItem(i64 item_id, i64 warehouse_id)'
9482 vikram.rag 92
  print '  void addOrUpdateAllAmazonFbaInventory( allamazonfbainventorysnapshot)'
9495 vikram.rag 93
  print '  void addOrUpdateAllSnapdealInventory( allsnapdealinventorysnapshot)'
94
  print '   getSnapdealInventorySnapshot()'
10050 vikram.rag 95
  print '   getHoldInventoryDetails(i64 itemId, i64 warehouseId, i64 source)'
10450 vikram.rag 96
  print '  void addOrUpdateFlipkartInventorySnapshot( flipkartInventorySnapshot, i64 time)'
10050 vikram.rag 97
  print '   getFlipkartInventorySnapshot()'
10450 vikram.rag 98
  print '  FlipkartInventorySnapshot getFlipkartlInventoryForItem(i64 item_id)'
5944 mandeep.dh 99
  print ''
100
  sys.exit(0)
101
 
102
pp = pprint.PrettyPrinter(indent = 2)
103
host = 'localhost'
104
port = 9090
105
uri = ''
106
framed = False
107
http = False
108
argi = 1
109
 
110
if sys.argv[argi] == '-h':
111
  parts = sys.argv[argi+1].split(':')
112
  host = parts[0]
113
  port = int(parts[1])
114
  argi += 2
115
 
116
if sys.argv[argi] == '-u':
117
  url = urlparse(sys.argv[argi+1])
118
  parts = url[1].split(':')
119
  host = parts[0]
120
  if len(parts) > 1:
121
    port = int(parts[1])
122
  else:
123
    port = 80
124
  uri = url[2]
125
  if url[4]:
126
    uri += '?%s' % url[4]
127
  http = True
128
  argi += 2
129
 
130
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
131
  framed = True
132
  argi += 1
133
 
134
cmd = sys.argv[argi]
135
args = sys.argv[argi+1:]
136
 
137
if http:
138
  transport = THttpClient.THttpClient(host, port, uri)
139
else:
140
  socket = TSocket.TSocket(host, port)
141
  if framed:
142
    transport = TTransport.TFramedTransport(socket)
143
  else:
144
    transport = TTransport.TBufferedTransport(socket)
145
protocol = TBinaryProtocol.TBinaryProtocol(transport)
146
client = InventoryService.Client(protocol)
147
transport.open()
148
 
149
if cmd == 'addWarehouse':
150
  if len(args) != 1:
151
    print 'addWarehouse requires 1 args'
152
    sys.exit(1)
153
  pp.pprint(client.addWarehouse(eval(args[0]),))
154
 
155
elif cmd == 'addVendor':
156
  if len(args) != 1:
157
    print 'addVendor requires 1 args'
158
    sys.exit(1)
159
  pp.pprint(client.addVendor(eval(args[0]),))
160
 
161
elif cmd == 'updateInventoryHistory':
162
  if len(args) != 3:
163
    print 'updateInventoryHistory requires 3 args'
164
    sys.exit(1)
165
  pp.pprint(client.updateInventoryHistory(eval(args[0]),args[1],eval(args[2]),))
166
 
167
elif cmd == 'updateInventory':
168
  if len(args) != 3:
169
    print 'updateInventory requires 3 args'
170
    sys.exit(1)
171
  pp.pprint(client.updateInventory(eval(args[0]),args[1],eval(args[2]),))
172
 
173
elif cmd == 'addInventory':
174
  if len(args) != 3:
175
    print 'addInventory requires 3 args'
176
    sys.exit(1)
177
  pp.pprint(client.addInventory(eval(args[0]),eval(args[1]),eval(args[2]),))
178
 
179
elif cmd == 'retireWarehouse':
180
  if len(args) != 1:
181
    print 'retireWarehouse requires 1 args'
182
    sys.exit(1)
183
  pp.pprint(client.retireWarehouse(eval(args[0]),))
184
 
185
elif cmd == 'getItemInventoryByItemId':
186
  if len(args) != 1:
187
    print 'getItemInventoryByItemId requires 1 args'
188
    sys.exit(1)
189
  pp.pprint(client.getItemInventoryByItemId(eval(args[0]),))
190
 
191
elif cmd == 'getItemAvailibilityAtWarehouse':
192
  if len(args) != 2:
193
    print 'getItemAvailibilityAtWarehouse requires 2 args'
194
    sys.exit(1)
195
  pp.pprint(client.getItemAvailibilityAtWarehouse(eval(args[0]),eval(args[1]),))
196
 
197
elif cmd == 'getItemAvailabilityAtLocation':
5978 rajveer 198
  if len(args) != 2:
199
    print 'getItemAvailabilityAtLocation requires 2 args'
5944 mandeep.dh 200
    sys.exit(1)
5978 rajveer 201
  pp.pprint(client.getItemAvailabilityAtLocation(eval(args[0]),eval(args[1]),))
5944 mandeep.dh 202
 
203
elif cmd == 'getAllWarehouses':
204
  if len(args) != 1:
205
    print 'getAllWarehouses requires 1 args'
206
    sys.exit(1)
207
  pp.pprint(client.getAllWarehouses(eval(args[0]),))
208
 
209
elif cmd == 'getWarehouse':
210
  if len(args) != 1:
211
    print 'getWarehouse requires 1 args'
212
    sys.exit(1)
213
  pp.pprint(client.getWarehouse(eval(args[0]),))
214
 
215
elif cmd == 'getAllItemsForWarehouse':
216
  if len(args) != 1:
217
    print 'getAllItemsForWarehouse requires 1 args'
218
    sys.exit(1)
219
  pp.pprint(client.getAllItemsForWarehouse(eval(args[0]),))
220
 
5966 rajveer 221
elif cmd == 'isOrderBillable':
222
  if len(args) != 4:
223
    print 'isOrderBillable requires 4 args'
224
    sys.exit(1)
225
  pp.pprint(client.isOrderBillable(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
226
 
5944 mandeep.dh 227
elif cmd == 'reserveItemInWarehouse':
5966 rajveer 228
  if len(args) != 7:
229
    print 'reserveItemInWarehouse requires 7 args'
5944 mandeep.dh 230
    sys.exit(1)
5966 rajveer 231
  pp.pprint(client.reserveItemInWarehouse(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),eval(args[6]),))
5944 mandeep.dh 232
 
8282 kshitij.so 233
elif cmd == 'updateReservationForOrder':
234
  if len(args) != 7:
235
    print 'updateReservationForOrder requires 7 args'
236
    sys.exit(1)
237
  pp.pprint(client.updateReservationForOrder(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),eval(args[6]),))
238
 
5944 mandeep.dh 239
elif cmd == 'reduceReservationCount':
5966 rajveer 240
  if len(args) != 5:
241
    print 'reduceReservationCount requires 5 args'
5944 mandeep.dh 242
    sys.exit(1)
5966 rajveer 243
  pp.pprint(client.reduceReservationCount(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
5944 mandeep.dh 244
 
245
elif cmd == 'getItemPricing':
246
  if len(args) != 2:
247
    print 'getItemPricing requires 2 args'
248
    sys.exit(1)
249
  pp.pprint(client.getItemPricing(eval(args[0]),eval(args[1]),))
250
 
251
elif cmd == 'getAllItemPricing':
252
  if len(args) != 1:
253
    print 'getAllItemPricing requires 1 args'
254
    sys.exit(1)
255
  pp.pprint(client.getAllItemPricing(eval(args[0]),))
256
 
257
elif cmd == 'addVendorItemPricing':
258
  if len(args) != 1:
259
    print 'addVendorItemPricing requires 1 args'
260
    sys.exit(1)
261
  pp.pprint(client.addVendorItemPricing(eval(args[0]),))
262
 
263
elif cmd == 'getVendor':
264
  if len(args) != 1:
265
    print 'getVendor requires 1 args'
266
    sys.exit(1)
267
  pp.pprint(client.getVendor(eval(args[0]),))
268
 
269
elif cmd == 'getAllVendors':
270
  if len(args) != 0:
271
    print 'getAllVendors requires 0 args'
272
    sys.exit(1)
273
  pp.pprint(client.getAllVendors())
274
 
275
elif cmd == 'addVendorItemMapping':
276
  if len(args) != 2:
277
    print 'addVendorItemMapping requires 2 args'
278
    sys.exit(1)
279
  pp.pprint(client.addVendorItemMapping(args[0],eval(args[1]),))
280
 
281
elif cmd == 'getVendorItemMappings':
282
  if len(args) != 1:
283
    print 'getVendorItemMappings requires 1 args'
284
    sys.exit(1)
285
  pp.pprint(client.getVendorItemMappings(eval(args[0]),))
286
 
287
elif cmd == 'getPendingOrdersInventory':
288
  if len(args) != 1:
289
    print 'getPendingOrdersInventory requires 1 args'
290
    sys.exit(1)
291
  pp.pprint(client.getPendingOrdersInventory(eval(args[0]),))
292
 
293
elif cmd == 'getWarehouses':
294
  if len(args) != 5:
295
    print 'getWarehouses requires 5 args'
296
    sys.exit(1)
297
  pp.pprint(client.getWarehouses(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
298
 
299
elif cmd == 'resetAvailability':
300
  if len(args) != 4:
301
    print 'resetAvailability requires 4 args'
302
    sys.exit(1)
303
  pp.pprint(client.resetAvailability(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))
304
 
305
elif cmd == 'resetAvailabilityForWarehouse':
306
  if len(args) != 1:
307
    print 'resetAvailabilityForWarehouse requires 1 args'
308
    sys.exit(1)
309
  pp.pprint(client.resetAvailabilityForWarehouse(eval(args[0]),))
310
 
311
elif cmd == 'getItemKeysToBeProcessed':
312
  if len(args) != 1:
313
    print 'getItemKeysToBeProcessed requires 1 args'
314
    sys.exit(1)
315
  pp.pprint(client.getItemKeysToBeProcessed(eval(args[0]),))
316
 
317
elif cmd == 'markMissedInventoryUpdatesAsProcessed':
318
  if len(args) != 2:
319
    print 'markMissedInventoryUpdatesAsProcessed requires 2 args'
320
    sys.exit(1)
321
  pp.pprint(client.markMissedInventoryUpdatesAsProcessed(args[0],eval(args[1]),))
322
 
323
elif cmd == 'getIgnoredItemKeys':
324
  if len(args) != 0:
325
    print 'getIgnoredItemKeys requires 0 args'
326
    sys.exit(1)
327
  pp.pprint(client.getIgnoredItemKeys())
328
 
329
elif cmd == 'addBadInventory':
330
  if len(args) != 3:
331
    print 'addBadInventory requires 3 args'
332
    sys.exit(1)
333
  pp.pprint(client.addBadInventory(eval(args[0]),eval(args[1]),eval(args[2]),))
334
 
335
elif cmd == 'getShippingLocations':
336
  if len(args) != 0:
337
    print 'getShippingLocations requires 0 args'
338
    sys.exit(1)
339
  pp.pprint(client.getShippingLocations())
340
 
341
elif cmd == 'getAllVendorItemMappings':
342
  if len(args) != 0:
343
    print 'getAllVendorItemMappings requires 0 args'
344
    sys.exit(1)
345
  pp.pprint(client.getAllVendorItemMappings())
346
 
347
elif cmd == 'getInventorySnapshot':
348
  if len(args) != 1:
349
    print 'getInventorySnapshot requires 1 args'
350
    sys.exit(1)
351
  pp.pprint(client.getInventorySnapshot(eval(args[0]),))
352
 
353
elif cmd == 'clearItemAvailabilityCache':
354
  if len(args) != 0:
355
    print 'clearItemAvailabilityCache requires 0 args'
356
    sys.exit(1)
357
  pp.pprint(client.clearItemAvailabilityCache())
358
 
359
elif cmd == 'updateVendorString':
360
  if len(args) != 2:
361
    print 'updateVendorString requires 2 args'
362
    sys.exit(1)
363
  pp.pprint(client.updateVendorString(eval(args[0]),args[1],))
364
 
6096 amit.gupta 365
elif cmd == 'clearItemAvailabilityCacheForItem':
366
  if len(args) != 1:
367
    print 'clearItemAvailabilityCacheForItem requires 1 args'
368
    sys.exit(1)
369
  pp.pprint(client.clearItemAvailabilityCacheForItem(eval(args[0]),))
370
 
6531 vikram.rag 371
elif cmd == 'getOurWarehouseIdForVendor':
7808 anupam.sin 372
  if len(args) != 2:
373
    print 'getOurWarehouseIdForVendor requires 2 args'
6531 vikram.rag 374
    sys.exit(1)
7808 anupam.sin 375
  pp.pprint(client.getOurWarehouseIdForVendor(eval(args[0]),eval(args[1]),))
6531 vikram.rag 376
 
377
elif cmd == 'getItemAvailabilitiesAtOurWarehouses':
378
  if len(args) != 1:
379
    print 'getItemAvailabilitiesAtOurWarehouses requires 1 args'
380
    sys.exit(1)
381
  pp.pprint(client.getItemAvailabilitiesAtOurWarehouses(eval(args[0]),))
382
 
383
elif cmd == 'getMonitoredWarehouseForVendors':
384
  if len(args) != 1:
385
    print 'getMonitoredWarehouseForVendors requires 1 args'
386
    sys.exit(1)
387
  pp.pprint(client.getMonitoredWarehouseForVendors(eval(args[0]),))
388
 
389
elif cmd == 'getIgnoredWarehouseidsAndItemids':
390
  if len(args) != 0:
391
    print 'getIgnoredWarehouseidsAndItemids requires 0 args'
392
    sys.exit(1)
393
  pp.pprint(client.getIgnoredWarehouseidsAndItemids())
394
 
395
elif cmd == 'insertItemtoIgnoreInventoryUpdatelist':
396
  if len(args) != 2:
397
    print 'insertItemtoIgnoreInventoryUpdatelist requires 2 args'
398
    sys.exit(1)
399
  pp.pprint(client.insertItemtoIgnoreInventoryUpdatelist(eval(args[0]),eval(args[1]),))
400
 
401
elif cmd == 'deleteItemFromIgnoredInventoryUpdateList':
402
  if len(args) != 2:
403
    print 'deleteItemFromIgnoredInventoryUpdateList requires 2 args'
404
    sys.exit(1)
405
  pp.pprint(client.deleteItemFromIgnoredInventoryUpdateList(eval(args[0]),eval(args[1]),))
406
 
407
elif cmd == 'getAllIgnoredInventoryupdateItemsCount':
408
  if len(args) != 0:
409
    print 'getAllIgnoredInventoryupdateItemsCount requires 0 args'
410
    sys.exit(1)
411
  pp.pprint(client.getAllIgnoredInventoryupdateItemsCount())
412
 
413
elif cmd == 'getIgnoredInventoryUpdateItemids':
414
  if len(args) != 2:
415
    print 'getIgnoredInventoryUpdateItemids requires 2 args'
416
    sys.exit(1)
417
  pp.pprint(client.getIgnoredInventoryUpdateItemids(eval(args[0]),eval(args[1]),))
418
 
7330 amit.gupta 419
elif cmd == 'updateItemStockPurchaseParams':
420
  if len(args) != 3:
421
    print 'updateItemStockPurchaseParams requires 3 args'
422
    sys.exit(1)
423
  pp.pprint(client.updateItemStockPurchaseParams(eval(args[0]),eval(args[1]),eval(args[2]),))
424
 
425
elif cmd == 'getItemStockPurchaseParams':
426
  if len(args) != 1:
427
    print 'getItemStockPurchaseParams requires 1 args'
428
    sys.exit(1)
429
  pp.pprint(client.getItemStockPurchaseParams(eval(args[0]),))
430
 
431
elif cmd == 'addOosStatusForItem':
432
  if len(args) != 2:
433
    print 'addOosStatusForItem requires 2 args'
434
    sys.exit(1)
435
  pp.pprint(client.addOosStatusForItem(eval(args[0]),eval(args[1]),))
436
 
437
elif cmd == 'getOosStatusesForXDaysForItem':
9665 rajveer 438
  if len(args) != 3:
439
    print 'getOosStatusesForXDaysForItem requires 3 args'
7330 amit.gupta 440
    sys.exit(1)
9665 rajveer 441
  pp.pprint(client.getOosStatusesForXDaysForItem(eval(args[0]),eval(args[1]),eval(args[2]),))
7330 amit.gupta 442
 
10450 vikram.rag 443
elif cmd == 'getOosStatusesForXDays':
444
  if len(args) != 2:
445
    print 'getOosStatusesForXDays requires 2 args'
446
    sys.exit(1)
447
  pp.pprint(client.getOosStatusesForXDays(eval(args[0]),eval(args[1]),))
448
 
449
elif cmd == 'getAllVendorItemPricing':
450
  if len(args) != 2:
451
    print 'getAllVendorItemPricing requires 2 args'
452
    sys.exit(1)
453
  pp.pprint(client.getAllVendorItemPricing(eval(args[0]),eval(args[1]),))
454
 
7330 amit.gupta 455
elif cmd == 'getNonZeroItemStockPurchaseParams':
456
  if len(args) != 0:
457
    print 'getNonZeroItemStockPurchaseParams requires 0 args'
458
    sys.exit(1)
459
  pp.pprint(client.getNonZeroItemStockPurchaseParams())
460
 
461
elif cmd == 'getBillableInventoryAndPendingOrders':
462
  if len(args) != 0:
463
    print 'getBillableInventoryAndPendingOrders requires 0 args'
464
    sys.exit(1)
465
  pp.pprint(client.getBillableInventoryAndPendingOrders())
466
 
467
elif cmd == 'getWarehouseName':
468
  if len(args) != 1:
469
    print 'getWarehouseName requires 1 args'
470
    sys.exit(1)
471
  pp.pprint(client.getWarehouseName(eval(args[0]),))
472
 
473
elif cmd == 'getAmazonInventoryForItem':
474
  if len(args) != 1:
475
    print 'getAmazonInventoryForItem requires 1 args'
476
    sys.exit(1)
477
  pp.pprint(client.getAmazonInventoryForItem(eval(args[0]),))
478
 
479
elif cmd == 'getAllAmazonInventory':
480
  if len(args) != 0:
481
    print 'getAllAmazonInventory requires 0 args'
482
    sys.exit(1)
483
  pp.pprint(client.getAllAmazonInventory())
484
 
485
elif cmd == 'addOrUpdateAmazonInventoryForItem':
10450 vikram.rag 486
  if len(args) != 2:
487
    print 'addOrUpdateAmazonInventoryForItem requires 2 args'
7330 amit.gupta 488
    sys.exit(1)
10450 vikram.rag 489
  pp.pprint(client.addOrUpdateAmazonInventoryForItem(eval(args[0]),eval(args[1]),))
7330 amit.gupta 490
 
8282 kshitij.so 491
elif cmd == 'getLastNdaySaleForItem':
492
  if len(args) != 2:
493
    print 'getLastNdaySaleForItem requires 2 args'
494
    sys.exit(1)
495
  pp.pprint(client.getLastNdaySaleForItem(eval(args[0]),eval(args[1]),))
496
 
497
elif cmd == 'addOrUpdateAmazonFbaInventory':
498
  if len(args) != 1:
499
    print 'addOrUpdateAmazonFbaInventory requires 1 args'
500
    sys.exit(1)
501
  pp.pprint(client.addOrUpdateAmazonFbaInventory(eval(args[0]),))
502
 
503
elif cmd == 'addUpdateHoldInventory':
504
  if len(args) != 4:
505
    print 'addUpdateHoldInventory requires 4 args'
506
    sys.exit(1)
507
  pp.pprint(client.addUpdateHoldInventory(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
508
 
509
elif cmd == 'getAmazonFbaItemInventory':
510
  if len(args) != 1:
511
    print 'getAmazonFbaItemInventory requires 1 args'
512
    sys.exit(1)
513
  pp.pprint(client.getAmazonFbaItemInventory(eval(args[0]),))
514
 
8955 vikram.rag 515
elif cmd == 'getAllAmazonFbaItemInventory':
8282 kshitij.so 516
  if len(args) != 0:
8955 vikram.rag 517
    print 'getAllAmazonFbaItemInventory requires 0 args'
8282 kshitij.so 518
    sys.exit(1)
8955 vikram.rag 519
  pp.pprint(client.getAllAmazonFbaItemInventory())
8282 kshitij.so 520
 
8955 vikram.rag 521
elif cmd == 'getOursGoodWarehouseIdsForLocation':
522
  if len(args) != 1:
523
    print 'getOursGoodWarehouseIdsForLocation requires 1 args'
524
    sys.exit(1)
525
  pp.pprint(client.getOursGoodWarehouseIdsForLocation(eval(args[0]),))
526
 
527
elif cmd == 'getHoldInventoryDetailForItemForWarehouseIdExceptSource':
528
  if len(args) != 3:
529
    print 'getHoldInventoryDetailForItemForWarehouseIdExceptSource requires 3 args'
530
    sys.exit(1)
531
  pp.pprint(client.getHoldInventoryDetailForItemForWarehouseIdExceptSource(eval(args[0]),eval(args[1]),eval(args[2]),))
532
 
9404 vikram.rag 533
elif cmd == 'getSnapdealInventoryForItem':
534
  if len(args) != 1:
535
    print 'getSnapdealInventoryForItem requires 1 args'
536
    sys.exit(1)
537
  pp.pprint(client.getSnapdealInventoryForItem(eval(args[0]),))
538
 
539
elif cmd == 'addOrUpdateSnapdealInventoryForItem':
540
  if len(args) != 1:
541
    print 'addOrUpdateSnapdealInventoryForItem requires 1 args'
542
    sys.exit(1)
543
  pp.pprint(client.addOrUpdateSnapdealInventoryForItem(eval(args[0]),))
544
 
545
elif cmd == 'getNlcForWarehouse':
546
  if len(args) != 2:
547
    print 'getNlcForWarehouse requires 2 args'
548
    sys.exit(1)
549
  pp.pprint(client.getNlcForWarehouse(eval(args[0]),eval(args[1]),))
550
 
9665 rajveer 551
elif cmd == 'getHeldInventoryMapForItem':
552
  if len(args) != 2:
553
    print 'getHeldInventoryMapForItem requires 2 args'
554
    sys.exit(1)
555
  pp.pprint(client.getHeldInventoryMapForItem(eval(args[0]),eval(args[1]),))
556
 
9482 vikram.rag 557
elif cmd == 'addOrUpdateAllAmazonFbaInventory':
558
  if len(args) != 1:
559
    print 'addOrUpdateAllAmazonFbaInventory requires 1 args'
560
    sys.exit(1)
561
  pp.pprint(client.addOrUpdateAllAmazonFbaInventory(eval(args[0]),))
562
 
9495 vikram.rag 563
elif cmd == 'addOrUpdateAllSnapdealInventory':
564
  if len(args) != 1:
565
    print 'addOrUpdateAllSnapdealInventory requires 1 args'
566
    sys.exit(1)
567
  pp.pprint(client.addOrUpdateAllSnapdealInventory(eval(args[0]),))
568
 
569
elif cmd == 'getSnapdealInventorySnapshot':
570
  if len(args) != 0:
571
    print 'getSnapdealInventorySnapshot requires 0 args'
572
    sys.exit(1)
573
  pp.pprint(client.getSnapdealInventorySnapshot())
574
 
10050 vikram.rag 575
elif cmd == 'getHoldInventoryDetails':
576
  if len(args) != 3:
577
    print 'getHoldInventoryDetails requires 3 args'
578
    sys.exit(1)
579
  pp.pprint(client.getHoldInventoryDetails(eval(args[0]),eval(args[1]),eval(args[2]),))
580
 
581
elif cmd == 'addOrUpdateFlipkartInventorySnapshot':
10450 vikram.rag 582
  if len(args) != 2:
583
    print 'addOrUpdateFlipkartInventorySnapshot requires 2 args'
10050 vikram.rag 584
    sys.exit(1)
10450 vikram.rag 585
  pp.pprint(client.addOrUpdateFlipkartInventorySnapshot(eval(args[0]),eval(args[1]),))
10050 vikram.rag 586
 
587
elif cmd == 'getFlipkartInventorySnapshot':
588
  if len(args) != 0:
589
    print 'getFlipkartInventorySnapshot requires 0 args'
590
    sys.exit(1)
591
  pp.pprint(client.getFlipkartInventorySnapshot())
592
 
10450 vikram.rag 593
elif cmd == 'getFlipkartlInventoryForItem':
594
  if len(args) != 1:
595
    print 'getFlipkartlInventoryForItem requires 1 args'
596
    sys.exit(1)
597
  pp.pprint(client.getFlipkartlInventoryForItem(eval(args[0]),))
598
 
5944 mandeep.dh 599
else:
600
  print 'Unrecognized method %s' % cmd
601
  sys.exit(1)
602
 
603
transport.close()