Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 4164-4188 (lines=25) @@
4161
        cmd.set_attribute("details", "1")
4162
        return self._send_xml_command(cmd)
4163
4164
    def get_roles(
4165
        self,
4166
        *,
4167
        filter: Optional[str] = None,
4168
        filter_id: Optional[str] = None,
4169
        trash: Optional[bool] = None,
4170
    ) -> Any:
4171
        """Request a list of roles
4172
4173
        Arguments:
4174
            filter: Filter term to use for the query
4175
            filter_id: UUID of an existing filter to use for the query
4176
            trash: Whether to get the trashcan roles instead
4177
4178
        Returns:
4179
            The response. See :py:meth:`send_command` for details.
4180
        """
4181
        cmd = XmlCommand("get_roles")
4182
4183
        add_filter(cmd, filter, filter_id)
4184
4185
        if trash is not None:
4186
            cmd.set_attribute("trash", to_bool(trash))
4187
4188
        return self._send_xml_command(cmd)
4189
4190
    def get_role(self, role_id: str) -> Any:
4191
        """Request a single role
@@ 3988-4012 (lines=25) @@
3985
        cmd.set_attribute("group_id", group_id)
3986
        return self._send_xml_command(cmd)
3987
3988
    def get_permissions(
3989
        self,
3990
        *,
3991
        filter: Optional[str] = None,
3992
        filter_id: Optional[str] = None,
3993
        trash: Optional[bool] = None,
3994
    ) -> Any:
3995
        """Request a list of permissions
3996
3997
        Arguments:
3998
            filter: Filter term to use for the query
3999
            filter_id: UUID of an existing filter to use for the query
4000
            trash: Whether to get permissions in the trashcan instead
4001
4002
        Returns:
4003
            The response. See :py:meth:`send_command` for details.
4004
        """
4005
        cmd = XmlCommand("get_permissions")
4006
4007
        add_filter(cmd, filter, filter_id)
4008
4009
        if trash is not None:
4010
            cmd.set_attribute("trash", to_bool(trash))
4011
4012
        return self._send_xml_command(cmd)
4013
4014
    def get_permission(self, permission_id: str) -> Any:
4015
        """Request a single permission
@@ 3943-3967 (lines=25) @@
3940
3941
        return self._send_xml_command(cmd)
3942
3943
    def get_groups(
3944
        self,
3945
        *,
3946
        filter: Optional[str] = None,
3947
        filter_id: Optional[str] = None,
3948
        trash: Optional[bool] = None,
3949
    ) -> Any:
3950
        """Request a list of groups
3951
3952
        Arguments:
3953
            filter: Filter term to use for the query
3954
            filter_id: UUID of an existing filter to use for the query
3955
            trash: Whether to get the trashcan groups instead
3956
3957
        Returns:
3958
            The response. See :py:meth:`send_command` for details.
3959
        """
3960
        cmd = XmlCommand("get_groups")
3961
3962
        add_filter(cmd, filter, filter_id)
3963
3964
        if trash is not None:
3965
            cmd.set_attribute("trash", to_bool(trash))
3966
3967
        return self._send_xml_command(cmd)
3968
3969
    def get_group(self, group_id: str) -> Any:
3970
        """Request a single group
@@ 2507-2531 (lines=25) @@
2504
2505
        return self._send_xml_command(cmd)
2506
2507
    def get_tickets(
2508
        self,
2509
        *,
2510
        trash: Optional[bool] = None,
2511
        filter: Optional[str] = None,
2512
        filter_id: Optional[str] = None,
2513
    ) -> Any:
2514
        """Request a list of tickets
2515
2516
        Arguments:
2517
            filter: Filter term to use for the query
2518
            filter_id: UUID of an existing filter to use for the query
2519
            trash: True to request the tickets in the trashcan
2520
2521
        Returns:
2522
            The response. See :py:meth:`send_command` for details.
2523
        """
2524
        cmd = XmlCommand("get_tickets")
2525
2526
        add_filter(cmd, filter, filter_id)
2527
2528
        if trash is not None:
2529
            cmd.set_attribute("trash", to_bool(trash))
2530
2531
        return self._send_xml_command(cmd)
2532
2533
    def get_ticket(self, ticket_id: str) -> Any:
2534
        """Request a single ticket