Skip to content

Commit

Permalink
Change: Allow to pass a UUID instance as id for various methods
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernricks authored and greenbonebot committed Jun 14, 2024
1 parent ce16191 commit af01bfb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions gvm/protocols/gmp/_gmp224.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Aggregates,
AggregateStatistic,
Authentication,
EntityID,
EntityType,
Feed,
FeedType,
Expand Down Expand Up @@ -92,7 +93,7 @@ def get_version(self) -> T:
"""
return self._send_and_transform_command(Version.get_version())

def clone_port_list(self, port_list_id: str) -> T:
def clone_port_list(self, port_list_id: EntityID) -> T:
"""Clone an existing port list
Args:
Expand All @@ -119,7 +120,7 @@ def create_port_list(

def create_port_range(
self,
port_list_id: str,
port_list_id: EntityID,
start: int,
end: int,
port_range_type: Union[str, PortRangeType],
Expand All @@ -142,7 +143,7 @@ def create_port_range(
)

def delete_port_list(
self, port_list_id: str, *, ultimate: bool = False
self, port_list_id: EntityID, *, ultimate: bool = False
) -> T:
"""Delete an existing port list
Expand All @@ -154,7 +155,7 @@ def delete_port_list(
PortList.delete_port_list(port_list_id, ultimate=ultimate)
)

def delete_port_range(self, port_range_id: str) -> T:
def delete_port_range(self, port_range_id: EntityID) -> T:
"""Delete an existing port range
Args:
Expand All @@ -168,7 +169,7 @@ def get_port_lists(
self,
*,
filter_string: Optional[str] = None,
filter_id: Optional[str] = None,
filter_id: Optional[EntityID] = None,
details: Optional[bool] = None,
targets: Optional[bool] = None,
trash: Optional[bool] = None,
Expand All @@ -192,7 +193,7 @@ def get_port_lists(
)
)

def get_port_list(self, port_list_id: str) -> T:
def get_port_list(self, port_list_id: EntityID) -> T:
"""Request a single port list
Args:
Expand All @@ -204,7 +205,7 @@ def get_port_list(self, port_list_id: str) -> T:

def modify_port_list(
self,
port_list_id: str,
port_list_id: EntityID,
*,
comment: Optional[str] = None,
name: Optional[str] = None,
Expand All @@ -225,7 +226,7 @@ def get_aggregates(
resource_type: Union[EntityType, str],
*,
filter_string: Optional[str] = None,
filter_id: Optional[str] = None,
filter_id: Optional[EntityID] = None,
sort_criteria: Optional[
Iterable[dict[str, Union[str, SortOrder, AggregateStatistic]]]
] = None,
Expand Down Expand Up @@ -313,7 +314,7 @@ def system_reports(
start_time: Optional[str] = None,
end_time: Optional[str] = None,
brief: Optional[bool] = None,
slave_id: Optional[str] = None,
slave_id: Optional[EntityID] = None,
) -> T:
"""Request a list of system reports
Expand Down Expand Up @@ -347,7 +348,7 @@ def empty_trash(self) -> T:
"""
return self._send_and_transform_command(TrashCan.empty_trashcan())

def restore_from_trash(self, entity_id: str) -> T:
def restore_from_trash(self, entity_id: EntityID) -> T:
"""Restore an entity from the trashcan
Args:
Expand All @@ -367,7 +368,7 @@ def get_user_settings(self, *, filter_string: Optional[str] = None) -> T:
UserSettings.get_user_settings(filter_string=filter_string)
)

def get_user_setting(self, setting_id: str) -> T:
def get_user_setting(self, setting_id: EntityID) -> T:
"""Request a single user setting
Args:
Expand All @@ -380,7 +381,7 @@ def get_user_setting(self, setting_id: str) -> T:
def modify_user_setting(
self,
*,
setting_id: Optional[str] = None,
setting_id: Optional[EntityID] = None,
name: Optional[str] = None,
value: Optional[str] = None,
) -> T:
Expand Down

0 comments on commit af01bfb

Please sign in to comment.