Skip to content

Commit

Permalink
feat!: ClientAntennaActionsの対象のIDを指定する引数を削除 #140
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Jun 18, 2024
1 parent e09736b commit c9e52cc
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions mipac/actions/antenna.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,41 +199,28 @@ def __init__(self, *, antenna_id: str, session: HTTPClient, client: ClientManage
self.__antenna_id: str = antenna_id

@override
async def delete(self, *, antenna_id: str | None = None) -> bool:
async def delete(self) -> bool:
"""
Delete antenna from identifier
Parameters
----------
antenna_id : str | None, optional
target identifier
Returns
-------
bool
success or failure
"""
antenna_id = antenna_id or self.__antenna_id

return await super().delete(antenna_id=antenna_id)
return await super().delete(antenna_id=self.__antenna_id)

@override
async def show(self, *, antenna_id: str | None = None) -> Antenna:
async def show(self) -> Antenna:
"""Show antenna from identifier
Parameters
----------
antenna_id : str | None, optional
target identifier, by default None
Returns
-------
Antenna
antenna object
"""
antenna_id = antenna_id or self.__antenna_id

return await super().show(antenna_id=antenna_id)
return await super().show(antenna_id=self.__antenna_id)

@override
async def get_notes(
Expand All @@ -243,18 +230,14 @@ async def get_notes(
until_id: str | None = None,
since_date: str | None = None,
until_date: str | None = None,
*,
antenna_id: str | None = None,
) -> list[Note]:
antenna_id = antenna_id or self.__antenna_id

return await super().get_notes(
limit=limit,
since_id=since_id,
until_id=until_id,
since_date=since_date,
until_date=until_date,
antenna_id=antenna_id,
antenna_id=self.__antenna_id,
)

@override
Expand All @@ -265,13 +248,9 @@ async def get_all_notes(
until_id: str | None = None,
since_date: str | None = None,
until_date: str | None = None,
*,
antenna_id: str | None = None,
) -> AsyncGenerator[Note, None]:
antenna_id = antenna_id or self.__antenna_id

async for i in super().get_all_notes(
limit, since_id, until_id, since_date, until_date, antenna_id=antenna_id
limit, since_id, until_id, since_date, until_date, antenna_id=self.__antenna_id
):
yield i

Expand All @@ -288,8 +267,6 @@ async def update(
with_file: bool,
notify: bool,
user_list_id: str | None = None,
*,
antenna_id: str | None = None,
) -> Antenna:
"""Update an antenna.
Expand Down Expand Up @@ -321,8 +298,6 @@ async def update(
Antenna
The created antenna.
"""
antenna_id = antenna_id or self.__antenna_id

return await super().update(
name=name,
src=src,
Expand All @@ -334,7 +309,7 @@ async def update(
with_file=with_file,
notify=notify,
user_list_id=user_list_id,
antenna_id=antenna_id,
antenna_id=self.__antenna_id,
)


Expand Down

0 comments on commit c9e52cc

Please sign in to comment.