From aab561a9cfee49977147dedeab77ad9e2bbfd8fe Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 Aug 2015 14:54:10 +0300 Subject: Fixed SymptomIssue API support --- gsxws/core.py | 5 +++++ gsxws/repairs.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gsxws/core.py b/gsxws/core.py index d5b6d5e..55a086f 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -307,6 +307,11 @@ class GsxRequest(object): root.append(self.data) else: request_name = method + "Request" + + # @hack for Reported Symptom/Issue API which nests two ReportedSymptomIssueRequest elements + if method.endswith("Request"): + request_name = method + request = ET.SubElement(root, request_name) request.append(GSX_SESSION) diff --git a/gsxws/repairs.py b/gsxws/repairs.py index 15186a7..52945b7 100644 --- a/gsxws/repairs.py +++ b/gsxws/repairs.py @@ -54,9 +54,9 @@ class SymptomIssue(GsxObject): _namespace = "asp:" def fetch(self): - self._submit("requestData", "ReportedSymptomIssue", + self._submit("requestData", "ReportedSymptomIssueRequest", "ReportedSymptomIssueResponse") - return self._req.objects + return self._req.objects.reportedSymptomIssueResponse class Customer(GsxObject): -- cgit v1.2.3