-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnrollmentResponse.py
34 lines (27 loc) · 1.34 KB
/
EnrollmentResponse.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class EnrollmentResponse:
"""This class encapsulates the enrollment response."""
_ENROLLMENT_STATUS = 'enrollmentStatus'
_ENROLLMENTS_COUNT = 'enrollmentsCount'
_REMAINING_ENROLLMENTS = 'remainingEnrollments'
_ENROLLMENT_PHRASE = 'phrase'
def __init__(self, response):
"""Constructor of the EnrollmentResponse class.
Arguments:
response -- the dictionary of the deserialized python response
"""
self._enrollment_status = response.get(self._ENROLLMENT_STATUS, None)
self._enrollments_count = response.get(self._ENROLLMENTS_COUNT, None)
self._remaining_enrollments = response.get(self._REMAINING_ENROLLMENTS, None)
self._enrollment_phrase = response.get(self._ENROLLMENT_PHRASE, None)
def get_enrollment_status(self):
"""Returns the enrollment status"""
return self._enrollment_status
def get_enrollments_count(self):
"""Returns the number of enrollments already performed"""
return self._enrollments_count
def get_enrollment_phrase(self):
"""Returns the enrollment phrase extracted from this request"""
return self._enrollment_phrase
def get_remaining_enrollments(self):
"""Returns the number of remaining enrollments before the profile is ready for verification"""
return self._remaining_enrollments