aboutsummaryrefslogtreecommitdiffstats
path: root/gsx.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-02-03 22:41:54 +0200
committerFilipp Lepalaan <f@230.to>2013-02-03 22:41:54 +0200
commit2e129da232d248ed8eb8dccbafa3d2f8f5ceb0f4 (patch)
treea0670f53af23d6803308f152eb231af749959bf9 /gsx.py
parentd1232951b0be61a86af001aa3057b4b279574047 (diff)
downloadpy-gsxws-2e129da232d248ed8eb8dccbafa3d2f8f5ceb0f4.tar.gz
py-gsxws-2e129da232d248ed8eb8dccbafa3d2f8f5ceb0f4.tar.bz2
py-gsxws-2e129da232d248ed8eb8dccbafa3d2f8f5ceb0f4.zip
setup.py name change
Diffstat (limited to 'gsx.py')
-rwxr-xr-xgsx.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/gsx.py b/gsx.py
index 2aa38c1..da7d6ea 100755
--- a/gsx.py
+++ b/gsx.py
@@ -98,7 +98,15 @@ class GsxObject(object):
return result
def _make_type(self, new_dt):
- return CLIENT.factory.create(new_dt)
+ """
+ Creates the top-level datatype for the API call
+ """
+ dt = CLIENT.factory.create(new_dt)
+
+ if SESSION:
+ dt.userSession = SESSION
+
+ return dt
def _process(self, data):
"""
@@ -500,12 +508,16 @@ class Repair(GsxObject):
results = self.submit('RepairLookup')
return results
- def mark_complete(self):
+ def mark_complete(self, numbers=None):
"""
The Mark Repair Complete API allows a single or an array of
repair confirmation numbers to be submitted to GSX to be marked as complete.
"""
- pass
+ dt = self._make_type('ns1:markRepairCompleteRequestType')
+ dt.repairConfirmationNumbers = [self.data['dispatchId']]
+ result = CLIENT.service.MarkRepairComplete(dt)
+ print result
+ return result
def delete(self):
"""
@@ -522,7 +534,6 @@ class Repair(GsxObject):
for the submitted repair confirmation number(s).
"""
dt = self._make_type('ns1:repairStatusRequestType')
- dt.userSession = SESSION
dt.repairConfirmationNumbers = [self.data['dispatchId']]
result = CLIENT.service.RepairStatus(dt)
@@ -535,9 +546,8 @@ class Repair(GsxObject):
"""
The Repair Details API includes the shipment information similar to the Repair Lookup API.
"""
- dt = CLIENT.factory.create('ns0:repairDetailsRequestType')
+ dt = self._make_type('ns0:repairDetailsRequestType')
dt.dispatchId = self.data['dispatchId']
- dt.userSession = SESSION
results = CLIENT.service.RepairDetails(dt)
return results.lookupResponseData[0]