Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 3029-3053 (lines=25) @@
3026
        cmd.set_attribute("details", "1")
3027
        return self._send_xml_command(cmd)
3028
3029
    def get_roles(
3030
        self,
3031
        *,
3032
        filter: Optional[str] = None,
3033
        filter_id: Optional[str] = None,
3034
        trash: Optional[bool] = None,
3035
    ) -> Any:
3036
        """Request a list of roles
3037
3038
        Arguments:
3039
            filter: Filter term to use for the query
3040
            filter_id: UUID of an existing filter to use for the query
3041
            trash: Whether to get the trashcan roles instead
3042
3043
        Returns:
3044
            The response. See :py:meth:`send_command` for details.
3045
        """
3046
        cmd = XmlCommand("get_roles")
3047
3048
        add_filter(cmd, filter, filter_id)
3049
3050
        if trash is not None:
3051
            cmd.set_attribute("trash", to_bool(trash))
3052
3053
        return self._send_xml_command(cmd)
3054
3055
    def get_role(self, role_id: str) -> Any:
3056
        """Request a single role
@@ 2853-2877 (lines=25) @@
2850
        cmd.set_attribute("group_id", group_id)
2851
        return self._send_xml_command(cmd)
2852
2853
    def get_permissions(
2854
        self,
2855
        *,
2856
        filter: Optional[str] = None,
2857
        filter_id: Optional[str] = None,
2858
        trash: Optional[bool] = None,
2859
    ) -> Any:
2860
        """Request a list of permissions
2861
2862
        Arguments:
2863
            filter: Filter term to use for the query
2864
            filter_id: UUID of an existing filter to use for the query
2865
            trash: Whether to get permissions in the trashcan instead
2866
2867
        Returns:
2868
            The response. See :py:meth:`send_command` for details.
2869
        """
2870
        cmd = XmlCommand("get_permissions")
2871
2872
        add_filter(cmd, filter, filter_id)
2873
2874
        if trash is not None:
2875
            cmd.set_attribute("trash", to_bool(trash))
2876
2877
        return self._send_xml_command(cmd)
2878
2879
    def get_permission(self, permission_id: str) -> Any:
2880
        """Request a single permission
@@ 2808-2832 (lines=25) @@
2805
2806
        return self._send_xml_command(cmd)
2807
2808
    def get_groups(
2809
        self,
2810
        *,
2811
        filter: Optional[str] = None,
2812
        filter_id: Optional[str] = None,
2813
        trash: Optional[bool] = None,
2814
    ) -> Any:
2815
        """Request a list of groups
2816
2817
        Arguments:
2818
            filter: Filter term to use for the query
2819
            filter_id: UUID of an existing filter to use for the query
2820
            trash: Whether to get the trashcan groups instead
2821
2822
        Returns:
2823
            The response. See :py:meth:`send_command` for details.
2824
        """
2825
        cmd = XmlCommand("get_groups")
2826
2827
        add_filter(cmd, filter, filter_id)
2828
2829
        if trash is not None:
2830
            cmd.set_attribute("trash", to_bool(trash))
2831
2832
        return self._send_xml_command(cmd)
2833
2834
    def get_group(self, group_id: str) -> Any:
2835
        """Request a single group
@@ 1555-1579 (lines=25) @@
1552
1553
        return self._send_xml_command(cmd)
1554
1555
    def get_tickets(
1556
        self,
1557
        *,
1558
        trash: Optional[bool] = None,
1559
        filter: Optional[str] = None,
1560
        filter_id: Optional[str] = None,
1561
    ) -> Any:
1562
        """Request a list of tickets
1563
1564
        Arguments:
1565
            filter: Filter term to use for the query
1566
            filter_id: UUID of an existing filter to use for the query
1567
            trash: True to request the tickets in the trashcan
1568
1569
        Returns:
1570
            The response. See :py:meth:`send_command` for details.
1571
        """
1572
        cmd = XmlCommand("get_tickets")
1573
1574
        add_filter(cmd, filter, filter_id)
1575
1576
        if trash is not None:
1577
            cmd.set_attribute("trash", to_bool(trash))
1578
1579
        return self._send_xml_command(cmd)
1580
1581
    def get_ticket(self, ticket_id: str) -> Any:
1582
        """Request a single ticket