diff options
author | Filipp Lepalaan <f@230.to> | 2013-06-10 20:47:30 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-06-10 20:47:30 +0300 |
commit | a01a92491adaf3bd063d55125701e81d01b58534 (patch) | |
tree | 9d15976d446ab9768fd9b18334d0293eb9b721d1 /gsxws/products.py | |
parent | 2f8a8907bb4985696f624f45982c2b6af9887674 (diff) | |
download | py-gsxws-a01a92491adaf3bd063d55125701e81d01b58534.tar.gz py-gsxws-a01a92491adaf3bd063d55125701e81d01b58534.tar.bz2 py-gsxws-a01a92491adaf3bd063d55125701e81d01b58534.zip |
Added parts argument to Product.warranty()
Diffstat (limited to 'gsxws/products.py')
-rw-r--r-- | gsxws/products.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gsxws/products.py b/gsxws/products.py index 3042109..252d97e 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -39,7 +39,7 @@ class Product(GsxObject): self.configCode = result.configCode return result - def warranty(self): + def warranty(self, parts=None): """ The Warranty Status API retrieves the same warranty details displayed on the GSX Coverage screen. @@ -51,7 +51,17 @@ class Product(GsxObject): u'Out Of Warranty (No Coverage)' >>> Product('DGKFL06JDHJP').warranty().estimatedPurchaseDate datetime.date(2011, 6, 2) + >>> Product('WQ8094DW0P1').warranty([(u'661-5070', u'Z26',)]) # doctest: +ELLIPSIS + {'warrantyStatus': 'Out Of Warranty (No Coverage)',... """ + try: + self.partNumbers = [] + for k, v in parts: + part = GsxObject(partNumber=k, comptiaCode=v) + self.partNumbers.append(part) + except Exception: + pass + self._submit("unitDetail", "WarrantyStatus", "warrantyDetailInfo") self.warrantyDetails = self._req.objects return self.warrantyDetails |