Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 5416-5440 (lines=25) @@
5413
        cmd.set_attribute("details", "1")
5414
        return self._send_xml_command(cmd)
5415
5416
    def get_roles(
5417
        self,
5418
        *,
5419
        filter: Optional[str] = None,
5420
        filter_id: Optional[str] = None,
5421
        trash: Optional[bool] = None,
5422
    ) -> Any:
5423
        """Request a list of roles
5424
5425
        Arguments:
5426
            filter: Filter term to use for the query
5427
            filter_id: UUID of an existing filter to use for the query
5428
            trash: Whether to get the trashcan roles instead
5429
5430
        Returns:
5431
            The response. See :py:meth:`send_command` for details.
5432
        """
5433
        cmd = XmlCommand("get_roles")
5434
5435
        add_filter(cmd, filter, filter_id)
5436
5437
        if trash is not None:
5438
            cmd.set_attribute("trash", to_bool(trash))
5439
5440
        return self._send_xml_command(cmd)
5441
5442
    def get_role(self, role_id: str) -> Any:
5443
        """Request a single role
@@ 5020-5044 (lines=25) @@
5017
        cmd.set_attribute("details", "1")
5018
        return self._send_xml_command(cmd)
5019
5020
    def get_permissions(
5021
        self,
5022
        *,
5023
        filter: Optional[str] = None,
5024
        filter_id: Optional[str] = None,
5025
        trash: Optional[bool] = None,
5026
    ) -> Any:
5027
        """Request a list of permissions
5028
5029
        Arguments:
5030
            filter: Filter term to use for the query
5031
            filter_id: UUID of an existing filter to use for the query
5032
            trash: Whether to get permissions in the trashcan instead
5033
5034
        Returns:
5035
            The response. See :py:meth:`send_command` for details.
5036
        """
5037
        cmd = XmlCommand("get_permissions")
5038
5039
        add_filter(cmd, filter, filter_id)
5040
5041
        if trash is not None:
5042
            cmd.set_attribute("trash", to_bool(trash))
5043
5044
        return self._send_xml_command(cmd)
5045
5046
    def get_permission(self, permission_id: str) -> Any:
5047
        """Request a single permission
@@ 4769-4793 (lines=25) @@
4766
4767
        return self._send_xml_command(cmd)
4768
4769
    def get_groups(
4770
        self,
4771
        *,
4772
        filter: Optional[str] = None,
4773
        filter_id: Optional[str] = None,
4774
        trash: Optional[bool] = None,
4775
    ) -> Any:
4776
        """Request a list of groups
4777
4778
        Arguments:
4779
            filter: Filter term to use for the query
4780
            filter_id: UUID of an existing filter to use for the query
4781
            trash: Whether to get the trashcan groups instead
4782
4783
        Returns:
4784
            The response. See :py:meth:`send_command` for details.
4785
        """
4786
        cmd = XmlCommand("get_groups")
4787
4788
        add_filter(cmd, filter, filter_id)
4789
4790
        if trash is not None:
4791
            cmd.set_attribute("trash", to_bool(trash))
4792
4793
        return self._send_xml_command(cmd)
4794
4795
    def get_group(self, group_id: str) -> Any:
4796
        """Request a single group
@@ 2818-2842 (lines=25) @@
2815
2816
        return self._send_xml_command(cmd)
2817
2818
    def get_tickets(
2819
        self,
2820
        *,
2821
        trash: Optional[bool] = None,
2822
        filter: Optional[str] = None,
2823
        filter_id: Optional[str] = None,
2824
    ) -> Any:
2825
        """Request a list of tickets
2826
2827
        Arguments:
2828
            filter: Filter term to use for the query
2829
            filter_id: UUID of an existing filter to use for the query
2830
            trash: True to request the tickets in the trashcan
2831
2832
        Returns:
2833
            The response. See :py:meth:`send_command` for details.
2834
        """
2835
        cmd = XmlCommand("get_tickets")
2836
2837
        add_filter(cmd, filter, filter_id)
2838
2839
        if trash is not None:
2840
            cmd.set_attribute("trash", to_bool(trash))
2841
2842
        return self._send_xml_command(cmd)
2843
2844
    def get_ticket(self, ticket_id: str) -> Any:
2845
        """Request a single ticket