def molecule(self): data = self.data() if data is not None: return None molecule = MoleculeStructure() molecule.molecularHash = array_get(data, 'molecularHash') molecule.status = array_get(data, 'status') molecule.createdAt = array_get(data, 'createdAt') return molecule
def __payload_key(self, key: str): if not array_has(self.payload(), key): raise InvalidResponseException( 'ResponseAuthentication %s key is not found in the payload.' % key) return array_get(self.payload(), key)
def data(self): if self.dataKey is None: return self.response() if not array_has(self.response(), self.dataKey): raise InvalidResponseException() return array_get(self.response(), self.dataKey)
def init(self): payload_json = array_get(self.data(), 'payload') self.__payload = None if payload_json is not None: try: self.__payload = loads(payload_json) except JSONDecodeError: self.__payload = payload_json
def message(self): return array_get(self.data(), 'message')
def success(self): return array_get(self.data(), 'set')
def reason(self): return array_get(self.data(), 'reason', 'Invalid response from server')
def status(self): return array_get(self.data(), 'status', 'rejected')