Subversion Repositories SmartDukaan

Rev

Rev 10450 | Rev 10544 | 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)'
10485 vikram.rag 99
  print '   getStateMaster()'
5944 mandeep.dh 100
  print ''
101
  sys.exit(0)
102
 
103
pp = pprint.PrettyPrinter(indent = 2)
104
host = 'localhost'
105
port = 9090
106
uri = ''
107
framed = False
108
http = False
109
argi = 1
110
 
111
if sys.argv[argi] == '-h':
112
  parts = sys.argv[argi+1].split(':')
113
  host = parts[0]
114
  port = int(parts[1])
115
  argi += 2
116
 
117
if sys.argv[argi] == '-u':
118
  url = urlparse(sys.argv[argi+1])
119
  parts = url[1].split(':')
120
  host = parts[0]
121
  if len(parts) > 1:
122
    port = int(parts[1])
123
  else:
124
    port = 80
125
  uri = url[2]
126
  if url[4]:
127
    uri += '?%s' % url[4]
128
  http = True
129
  argi += 2
130
 
131
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
132
  framed = True
133
  argi += 1
134
 
135
cmd = sys.argv[argi]
136
args = sys.argv[argi+1:]
137
 
138
if http:
139
  transport = THttpClient.THttpClient(host, port, uri)
140
else:
141
  socket = TSocket.TSocket(host, port)
142
  if framed:
143
    transport = TTransport.TFramedTransport(socket)
144
  else:
145
    transport = TTransport.TBufferedTransport(socket)
146
protocol = TBinaryProtocol.TBinaryProtocol(transport)
147
client = InventoryService.Client(protocol)
148
transport.open()
149
 
150
if cmd == 'addWarehouse':
151
  if len(args) != 1:
152
    print 'addWarehouse requires 1 args'
153
    sys.exit(1)
154
  pp.pprint(client.addWarehouse(eval(args[0]),))
155
 
156
elif cmd == 'addVendor':
157
  if len(args) != 1:
158
    print 'addVendor requires 1 args'
159
    sys.exit(1)
160
  pp.pprint(client.addVendor(eval(args[0]),))
161
 
162
elif cmd == 'updateInventoryHistory':
163
  if len(args) != 3:
164
    print 'updateInventoryHistory requires 3 args'
165
    sys.exit(1)
166
  pp.pprint(client.updateInventoryHistory(eval(args[0]),args[1],eval(args[2]),))
167
 
168
elif cmd == 'updateInventory':
169
  if len(args) != 3:
170
    print 'updateInventory requires 3 args'
171
    sys.exit(1)
172
  pp.pprint(client.updateInventory(eval(args[0]),args[1],eval(args[2]),))
173
 
174
elif cmd == 'addInventory':
175
  if len(args) != 3:
176
    print 'addInventory requires 3 args'
177
    sys.exit(1)
178
  pp.pprint(client.addInventory(eval(args[0]),eval(args[1]),eval(args[2]),))
179
 
180
elif cmd == 'retireWarehouse':
181
  if len(args) != 1:
182
    print 'retireWarehouse requires 1 args'
183
    sys.exit(1)
184
  pp.pprint(client.retireWarehouse(eval(args[0]),))
185
 
186
elif cmd == 'getItemInventoryByItemId':
187
  if len(args) != 1:
188
    print 'getItemInventoryByItemId requires 1 args'
189
    sys.exit(1)
190
  pp.pprint(client.getItemInventoryByItemId(eval(args[0]),))
191
 
192
elif cmd == 'getItemAvailibilityAtWarehouse':
193
  if len(args) != 2:
194
    print 'getItemAvailibilityAtWarehouse requires 2 args'
195
    sys.exit(1)
196
  pp.pprint(client.getItemAvailibilityAtWarehouse(eval(args[0]),eval(args[1]),))
197
 
198
elif cmd == 'getItemAvailabilityAtLocation':
5978 rajveer 199
  if len(args) != 2:
200
    print 'getItemAvailabilityAtLocation requires 2 args'
5944 mandeep.dh 201
    sys.exit(1)
5978 rajveer 202
  pp.pprint(client.getItemAvailabilityAtLocation(eval(args[0]),eval(args[1]),))
