From 38004841ef15d5d1aa3cac99d096837d0c47799f Mon Sep 17 00:00:00 2001 From: Andrew Halberstadt Date: Sun, 22 Oct 2023 23:34:24 -0400 Subject: [PATCH] feat: rename 'client._make_request' to 'client.request' This makes it easier for consumers to specify the method dynamically. --- src/simple_github/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simple_github/client.py b/src/simple_github/client.py index 7d45a2f..cd76a81 100644 --- a/src/simple_github/client.py +++ b/src/simple_github/client.py @@ -79,7 +79,7 @@ async def _get_aiohttp_session(self) -> ClientSession: assert session.transport.session return session.transport.session - async def _make_request(self, method: str, query: str, **kwargs) -> Response: + async def request(self, method: str, query: str, **kwargs) -> Response: """Make a request to Github's REST API. Args: @@ -111,7 +111,7 @@ async def get(self, query: str) -> Response: Returns: Dict: The JSON result of the request. """ - return await self._make_request("GET", query) + return await self.request("GET", query) async def post(self, query: str, data: Optional[Dict] = None) -> Response: """Make a POST request to Github's REST API. @@ -123,7 +123,7 @@ async def post(self, query: str, data: Optional[Dict] = None) -> Response: Returns: Dict: The JSON result of the request. """ - return await self._make_request("POST", query, data=json.dumps(data)) + return await self.request("POST", query, data=json.dumps(data)) async def execute(self, query: str, variables: Optional[Dict] = None) -> Dict: """Execute a query against Github's GraphQL endpoint.