Remove unnecessary code and refactor API key revocation method

This commit is contained in:
2024-01-18 13:34:02 -05:00
parent 2c3e01bf19
commit aa4d4afa84
10 changed files with 2 additions and 2324 deletions
+2 -2
View File
@@ -84,7 +84,7 @@ class APIKey(NeonResource):
]
@classmethod
def revoke_request(cls, client, api_key):
def revoke_with(cls, client, api_key):
"""Revoke an API key, via object instance."""
obj = client.request("DELETE", f"api_keys/{ api_key.obj.id }")
@@ -94,7 +94,7 @@ class APIKey(NeonResource):
def revoke(self):
"""Revoke the API key."""
return self.revoke_request(self._client, self)
return self.revoke_with(self._client, self)
class User(NeonResource):