5944 mandeep.dh 203
 
204
elif cmd == 'getAllWarehouses':
205
  if len(args) != 1:
206
    print 'getAllWarehouses requires 1 args'
207
    sys.exit(1)
208
  pp.pprint(client.getAllWarehouses(eval(args[0]),))
209
 
210
elif cmd == 'getWarehouse':
211
  if len(args) != 1:
212
    print 'getWarehouse requires 1 args'
213
    sys.exit(1)
214
  pp.pprint(client.getWarehouse(eval(args[0]),))
215
 
216
elif cmd == 'getAllItemsForWarehouse':
217
  if len(args) != 1:
218
    print 'getAllItemsForWarehouse requires 1 args'
219
    sys.exit(1)
220
  pp.pprint(client.getAllItemsForWarehouse(eval(args[0]),))
221
 
5966 rajveer 222
elif cmd == 'isOrderBillable':
223
  if len(args) != 4:
224
    print 'isOrderBillable requires 4 args'
225
    sys.exit(1)
226
  pp.pprint(client.isOrderBillable(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
227
 
5944 mandeep.dh 228
elif cmd == 'reserveItemInWarehouse':
5966 rajveer 229
  if len(args) != 7:
230
    print 'reserveItemInWarehouse requires 7 args'
5944 mandeep.dh 231
    sys.exit(1)
5966 rajveer 232
  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 233
 
8282 kshitij.so 234
elif cmd == 'updateReservationForOrder':
235
  if len(args) != 7:
236
    print 'updateReservationForOrder requires 7 args'
237
    sys.exit(1)
238
  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]),))
239
 
5944 mandeep.dh 240
elif cmd == 'reduceReservationCount':
5966 rajveer 241
  if len(args) != 5:
242
    print 'reduceReservationCount requires 5 args'
5944 mandeep.dh 243
    sys.exit(1)
