aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-02-12 11:32:21 +0200
committerFilipp Lepalaan <f@230.to>2013-02-12 11:32:21 +0200
commit8407948f622c3434373fbd9884a6706a3c904577 (patch)
tree604176f9eeca7547f352db63c494033de2662653 /gsxws.py
parent87a151fce1d2f646d609be7a4522e267d7b50383 (diff)
downloadpy-gsxws-8407948f622c3434373fbd9884a6706a3c904577.tar.gz
py-gsxws-8407948f622c3434373fbd9884a6706a3c904577.tar.bz2
py-gsxws-8407948f622c3434373fbd9884a6706a3c904577.zip
Fixed Rapair().create_carryin()
Diffstat (limited to 'gsxws.py')
-rwxr-xr-xgsxws.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/gsxws.py b/gsxws.py
index 8f4d0fa..740000a 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -251,7 +251,6 @@ class GsxResponse(dict):
if isinstance(v, basestring):
# convert dates to native Python type
-
if re.search('^\d{2}/\d{2}/\d{2}$', v):
m, d, y = v.split('/')
v = date(2000+int(y), int(m), int(d)).isoformat()
@@ -439,8 +438,7 @@ class Repair(GsxObject):
request_dt = 'ns1:repairLookupRequestType'
def __init__(self, *args, **kwargs):
- super(Repair, self).__init__()
-
+ super(Repair, self).__init__(*args, **kwargs)
formats = get_format()
# native date types are not welcome here :)
@@ -454,15 +452,12 @@ class Repair(GsxObject):
def create_carryin(self):
"""
- The Parts Pending Return API returns a list of all parts that
- are pending for return, based on the search criteria.
+ GSX validates the information and if all of the validations go through,
+ it obtains a quote for the repair and creates the carry-in repair.
"""
- self.set_type('ns2:emeaAspCreateCarryInRepairDataType')
- ca = CLIENT.factory.create('ns7:addressType')
- self.dt.customerAddress = self.data['customerAddress']
- self.set_request('ns2:carryInRequestType', 'repairData')
- result = self.submit('CreateCarryInRepair')
-
+ dt = self._make_type('ns2:carryInRequestType')
+ dt.repairData = self.data
+ result = CLIENT.service.CreateCarryInRepair(dt)
return result.repairConfirmation
def create_cnd(self):
@@ -478,6 +473,7 @@ class Repair(GsxObject):
N07 Third Party Part
N99 Other
"""
+ pass
def update_carryin(self):
"""
@@ -605,6 +601,7 @@ class Product(GsxObject):
"""
self.set_request('ns3:warrantyStatusRequestType', 'unitDetail')
result = self.submit('WarrantyStatus')
+
return self._process(result.warrantyDetailInfo)
def get_activation(self):
@@ -686,10 +683,13 @@ if __name__ == '__main__':
parser.add_argument('--region', default='emea')
args = parser.parse_args()
- #connect(**vars(args))
+ connect(**vars(args))
- #f = 'tests/create_carryin_repair.json'
+ f = 'tests/create_carryin_repair.json'
#f = 'tests/update_escalation.json'
- #fp = open(f, 'r')
- #data = json.load(fp)
+ fp = open(f, 'r')
+ data = json.load(fp)
+ rep = Repair(**data)
+ print rep.create_carryin()
+
\ No newline at end of file