Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 5461-5485 (lines=25) @@
5458
        cmd.set_attribute("details", "1")
5459
        return self._send_xml_command(cmd)
5460
5461
    def get_roles(
5462
        self,
5463
        *,
5464
        filter: Optional[str] = None,
5465
        filter_id: Optional[str] = None,
5466
        trash: Optional[bool] = None,
5467
    ) -> Any:
5468
        """Request a list of roles
5469
5470
        Arguments:
5471
            filter: Filter term to use for the query
5472
            filter_id: UUID of an existing filter to use for the query
5473
            trash: Whether to get the trashcan roles instead
5474
5475
        Returns:
5476
            The response. See :py:meth:`send_command` for details.
5477
        """
5478
        cmd = XmlCommand("get_roles")
5479
5480
        _add_filter(cmd, filter, filter_id)
5481
5482
        if trash is not None:
5483
            cmd.set_attribute("trash", _to_bool(trash))
5484
5485
        return self._send_xml_command(cmd)
5486
5487
    def get_role(self, role_id: str) -> Any:
5488
        """Request a single role
@@ 5065-5089 (lines=25) @@
5062
        cmd.set_attribute("details", "1")
5063
        return self._send_xml_command(cmd)
5064
5065
    def get_permissions(
5066
        self,
5067
        *,
5068
        filter: Optional[str] = None,
5069
        filter_id: Optional[str] = None,
5070
        trash: Optional[bool] = None,
5071
    ) -> Any:
5072
        """Request a list of permissions
5073
5074
        Arguments:
5075
            filter: Filter term to use for the query
5076
            filter_id: UUID of an existing filter to use for the query
5077
            trash: Whether to get permissions in the trashcan instead
5078
5079
        Returns:
5080
            The response. See :py:meth:`send_command` for details.
5081
        """
5082
        cmd = XmlCommand("get_permissions")
5083
5084
        _add_filter(cmd, filter, filter_id)
5085
5086
        if trash is not None:
5087
            cmd.set_attribute("trash", _to_bool(trash))
5088
5089
        return self._send_xml_command(cmd)
5090
5091
    def get_permission(self, permission_id: str) -> Any:
5092
        """Request a single permission
@@ 4814-4838 (lines=25) @@
4811
4812
        return self._send_xml_command(cmd)
4813
4814
    def get_groups(
4815
        self,
4816
        *,
4817
        filter: Optional[str] = None,
4818
        filter_id: Optional[str] = None,
4819
        trash: Optional[bool] = None,
4820
    ) -> Any:
4821
        """Request a list of groups
4822
4823
        Arguments:
4824
            filter: Filter term to use for the query
4825
            filter_id: UUID of an existing filter to use for the query
4826
            trash: Whether to get the trashcan groups instead
4827
4828
        Returns:
4829
            The response. See :py:meth:`send_command` for details.
4830
        """
4831
        cmd = XmlCommand("get_groups")
4832
4833
        _add_filter(cmd, filter, filter_id)
4834
4835
        if trash is not None:
4836
            cmd.set_attribute("trash", _to_bool(trash))
4837
4838
        return self._send_xml_command(cmd)
4839
4840
    def get_group(self, group_id: str) -> Any:
4841
        """Request a single group
@@ 2863-2887 (lines=25) @@
2860
2861
        return self._send_xml_command(cmd)
2862
2863
    def get_tickets(
2864
        self,
2865
        *,
2866
        trash: Optional[bool] = None,
2867
        filter: Optional[str] = None,
2868
        filter_id: Optional[str] = None,
2869
    ) -> Any:
2870
        """Request a list of tickets
2871
2872
        Arguments:
2873
            filter: Filter term to use for the query
2874
            filter_id: UUID of an existing filter to use for the query
2875
            trash: True to request the tickets in the trashcan
2876
2877
        Returns:
2878
            The response. See :py:meth:`send_command` for details.
2879
        """
2880
        cmd = XmlCommand("get_tickets")
2881
2882
        _add_filter(cmd, filter, filter_id)
2883
2884
        if trash is not None:
2885
            cmd.set_attribute("trash", _to_bool(trash))
2886
2887
        return self._send_xml_command(cmd)
2888
2889
    def get_ticket(self, ticket_id: str) -> Any:
2890
        """Request a single ticket