| Line 21... |
Line 21... |
| 21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
21 |
print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
|
| 22 |
print ''
|
22 |
print ''
|
| 23 |
print 'Functions:'
|
23 |
print 'Functions:'
|
| 24 |
print ' i64 createTransaction(Transaction transaction)'
|
24 |
print ' i64 createTransaction(Transaction transaction)'
|
| 25 |
print ' Transaction getTransaction(i64 id)'
|
25 |
print ' Transaction getTransaction(i64 id)'
|
| 26 |
print ' getAllTransactions(TransactionStatus status, i64 from_date, i64 to_date, i64 warehouse_id)'
|
- |
|
| 27 |
print ' getTransactionsForShipmentStatus(ShipmentStatus status, i64 from_date, i64 to_date)'
|
- |
|
| 28 |
print ' getTransactionsForCustomer(i64 customerId, i64 from_date, i64 to_date, TransactionStatus status)'
|
26 |
print ' getTransactionsForCustomer(i64 customerId, i64 from_date, i64 to_date, TransactionStatus status)'
|
| 29 |
print ' getTransactionsForCustomerAndShipmentStatus(i64 customerId, i64 from_date, i64 to_date, ShipmentStatus status)'
|
- |
|
| 30 |
print ' getTransactionsForShoppingCartId(i64 shoppingCartId)'
|
27 |
print ' getTransactionsForShoppingCartId(i64 shoppingCartId)'
|
| 31 |
print ' TransactionStatus getTransactionStatus(i64 transactionId)'
|
28 |
print ' TransactionStatus getTransactionStatus(i64 transactionId)'
|
| 32 |
print ' bool changeTransactionStatus(i64 transactionId, TransactionStatus status, string description)'
|
29 |
print ' bool changeTransactionStatus(i64 transactionId, TransactionStatus status, string description)'
|
| 33 |
print ' OrderInfo getOrderInfo(i64 transactionId)'
|
30 |
print ' getAllOrders(OrderStatus status, i64 from_date, i64 to_date, i64 warehouse_id)'
|
| 34 |
print ' ShipmentInfo getShippingInfo(i64 transactionId)'
|
31 |
print ' bool changeOrderStatus(i64 orderId, OrderStatus status, string description)'
|
| 35 |
print ' BillingInfo getBillingInfo(i64 transactionId)'
|
32 |
print ' getOrdersForTransaction(i64 transactionId)'
|
| 36 |
print ' bool addBilling(i64 tranactionId, Billing billing)'
|
- |
|
| 37 |
print ' bool setShippingTracker(i64 transactionId, i64 shippingId, string trackingId, string airwayBillNo, string provider)'
|
33 |
print ' getOrdersForCustomer(i64 customerId, i64 from_date, i64 to_date, OrderStatus status)'
|
| 38 |
print ' bool setShippingDate(i64 transactionId, i64 shippingId, i64 timestamp)'
|
34 |
print ' i64 createOrder(Order order)'
|
| 39 |
print ' bool setDeliveryDate(i64 transactionId, i64 shippingid, i64 timestamp)'
|
35 |
print ' Order getOrder(i64 id)'
|
| 40 |
print ' bool changeShippingStatus(i64 transactionId, i64 shippingId, ShipmentStatus status, string description)'
|
- |
|
| 41 |
print ' bool addTrail(i64 transactionId, string description)'
|
36 |
print ' getLineItemsForOrder(i64 orderId)'
|
| 42 |
print ' getAlerts(i64 transactionId, bool valid)'
|
37 |
print ' getAlerts(i64 orderId, bool valid)'
|
| 43 |
print ' void setAlert(i64 transactionId, bool unset, i64 type, string comment)'
|
38 |
print ' void setAlert(i64 orderId, bool unset, i64 type, string comment)'
|
| 44 |
print ' ExtraOrderInfo getExtraInfo(i64 transaction_id)'
|
- |
|
| 45 |
print ' void setExtraInfo(i64 transaction_id, i64 sku_id, string model, string colour, string vendor)'
|
- |
|
| 46 |
print ''
|
39 |
print ''
|
| 47 |
sys.exit(0)
|
40 |
sys.exit(0)
|
| 48 |
|
41 |
|
| 49 |
pp = pprint.PrettyPrinter(indent = 2)
|
42 |
pp = pprint.PrettyPrinter(indent = 2)
|
| 50 |
host = 'localhost'
|
43 |
host = 'localhost'
|
| Line 101... |
Line 94... |
| 101 |
if len(args) != 1:
|
94 |
if len(args) != 1:
|
| 102 |
print 'getTransaction requires 1 args'
|
95 |
print 'getTransaction requires 1 args'
|
| 103 |
sys.exit(1)
|
96 |
sys.exit(1)
|
| 104 |
pp.pprint(client.getTransaction(eval(args[0]),))
|
97 |
pp.pprint(client.getTransaction(eval(args[0]),))
|
| 105 |
|
98 |
|
| 106 |
elif cmd == 'getAllTransactions':
|
- |
|
| 107 |
if len(args) != 4:
|
- |
|
| 108 |
print 'getAllTransactions requires 4 args'
|
- |
|
| 109 |
sys.exit(1)
|
- |
|
| 110 |
pp.pprint(client.getAllTransactions(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
- |
|
| 111 |
|
- |
|
| 112 |
elif cmd == 'getTransactionsForShipmentStatus':
|
- |
|
| 113 |
if len(args) != 3:
|
- |
|
| 114 |
print 'getTransactionsForShipmentStatus requires 3 args'
|
- |
|
| 115 |
sys.exit(1)
|
- |
|
| 116 |
pp.pprint(client.getTransactionsForShipmentStatus(eval(args[0]),eval(args[1]),eval(args[2]),))
|
- |
|
| 117 |
|
- |
|
| 118 |
elif cmd == 'getTransactionsForCustomer':
|
99 |
elif cmd == 'getTransactionsForCustomer':
|
| 119 |
if len(args) != 4:
|
100 |
if len(args) != 4:
|
| 120 |
print 'getTransactionsForCustomer requires 4 args'
|
101 |
print 'getTransactionsForCustomer requires 4 args'
|
| 121 |
sys.exit(1)
|
102 |
sys.exit(1)
|
| 122 |
pp.pprint(client.getTransactionsForCustomer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
103 |
pp.pprint(client.getTransactionsForCustomer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
| 123 |
|
104 |
|
| 124 |
elif cmd == 'getTransactionsForCustomerAndShipmentStatus':
|
- |
|
| 125 |
if len(args) != 4:
|
- |
|
| 126 |
print 'getTransactionsForCustomerAndShipmentStatus requires 4 args'
|
- |
|
| 127 |
sys.exit(1)
|
- |
|
| 128 |
pp.pprint(client.getTransactionsForCustomerAndShipmentStatus(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
- |
|
| 129 |
|
- |
|
| 130 |
elif cmd == 'getTransactionsForShoppingCartId':
|
105 |
elif cmd == 'getTransactionsForShoppingCartId':
|
| 131 |
if len(args) != 1:
|
106 |
if len(args) != 1:
|
| 132 |
print 'getTransactionsForShoppingCartId requires 1 args'
|
107 |
print 'getTransactionsForShoppingCartId requires 1 args'
|
| 133 |
sys.exit(1)
|
108 |
sys.exit(1)
|
| 134 |
pp.pprint(client.getTransactionsForShoppingCartId(eval(args[0]),))
|
109 |
pp.pprint(client.getTransactionsForShoppingCartId(eval(args[0]),))
|
| Line 143... |
Line 118... |
| 143 |
if len(args) != 3:
|
118 |
if len(args) != 3:
|
| 144 |
print 'changeTransactionStatus requires 3 args'
|
119 |
print 'changeTransactionStatus requires 3 args'
|
| 145 |
sys.exit(1)
|
120 |
sys.exit(1)
|
| 146 |
pp.pprint(client.changeTransactionStatus(eval(args[0]),eval(args[1]),args[2],))
|
121 |
pp.pprint(client.changeTransactionStatus(eval(args[0]),eval(args[1]),args[2],))
|
| 147 |
|
122 |
|
| 148 |
elif cmd == 'getOrderInfo':
|
123 |
elif cmd == 'getAllOrders':
|
| 149 |
if len(args) != 1:
|
124 |
if len(args) != 4:
|
| 150 |
print 'getOrderInfo requires 1 args'
|
125 |
print 'getAllOrders requires 4 args'
|
| 151 |
sys.exit(1)
|
126 |
sys.exit(1)
|
| 152 |
pp.pprint(client.getOrderInfo(eval(args[0]),))
|
127 |
pp.pprint(client.getAllOrders(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
| 153 |
|
128 |
|
| 154 |
elif cmd == 'getShippingInfo':
|
129 |
elif cmd == 'changeOrderStatus':
|
| 155 |
if len(args) != 1:
|
130 |
if len(args) != 3:
|
| 156 |
print 'getShippingInfo requires 1 args'
|
131 |
print 'changeOrderStatus requires 3 args'
|
| 157 |
sys.exit(1)
|
132 |
sys.exit(1)
|
| 158 |
pp.pprint(client.getShippingInfo(eval(args[0]),))
|
133 |
pp.pprint(client.changeOrderStatus(eval(args[0]),eval(args[1]),args[2],))
|
| 159 |
|
134 |
|
| 160 |
elif cmd == 'getBillingInfo':
|
135 |
elif cmd == 'getOrdersForTransaction':
|
| 161 |
if len(args) != 1:
|
136 |
if len(args) != 1:
|
| 162 |
print 'getBillingInfo requires 1 args'
|
137 |
print 'getOrdersForTransaction requires 1 args'
|
| 163 |
sys.exit(1)
|
- |
|
| 164 |
pp.pprint(client.getBillingInfo(eval(args[0]),))
|
- |
|
| 165 |
|
- |
|
| 166 |
elif cmd == 'addBilling':
|
- |
|
| 167 |
if len(args) != 2:
|
- |
|
| 168 |
print 'addBilling requires 2 args'
|
- |
|
| 169 |
sys.exit(1)
|
138 |
sys.exit(1)
|
| 170 |
pp.pprint(client.addBilling(eval(args[0]),eval(args[1]),))
|
139 |
pp.pprint(client.getOrdersForTransaction(eval(args[0]),))
|
| 171 |
|
140 |
|
| 172 |
elif cmd == 'setShippingTracker':
|
141 |
elif cmd == 'getOrdersForCustomer':
|
| 173 |
if len(args) != 5:
|
142 |
if len(args) != 4:
|
| 174 |
print 'setShippingTracker requires 5 args'
|
143 |
print 'getOrdersForCustomer requires 4 args'
|
| 175 |
sys.exit(1)
|
- |
|
| 176 |
pp.pprint(client.setShippingTracker(eval(args[0]),eval(args[1]),args[2],args[3],args[4],))
|
- |
|
| 177 |
|
- |
|
| 178 |
elif cmd == 'setShippingDate':
|
- |
|
| 179 |
if len(args) != 3:
|
- |
|
| 180 |
print 'setShippingDate requires 3 args'
|
- |
|
| 181 |
sys.exit(1)
|
144 |
sys.exit(1)
|
| 182 |
pp.pprint(client.setShippingDate(eval(args[0]),eval(args[1]),eval(args[2]),))
|
145 |
pp.pprint(client.getOrdersForCustomer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
|
| 183 |
|
146 |
|
| 184 |
elif cmd == 'setDeliveryDate':
|
147 |
elif cmd == 'createOrder':
|
| 185 |
if len(args) != 3:
|
148 |
if len(args) != 1:
|
| 186 |
print 'setDeliveryDate requires 3 args'
|
149 |
print 'createOrder requires 1 args'
|
| 187 |
sys.exit(1)
|
150 |
sys.exit(1)
|
| 188 |
pp.pprint(client.setDeliveryDate(eval(args[0]),eval(args[1]),eval(args[2]),))
|
151 |
pp.pprint(client.createOrder(eval(args[0]),))
|
| 189 |
|
152 |
|
| 190 |
elif cmd == 'changeShippingStatus':
|
153 |
elif cmd == 'getOrder':
|
| 191 |
if len(args) != 4:
|
154 |
if len(args) != 1:
|
| 192 |
print 'changeShippingStatus requires 4 args'
|
155 |
print 'getOrder requires 1 args'
|
| 193 |
sys.exit(1)
|
156 |
sys.exit(1)
|
| 194 |
pp.pprint(client.changeShippingStatus(eval(args[0]),eval(args[1]),eval(args[2]),args[3],))
|
157 |
pp.pprint(client.getOrder(eval(args[0]),))
|
| 195 |
|
158 |
|
| 196 |
elif cmd == 'addTrail':
|
159 |
elif cmd == 'getLineItemsForOrder':
|
| 197 |
if len(args) != 2:
|
160 |
if len(args) != 1:
|
| 198 |
print 'addTrail requires 2 args'
|
161 |
print 'getLineItemsForOrder requires 1 args'
|
| 199 |
sys.exit(1)
|
162 |
sys.exit(1)
|
| 200 |
pp.pprint(client.addTrail(eval(args[0]),args[1],))
|
163 |
pp.pprint(client.getLineItemsForOrder(eval(args[0]),))
|
| 201 |
|
164 |
|
| 202 |
elif cmd == 'getAlerts':
|
165 |
elif cmd == 'getAlerts':
|
| 203 |
if len(args) != 2:
|
166 |
if len(args) != 2:
|
| 204 |
print 'getAlerts requires 2 args'
|
167 |
print 'getAlerts requires 2 args'
|
| 205 |
sys.exit(1)
|
168 |
sys.exit(1)
|
| Line 209... |
Line 172... |
| 209 |
if len(args) != 4:
|
172 |
if len(args) != 4:
|
| 210 |
print 'setAlert requires 4 args'
|
173 |
print 'setAlert requires 4 args'
|
| 211 |
sys.exit(1)
|
174 |
sys.exit(1)
|
| 212 |
pp.pprint(client.setAlert(eval(args[0]),eval(args[1]),eval(args[2]),args[3],))
|
175 |
pp.pprint(client.setAlert(eval(args[0]),eval(args[1]),eval(args[2]),args[3],))
|
| 213 |
|
176 |
|
| 214 |
elif cmd == 'getExtraInfo':
|
- |
|
| 215 |
if len(args) != 1:
|
- |
|
| 216 |
print 'getExtraInfo requires 1 args'
|
- |
|
| 217 |
sys.exit(1)
|
- |
|
| 218 |
pp.pprint(client.getExtraInfo(eval(args[0]),))
|
- |
|
| 219 |
|
- |
|
| 220 |
elif cmd == 'setExtraInfo':
|
- |
|
| 221 |
if len(args) != 5:
|
- |
|
| 222 |
print 'setExtraInfo requires 5 args'
|
- |
|
| 223 |
sys.exit(1)
|
- |
|
| 224 |
pp.pprint(client.setExtraInfo(eval(args[0]),eval(args[1]),args[2],args[3],args[4],))
|
- |
|
| 225 |
|
- |
|
| 226 |
transport.close()
|
177 |
transport.close()
|