Subversion Repositories SmartDukaan

Rev

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