diff options
author | Filipp Lepalaan <f@0x00.co> | 2013-01-24 21:40:14 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@0x00.co> | 2013-01-24 21:40:14 +0200 |
commit | d1232951b0be61a86af001aa3057b4b279574047 (patch) | |
tree | 4a95c260ef2c67d5863fd8037d723a8abda87d0a | |
parent | 7f096a1c9e1da551e4505e1abf37ef4779df909c (diff) | |
download | py-gsxws-d1232951b0be61a86af001aa3057b4b279574047.tar.gz py-gsxws-d1232951b0be61a86af001aa3057b4b279574047.tar.bz2 py-gsxws-d1232951b0be61a86af001aa3057b4b279574047.zip |
Implement Repair Detail and Repair Status
-rwxr-xr-x | gsx.py | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -516,18 +516,30 @@ class Repair(GsxObject): """ pass - def get_status(): + def get_status(self, numbers=None): """ The Repair Status API retrieves the status for the submitted repair confirmation number(s). """ - pass + dt = self._make_type('ns1:repairStatusRequestType') + dt.userSession = SESSION + dt.repairConfirmationNumbers = [self.data['dispatchId']] + result = CLIENT.service.RepairStatus(dt) + + if len(result.repairStatus) == 1: + return result.repairStatus[0] + else: + return result.repairStatus def get_details(self): + """ + The Repair Details API includes the shipment information similar to the Repair Lookup API. + """ dt = CLIENT.factory.create('ns0:repairDetailsRequestType') dt.dispatchId = self.data['dispatchId'] dt.userSession = SESSION results = CLIENT.service.RepairDetails(dt) + return results.lookupResponseData[0] class Communication(GsxObject): def get_content(): |