Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv7.py 3 locations

@@ 4208-4232 (lines=25) @@
4205
        cmd.set_attribute("details", "1")
4206
        return self._send_xml_command(cmd)
4207
4208
    def get_roles(
4209
        self,
4210
        *,
4211
        filter: Optional[str] = None,
4212
        filter_id: Optional[str] = None,
4213
        trash: Optional[bool] = None
4214
    ) -> Any:
4215
        """Request a list of roles
4216
4217
        Arguments:
4218
            filter: Filter term to use for the query
4219
            filter_id: UUID of an existing filter to use for the query
4220
            trash: Whether to get the trashcan roles instead
4221
4222
        Returns:
4223
            The response. See :py:meth:`send_command` for details.
4224
        """
4225
        cmd = XmlCommand("get_roles")
4226
4227
        _add_filter(cmd, filter, filter_id)
4228
4229
        if not trash is None:
4230
            cmd.set_attribute("trash", _to_bool(trash))
4231
4232
        return self._send_xml_command(cmd)
4233
4234
    def get_role(self, role_id: str) -> Any:
4235
        """Request a single role
@@ 3858-3882 (lines=25) @@
3855
        cmd.set_attribute("details", "1")
3856
        return self._send_xml_command(cmd)
3857
3858
    def get_permissions(
3859
        self,
3860
        *,
3861
        filter: Optional[str] = None,
3862
        filter_id: Optional[str] = None,
3863
        trash: Optional[bool] = None
3864
    ) -> Any:
3865
        """Request a list of permissions
3866
3867
        Arguments:
3868
            filter: Filter term to use for the query
3869
            filter_id: UUID of an existing filter to use for the query
3870
            trash: Whether to get permissions in the trashcan instead
3871
3872
        Returns:
3873
            The response. See :py:meth:`send_command` for details.
3874
        """
3875
        cmd = XmlCommand("get_permissions")
3876
3877
        _add_filter(cmd, filter, filter_id)
3878
3879
        if not trash is None:
3880
            cmd.set_attribute("trash", _to_bool(trash))
3881
3882
        return self._send_xml_command(cmd)
3883
3884
    def get_permission(self, permission_id: str) -> Any:
3885
        """Request a single permission
@@ 3542-3566 (lines=25) @@
3539
        cmd.set_attribute("filter_id", filter_id)
3540
        return self._send_xml_command(cmd)
3541
3542
    def get_groups(
3543
        self,
3544
        *,
3545
        filter: Optional[str] = None,
3546
        filter_id: Optional[str] = None,
3547
        trash: Optional[bool] = None
3548
    ) -> Any:
3549
        """Request a list of groups
3550
3551
        Arguments:
3552
            filter: Filter term to use for the query
3553
            filter_id: UUID of an existing filter to use for the query
3554
            trash: Whether to get the trashcan groups instead
3555
3556
        Returns:
3557
            The response. See :py:meth:`send_command` for details.
3558
        """
3559
        cmd = XmlCommand("get_groups")
3560
3561
        _add_filter(cmd, filter, filter_id)
3562
3563
        if not trash is None:
3564
            cmd.set_attribute("trash", _to_bool(trash))
3565
3566
        return self._send_xml_command(cmd)
3567
3568
    def get_group(self, group_id: str) -> Any:
3569
        """Request a single group

gvm/protocols/gmpv8.py 1 location

@@ 905-929 (lines=25) @@
902
903
        return self._send_xml_command(cmd)
904
905
    def get_tickets(
906
        self,
907
        *,
908
        trash: Optional[bool] = None,
909
        filter: Optional[str] = None,
910
        filter_id: Optional[str] = None
911
    ) -> Any:
912
        """Request a list of tickets
913
914
        Arguments:
915
            filter: Filter term to use for the query
916
            filter_id: UUID of an existing filter to use for the query
917
            trash: True to request the tickets in the trashcan
918
919
        Returns:
920
            The response. See :py:meth:`send_command` for details.
921
        """
922
        cmd = XmlCommand("get_tickets")
923
924
        _add_filter(cmd, filter, filter_id)
925
926
        if not trash is None:
927
            cmd.set_attribute("trash", _to_bool(trash))
928
929
        return self._send_xml_command(cmd)
930
931
    def get_ticket(self, ticket_id: str) -> Any:
932
        """Request a single ticket