Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 768-792 (lines=25) @@
765
766
        return self._send_xml_command(cmd)
767
768
    def get_tickets(
769
        self,
770
        *,
771
        trash: Optional[bool] = None,
772
        filter: Optional[str] = None,
773
        filter_id: Optional[str] = None,
774
    ) -> Any:
775
        """Request a list of tickets
776
777
        Arguments:
778
            filter: Filter term to use for the query
779
            filter_id: UUID of an existing filter to use for the query
780
            trash: True to request the tickets in the trashcan
781
782
        Returns:
783
            The response. See :py:meth:`send_command` for details.
784
        """
785
        cmd = XmlCommand("get_tickets")
786
787
        add_filter(cmd, filter, filter_id)
788
789
        if trash is not None:
790
            cmd.set_attribute("trash", to_bool(trash))
791
792
        return self._send_xml_command(cmd)
793
794
    def get_ticket(self, ticket_id: str) -> Any:
795
        """Request a single ticket
@@ 1944-1968 (lines=25) @@
1941
        cmd.set_attribute("details", "1")
1942
        return self._send_xml_command(cmd)
1943
1944
    def get_roles(
1945
        self,
1946
        *,
1947
        filter: Optional[str] = None,
1948
        filter_id: Optional[str] = None,
1949
        trash: Optional[bool] = None,
1950
    ) -> Any:
1951
        """Request a list of roles
1952
1953
        Arguments:
1954
            filter: Filter term to use for the query
1955
            filter_id: UUID of an existing filter to use for the query
1956
            trash: Whether to get the trashcan roles instead
1957
1958
        Returns:
1959
            The response. See :py:meth:`send_command` for details.
1960
        """
1961
        cmd = XmlCommand("get_roles")
1962
1963
        add_filter(cmd, filter, filter_id)
1964
1965
        if trash is not None:
1966
            cmd.set_attribute("trash", to_bool(trash))
1967
1968
        return self._send_xml_command(cmd)
1969
1970
    def get_role(self, role_id: str) -> Any:
1971
        """Request a single role
@@ 1768-1792 (lines=25) @@
1765
        cmd.set_attribute("group_id", group_id)
1766
        return self._send_xml_command(cmd)
1767
1768
    def get_permissions(
1769
        self,
1770
        *,
1771
        filter: Optional[str] = None,
1772
        filter_id: Optional[str] = None,
1773
        trash: Optional[bool] = None,
1774
    ) -> Any:
1775
        """Request a list of permissions
1776
1777
        Arguments:
1778
            filter: Filter term to use for the query
1779
            filter_id: UUID of an existing filter to use for the query
1780
            trash: Whether to get permissions in the trashcan instead
1781
1782
        Returns:
1783
            The response. See :py:meth:`send_command` for details.
1784
        """
1785
        cmd = XmlCommand("get_permissions")
1786
1787
        add_filter(cmd, filter, filter_id)
1788
1789
        if trash is not None:
1790
            cmd.set_attribute("trash", to_bool(trash))
1791
1792
        return self._send_xml_command(cmd)
1793
1794
    def get_permission(self, permission_id: str) -> Any:
1795
        """Request a single permission
@@ 1723-1747 (lines=25) @@
1720
1721
        return self._send_xml_command(cmd)
1722
1723
    def get_groups(
1724
        self,
1725
        *,
1726
        filter: Optional[str] = None,
1727
        filter_id: Optional[str] = None,
1728
        trash: Optional[bool] = None,
1729
    ) -> Any:
1730
        """Request a list of groups
1731
1732
        Arguments:
1733
            filter: Filter term to use for the query
1734
            filter_id: UUID of an existing filter to use for the query
1735
            trash: Whether to get the trashcan groups instead
1736
1737
        Returns:
1738
            The response. See :py:meth:`send_command` for details.
1739
        """
1740
        cmd = XmlCommand("get_groups")
1741
1742
        add_filter(cmd, filter, filter_id)
1743
1744
        if trash is not None:
1745
            cmd.set_attribute("trash", to_bool(trash))
1746
1747
        return self._send_xml_command(cmd)
1748
1749
    def get_group(self, group_id: str) -> Any:
1750
        """Request a single group