From 774c8ed94e07f75fe38d5067dfea9b19bb32e77d Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 13 Aug 2013 10:49:28 +0300 Subject: Added WholeUnitExchange --- gsxws/repairs.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gsxws/repairs.py') diff --git a/gsxws/repairs.py b/gsxws/repairs.py index be01a1b..79049fb 100644 --- a/gsxws/repairs.py +++ b/gsxws/repairs.py @@ -45,7 +45,6 @@ class RepairOrderLine(GsxObject): class ServicePart(GsxObject): "A generic service part (for PartInfo and whatnot)" - def __init__(self, number, *args, **kwargs): super(ServicePart, self).__init__(*args, **kwargs) @@ -57,12 +56,9 @@ class ServicePart(GsxObject): class Repair(GsxObject): "Base class for the different GSX Repair types" - def __init__(self, number=None, **kwargs): - self._namespace = "asp:" super(Repair, self).__init__(**kwargs) - if number is not None: self.dispatchId = number @@ -267,6 +263,20 @@ class IndirectOnsiteRepair(Repair): "repairConfirmation") +class WholeUnitExchange(Repair): + """ + The Create Whole Unit Exchange API allows the service providers to send + all the information required to create a whole unit exchange repair. + GSX validates the information and if all the validations go through, + it obtains a quote for repair and creates the whole unit exchange repair. + The quote is sent as part of the response. + If a validation error occurs, a fault code is issued. + """ + def create(self): + self._namespace = "asp:" + return self._submit("repairData", "CreateWholeUnitExchange", "repairConfirmation") + + if __name__ == '__main__': import doctest from core import connect -- cgit v1.2.3