5966 rajveer 244
  pp.pprint(client.reduceReservationCount(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
5944 mandeep.dh 245
 
246
elif cmd == 'getItemPricing':
247
  if len(args) != 2:
248
    print 'getItemPricing requires 2 args'
249
    sys.exit(1)
250
  pp.pprint(client.getItemPricing(eval(args[0]),eval(args[1]),))
251
 
252
elif cmd == 'getAllItemPricing':
253
  if len(args) != 1:
254
    print 'getAllItemPricing requires 1 args'
255
    sys.exit(1)
256
  pp.pprint(client.getAllItemPricing(eval(args[0]),))
257
 
258
elif cmd == 'addVendorItemPricing':
259
  if len(args) != 1:
260
    print 'addVendorItemPricing requires 1 args'
261
    sys.exit(1)
262
  pp.pprint(client.addVendorItemPricing(eval(args[0]),))
263
 
264
elif cmd == 'getVendor':
265
  if len(args) != 1:
266
    print 'getVendor requires 1 args'
267
    sys.exit(1)
268
  pp.pprint(client.getVendor(eval(args[0]),))
269
 
270
elif cmd == 'getAllVendors':
271
  if len(args) != 0:
272
    print 'getAllVendors requires 0 args'
273
    sys.exit(1)
274
  pp.pprint(client.getAllVendors())
275
 
276
elif cmd == 'addVendorItemMapping':
277
  if len(args) != 2:
278
    print 'addVendorItemMapping requires 2 args'
279
    sys.exit(1)
280
  pp.pprint(client.addVendorItemMapping(args[0],eval(args[1]),))
281
 
282
elif cmd == 'getVendorItemMappings':
283
  if len(args) != 1:
284
    print 'getVendorItemMappings requires 1 args'
285
    sys.exit(1)
286
  pp.pprint(client.getVendorItemMappings(eval(args[0]),))
287
 
288
elif cmd == 'getPendingOrdersInventory':
289
  if len(args) != 1:
290
    print 'getPendingOrdersInventory requires 1 args'
291
    sys.exit(1)
292
  pp.pprint(client.getPendingOrdersInventory(eval(args[0]),))
293
 
294
elif cmd == 'getWarehouses':
295
  if len(args) != 5:
296
    print 'getWarehouses requires 5 args'
297
    sys.exit(1)
298
  pp.pprint(client.getWarehouses(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
299
 
300
elif cmd == 'resetAvailability':
301
  if len(args) != 4:
302
    print 'resetAvailability requires 4 args'
303
    sys.exit(1)
304
  pp.pprint(client.resetAvailability(args[0],eval(args[1]),eval(args[2]),eval(args[3]),))
305
 
306
elif cmd == 'resetAvailabilityForWarehouse':
307
  if len(args) != 1:
308
    print 'resetAvailabilityForWarehouse requires 1 args'
309
    sys.exit(1)
310
  pp.pprint(client.resetAvailabilityForWarehouse(eval(args[0]),))
311
 
312
elif cmd == 'getItemKeysToBeProcessed':
313
  if len(args) != 1:
314
    print 'getItemKeysToBeProcessed requires 1 args'
315
    sys.exit(1)
316
  pp.pprint(client.getItemKeysToBeProcessed(eval(args[0]),))
317
 
318
elif cmd == 'markMissedInventoryUpdatesAsProcessed':
319
  if len(args) != 2:
320
    print 'markMissedInventoryUpdatesAsProcessed requires 2 args'
321
    sys.exit(1)
322
  pp.pprint(client.markMissedInventoryUpdatesAsProcessed(args[0],eval(args[1]),))
323
 
324
elif cmd == 'getIgnoredItemKeys':
325
  if len(args) != 0:
326
    print 'getIgnoredItemKeys requires 0 args'
327
    sys.exit(1)
328
  pp.pprint(client.getIgnoredItemKeys())
329
 
330
elif cmd == 'addBadInventory':
331
  if len(args) != 3:
332
    print 'addBadInventory requires 3 args'
333
    sys.exit(1)
334
  pp.pprint(client.addBadInventory(eval(args[0]),eval(args[1]),eval(args[2]),))
335
 
336
elif cmd == 'getShippingLocations':
337
  if len(args) != 0:
338
    print 'getShippingLocations requires 0 args'
339
    sys.exit(1)
340
  pp.pprint(client.getShippingLocations())
341
 
342
elif cmd == 'getAllVendorItemMappings':
343
  if len(args) != 0:
344
    print 'getAllVendorItemMappings requires 0 args'
345
    sys.exit(1)
346
  pp.pprint(client.getAllVendorItemMappings())
347
 
348
elif cmd == 'getInventorySnapshot':
349
  if len(args) != 1:
350
    print 'getInventorySnapshot requires 1 args'
351
    sys.exit(1)
352
  pp.pprint(client.getInventorySnapshot(eval(args[0]),))
353
 
354
elif cmd == 'clearItemAvailabilityCache':
355
  if len(args) != 0:
356
    print 'clearItemAvailabilityCache requires 0 args'
357
    sys.exit(1)
358
  pp.pprint(client.clearItemAvailabilityCache())
359
 
360
elif cmd == 'updateVendorString':
361
  if len(args) != 2:
362
    print 'updateVendorString requires 2 args'
363
    sys.exit(1)
364
  pp.pprint(client.updateVendorString(eval(args[0]),args[1],))
365
 
6096 amit.gupta 366
elif cmd == 'clearItemAvailabilityCacheForItem':
367
  if len(args) != 1:
368
    print 'clearItemAvailabilityCacheForItem requires 1 args'
369
    sys.exit(1)
370
  pp.pprint(client.clearItemAvailabilityCacheForItem(eval(args[0]),))
371
 
6531 vikram.rag 372
elif cmd == 'getOurWarehouseIdForVendor':
7808 anupam.sin 373
  if len(args) != 2:
374
    print 'getOurWarehouseIdForVendor requires 2 args'
6531 vikram.rag 375
    sys.exit(1)
7808 anupam.sin 376
  pp.pprint(client.getOurWarehouseIdForVendor(eval(args[0]),eval(args[1]),))
6531 vikram.rag 377
 
378
elif cmd == 'getItemAvailabilitiesAtOurWarehouses':
379
  if len(args) != 1:
380
    print 'getItemAvailabilitiesAtOurWarehouses requires 1 args'
381
    sys.exit(1)
382
  pp.pprint(client.getItemAvailabilitiesAtOurWarehouses(eval(args[0]),))
383
 
384
elif cmd == 'getMonitoredWarehouseForVendors':
385
  if len(args) != 1:
386
    print 'getMonitoredWarehouseForVendors requires 1 args'
387
    sys.exit(1)
388
  pp.pprint(client.getMonitoredWarehouseForVendors(eval(args[0]),))
389
 
390
elif cmd == 'getIgnoredWarehouseidsAndItemids':
391
  if len(args) != 0:
392
    print 'getIgnoredWarehouseidsAndItemids requires 0 args'
393
    sys.exit(1)
394
  pp.pprint(client.getIgnoredWarehouseidsAndItemids())
395
 
396
elif cmd == 'insertItemtoIgnoreInventoryUpdatelist':
397
  if len(args) != 2:
398
    print 'insertItemtoIgnoreInventoryUpdatelist requires 2 args'
399
    sys.exit(1)
400
  pp.pprint(client.insertItemtoIgnoreInventoryUpdatelist(eval(args[0]),eval(args[1]),))
401
 
402
elif cmd == 'deleteItemFromIgnoredInventoryUpdateList':
403
  if len(args) != 2:
404
    print 'deleteItemFromIgnoredInventoryUpdateList requires 2 args'
405
    sys.exit(1)
406
  pp.pprint(client.deleteItemFromIgnoredInventoryUpdateList(eval(args[0]),eval(args[1]),))
407
 
408
elif cmd == 'getAllIgnoredInventoryupdateItemsCount':
409
  if len(args) != 0:
410
    print 'getAllIgnoredInventoryupdateItemsCount requires 0 args'
411
    sys.exit(1)
412
  pp.pprint(client.getAllIgnoredInventoryupdateItemsCount())
413
 
414
elif cmd == 'getIgnoredInventoryUpdateItemids':
415
  if len(args) != 2:
416
    print 'getIgnoredInventoryUpdateItemids requires 2 args'
417
    sys.exit(1)
418
  pp.pprint(client.getIgnoredInventoryUpdateItemids(eval(args[0]),eval(args[1]),))
419
 
7330 amit.gupta 420
elif cmd == 'updateItemStockPurchaseParams':
421
  if len(args) != 3:
422
    print 'updateItemStockPurchaseParams requires 3 args'
423
    sys.exit(1)
424
  pp.pprint(client.updateItemStockPurchaseParams(eval(args[0]),eval(args[1]),eval(args[2]),))
425
 
426
elif cmd == 'getItemStockPurchaseParams':
427
  if len(args) != 1:
428
    print 'getItemStockPurchaseParams requires 1 args'
429
    sys.exit(1)
430
  pp.pprint(client.getItemStockPurchaseParams(eval(args[0]),))
431
 
432
elif cmd == 'addOosStatusForItem':
433
  if len(args) != 2:
434
    print 'addOosStatusForItem requires 2 args'
435
    sys.exit(1)
436
  pp.pprint(client.addOosStatusForItem(eval(args[0]),eval(args[1]),))
437
 
438
elif cmd == 'getOosStatusesForXDaysForItem':
9665 rajveer 439
  if len(args) != 3:
440
    print 'getOosStatusesForXDaysForItem requires 3 args'
7330 amit.gupta 441
    sys.exit(1)
9665 rajveer 442
  pp.pprint(client.getOosStatusesForXDaysForItem(eval(args[0]),eval(args[1]),eval(args[2]),))
7330 amit.gupta 443
 
10450 vikram.rag 444
elif cmd == 'getOosStatusesForXDays':
445
  if len(args) != 2:
446
    print 'getOosStatusesForXDays requires 2 args'
447
    sys.exit(1)
448
  pp.pprint(client.getOosStatusesForXDays(eval(args[0]),eval(args[1]),))
449
 
450
elif cmd == 'getAllVendorItemPricing':
451
  if len(args) != 2:
452
    print 'getAllVendorItemPricing requires 2 args'
453
    sys.exit(1)
454
  pp.pprint(client.getAllVendorItemPricing(eval(args[0]),eval(args[1]),))
455
 
7330 amit.gupta 456
elif cmd == 'getNonZeroItemStockPurchaseParams':
457
  if len(args) != 0:
458
    print 'getNonZeroItemStockPurchaseParams requires 0 args'
459
    sys.exit(1)
460
  pp.pprint(client.getNonZeroItemStockPurchaseParams())
461
 
462
elif cmd == 'getBillableInventoryAndPendingOrders':
463
  if len(args) != 0:
464
    print 'getBillableInventoryAndPendingOrders requires 0 args'
465
    sys.exit(1)
466
  pp.pprint(client.getBillableInventoryAndPendingOrders())
467
 
468
elif cmd == 'getWarehouseName':
469
  if len(args) != 1:
470
    print 'getWarehouseName requires 1 args'
471
    sys.exit(1)
472
  pp.pprint(client.getWarehouseName(eval(args[0]),))
473
 
474
elif cmd == 'getAmazonInventoryForItem':
475
  if len(args) != 1:
476
    print 'getAmazonInventoryForItem requires 1 args'
477
    sys.exit(1)
478
  pp.pprint(client.getAmazonInventoryForItem(eval(args[0]),))
479
 
480
elif cmd == 'getAllAmazonInventory':
481
  if len(args) != 0:
482
    print 'getAllAmazonInventory requires 0 args'
483
    sys.exit(1)
484
  pp.pprint(client.getAllAmazonInventory())
485
 
486
elif cmd == 'addOrUpdateAmazonInventoryForItem':
10450 vikram.rag 487
  if len(args) != 2:
488
    print 'addOrUpdateAmazonInventoryForItem requires 2 args'
7330 amit.gupta 489
    sys.exit(1)
10450 vikram.rag 490
  pp.pprint(client.addOrUpdateAmazonInventoryForItem(eval(args[0]),eval(args[1]),))
7330 amit.gupta 491
 
8282 kshitij.so 492
elif cmd == 'getLastNdaySaleForItem':
493
  if len(args) != 2:
494
    print 'getLastNdaySaleForItem requires 2 args'
495
    sys.exit(1)
496
  pp.pprint(client.getLastNdaySaleForItem(eval(args[0]),eval(args[1]),))
497
 
498
elif cmd == 'addOrUpdateAmazonFbaInventory':
499
  if len(args) != 1:
500
    print 'addOrUpdateAmazonFbaInventory requires 1 args'
501
    sys.exit(1)
502
  pp.pprint(client.addOrUpdateAmazonFbaInventory(eval(args[0]),))
503
 
504
elif cmd == 'addUpdateHoldInventory':
505
  if len(args) != 4:
506
    print 'addUpdateHoldInventory requires 4 args'
507
    sys.exit(1)
508
  pp.pprint(client.addUpdateHoldInventory(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
509
 
510
elif cmd == 'getAmazonFbaItemInventory':
511
  if len(args) != 1:
512
    print 'getAmazonFbaItemInventory requires 1 args'
513
    sys.exit(1)
514
  pp.pprint(client.getAmazonFbaItemInventory(eval(args[0]),))
515
 
8955 vikram.rag 516
elif cmd == 'getAllAmazonFbaItemInventory':
8282 kshitij.so 517
  if len(args) != 0:
8955 vikram.rag 518
    print 'getAllAmazonFbaItemInventory requires 0 args'
8282 kshitij.so 519
    sys.exit(1)
8955 vikram.rag 520
  pp.pprint(client.getAllAmazonFbaItemInventory())
8282 kshitij.so 521
 
8955 vikram.rag 522
elif cmd == 'getOursGoodWarehouseIdsForLocation':
523
  if len(args) != 1:
524
    print 'getOursGoodWarehouseIdsForLocation requires 1 args'
525
    sys.exit(1)
526
  pp.pprint(client.getOursGoodWarehouseIdsForLocation(eval(args[0]),))
527
 
528
elif cmd == 'getHoldInventoryDetailForItemForWarehouseIdExceptSource':
529
  if len(args) != 3:
530
    print 'getHoldInventoryDetailForItemForWarehouseIdExceptSource requires 3 args'
531
    sys.exit(1)
532
  pp.pprint(client.getHoldInventoryDetailForItemForWarehouseIdExceptSource(eval(args[0]),eval(args[1]),eval(args[2]),))
533
 
9404 vikram.rag 534
elif cmd == 'getSnapdealInventoryForItem':
535
  if len(args) != 1:
536
    print 'getSnapdealInventoryForItem requires 1 args'
537
    sys.exit(1)
538
  pp.pprint(client.getSnapdealInventoryForItem(eval(args[0]),))
539
 
540
elif cmd == 'addOrUpdateSnapdealInventoryForItem':
541
  if len(args) != 1:
542
    print 'addOrUpdateSnapdealInventoryForItem requires 1 args'
543
    sys.exit(1)
544
  pp.pprint(client.addOrUpdateSnapdealInventoryForItem(eval(args[0]),))
545
 
546
elif cmd == 'getNlcForWarehouse':
547
  if len(args) != 2:
548
    print 'getNlcForWarehouse requires 2 args'
549
    sys.exit(1)
550
  pp.pprint(client.getNlcForWarehouse(eval(args[0]),eval(args[1]),))
551
 
9665 rajveer 552
elif cmd == 'getHeldInventoryMapForItem':
553
  if len(args) != 2:
554
    print 'getHeldInventoryMapForItem requires 2 args'
555
    sys.exit(1)
556
  pp.pprint(client.getHeldInventoryMapForItem(eval(args[0]),eval(args[1]),))
557
 
9482 vikram.rag 558
elif cmd == 'addOrUpdateAllAmazonFbaInventory':
559
  if len(args) != 1:
560
    print 'addOrUpdateAllAmazonFbaInventory requires 1 args'
561
    sys.exit(1)
562
  pp.pprint(client.addOrUpdateAllAmazonFbaInventory(eval(args[0]),))
563
 
9495 vikram.rag 564
elif cmd == 'addOrUpdateAllSnapdealInventory':
565
  if len(args) != 1:
566
    print 'addOrUpdateAllSnapdealInventory requires 1 args'
567
    sys.exit(1)
568
  pp.pprint(client.addOrUpdateAllSnapdealInventory(eval(args[0]),))
569
 
570
elif cmd == 'getSnapdealInventorySnapshot':
571
  if len(args) != 0:
572
    print 'getSnapdealInventorySnapshot requires 0 args'
573
    sys.exit(1)
574
  pp.pprint(client.getSnapdealInventorySnapshot())
575
 
10050 vikram.rag 576
elif cmd == 'getHoldInventoryDetails':
577
  if len(args) != 3:
578
    print 'getHoldInventoryDetails requires 3 args'
579
    sys.exit(1)
580
  pp.pprint(client.getHoldInventoryDetails(eval(args[0]),eval(args[1]),eval(args[2]),))
581
 
582
elif cmd == 'addOrUpdateFlipkartInventorySnapshot':
10450 vikram.rag 583
  if len(args) != 2:
584
    print 'addOrUpdateFlipkartInventorySnapshot requires 2 args'
10050 vikram.rag 585
    sys.exit(1)
10450 vikram.rag 586
  pp.pprint(client.addOrUpdateFlipkartInventorySnapshot(eval(args[0]),eval(args[1]),))
10050 vikram.rag 587
 
588
elif cmd == 'getFlipkartInventorySnapshot':
589
  if len(args) != 0:
590
    print 'getFlipkartInventorySnapshot requires 0 args'
591
    sys.exit(1)
592
  pp.pprint(client.getFlipkartInventorySnapshot())
593
 
10450 vikram.rag 594
elif cmd == 'getFlipkartlInventoryForItem':
595
  if len(args) != 1:
596
    print 'getFlipkartlInventoryForItem requires 1 args'
597
    sys.exit(1)
598
  pp.pprint(client.getFlipkartlInventoryForItem(eval(args[0]),))
599
 
10485 vikram.rag 600
elif cmd == 'getStateMaster':
601
  if len(args) != 0:
602
    print 'getStateMaster requires 0 args'
603
    sys.exit(1)
604
  pp.pprint(client.getStateMaster())
605
 
5944 mandeep.dh 606
else:
607
  print 'Unrecognized method %s' % cmd
608
  sys.exit(1)
609
 
610
transport.close()