Skip to content

Commit

Permalink
Adding compatibility wrapper for getinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
kvindascr committed Nov 6, 2024
1 parent abf99b0 commit 4592a25
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions src/airtop/wrapper/sessions_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,40 @@ def wait_for_session_ready(self, session_id: str, timeout_seconds: int = 60):

time.sleep(1)
return status

def getinfo(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SessionResponse:
"""
Get a session by ID
.. deprecated:: 0.0.22
Use :meth:`get_info` instead.
Parameters
----------
id : str
Id of the session to get
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SessionResponse
OK
Examples
--------
from airtop import Airtop
client = Airtop(
api_key="YOUR_API_KEY",
)
# This method is deprecated, use get_info instead:
client.sessions.get_info(
id="6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
)
"""
return super().get_info(id=id, request_options=request_options)



Expand Down Expand Up @@ -164,5 +198,47 @@ async def wait_for_session_ready(self, session_id: str, timeout_seconds: int = 6

time.sleep(1)
return status

async def getinfo(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> SessionResponse:
"""
Get a session by ID
.. deprecated:: 0.0.22
Use :meth:`get_info` instead.
Parameters
----------
id : str
Id of the session to get
request_options : typing.Optional[RequestOptions]
Request-specific configuration.
Returns
-------
SessionResponse
OK
Examples
--------
import asyncio
from airtop import AsyncAirtop
client = AsyncAirtop(
api_key="YOUR_API_KEY",
)
async def main() -> None:
# This method is deprecated, use get_info instead:
await client.sessions.get_info(
id="6aac6f73-bd89-4a76-ab32-5a6c422e8b0b",
)
asyncio.run(main())
"""
return await super().get_info(id=id, request_options=request_options)


0 comments on commit 4592a25

Please sign in to comment.