Skip to content

Commit

Permalink
feat: rename 'client._make_request' to 'client.request'
Browse files Browse the repository at this point in the history
This makes it easier for consumers to specify the method dynamically.
  • Loading branch information
ahal committed Oct 23, 2023
1 parent c890aa0 commit 3800484
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/simple_github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 3800484

Please sign in to comment.