def set_json(self, json):
        """Set all attributes based on JSON response."""
        import time

        if 'access_token' in json:
            self.access_token = json['access_token']
            self.refresh_token = json['refresh_token']
            self.expires_in = json['expires_in']

            if 'authenticated' in json:
                self.authenticated = json['authenticated']
            else:
                self.authenticated = time.time()
        else:
            self.access_token = None
def set_json ( self , json ) : import time if 'access_token' in json : self . access_token = json [ 'access_token' ] self . refresh_token = json [ 'refresh_token' ] self . expires_in = json [ 'expires_in' ] if 'authenticated' in json : self . authenticated = json [ 'authenticated' ] else : self . authenticated = time . time ( ) else : self . access_token = None
Set all attributes based on JSON response.