From d1232951b0be61a86af001aa3057b4b279574047 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Thu, 24 Jan 2013 21:40:14 +0200 Subject: Implement Repair Detail and Repair Status --- gsx.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gsx.py') diff --git a/gsx.py b/gsx.py index 53fde24..2aa38c1 100755 --- a/gsx.py +++ b/gsx.py @@ -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(): -- cgit v1.2.3