Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 3762-3786 (lines=25) @@
3759
        cmd.set_attribute("details", "1")
3760
        return self._send_xml_command(cmd)
3761
3762
    def get_roles(
3763
        self,
3764
        *,
3765
        filter: Optional[str] = None,
3766
        filter_id: Optional[str] = None,
3767
        trash: Optional[bool] = None,
3768
    ) -> Any:
3769
        """Request a list of roles
3770
3771
        Arguments:
3772
            filter: Filter term to use for the query
3773
            filter_id: UUID of an existing filter to use for the query
3774
            trash: Whether to get the trashcan roles instead
3775
3776
        Returns:
3777
            The response. See :py:meth:`send_command` for details.
3778
        """
3779
        cmd = XmlCommand("get_roles")
3780
3781
        add_filter(cmd, filter, filter_id)
3782
3783
        if trash is not None:
3784
            cmd.set_attribute("trash", to_bool(trash))
3785
3786
        return self._send_xml_command(cmd)
3787
3788
    def get_role(self, role_id: str) -> Any:
3789
        """Request a single role
@@ 3586-3610 (lines=25) @@
3583
        cmd.set_attribute("group_id", group_id)
3584
        return self._send_xml_command(cmd)
3585
3586
    def get_permissions(
3587
        self,
3588
        *,
3589
        filter: Optional[str] = None,
3590
        filter_id: Optional[str] = None,
3591
        trash: Optional[bool] = None,
3592
    ) -> Any:
3593
        """Request a list of permissions
3594
3595
        Arguments:
3596
            filter: Filter term to use for the query
3597
            filter_id: UUID of an existing filter to use for the query
3598
            trash: Whether to get permissions in the trashcan instead
3599
3600
        Returns:
3601
            The response. See :py:meth:`send_command` for details.
3602
        """
3603
        cmd = XmlCommand("get_permissions")
3604
3605
        add_filter(cmd, filter, filter_id)
3606
3607
        if trash is not None:
3608
            cmd.set_attribute("trash", to_bool(trash))
3609
3610
        return self._send_xml_command(cmd)
3611
3612
    def get_permission(self, permission_id: str) -> Any:
3613
        """Request a single permission
@@ 3541-3565 (lines=25) @@
3538
3539
        return self._send_xml_command(cmd)
3540
3541
    def get_groups(
3542
        self,
3543
        *,
3544
        filter: Optional[str] = None,
3545
        filter_id: Optional[str] = None,
3546
        trash: Optional[bool] = None,
3547
    ) -> Any:
3548
        """Request a list of groups
3549
3550
        Arguments:
3551
            filter: Filter term to use for the query
3552
            filter_id: UUID of an existing filter to use for the query
3553
            trash: Whether to get the trashcan groups instead
3554
3555
        Returns:
3556
            The response. See :py:meth:`send_command` for details.
3557
        """
3558
        cmd = XmlCommand("get_groups")
3559
3560
        add_filter(cmd, filter, filter_id)
3561
3562
        if trash is not None:
3563
            cmd.set_attribute("trash", to_bool(trash))
3564
3565
        return self._send_xml_command(cmd)
3566
3567
    def get_group(self, group_id: str) -> Any:
3568
        """Request a single group
@@ 2178-2202 (lines=25) @@
2175
2176
        return self._send_xml_command(cmd)
2177
2178
    def get_tickets(
2179
        self,
2180
        *,
2181
        trash: Optional[bool] = None,
2182
        filter: Optional[str] = None,
2183
        filter_id: Optional[str] = None,
2184
    ) -> Any:
2185
        """Request a list of tickets
2186
2187
        Arguments:
2188
            filter: Filter term to use for the query
2189
            filter_id: UUID of an existing filter to use for the query
2190
            trash: True to request the tickets in the trashcan
2191
2192
        Returns:
2193
            The response. See :py:meth:`send_command` for details.
2194
        """
2195
        cmd = XmlCommand("get_tickets")
2196
2197
        add_filter(cmd, filter, filter_id)
2198
2199
        if trash is not None:
2200
            cmd.set_attribute("trash", to_bool(trash))
2201
2202
        return self._send_xml_command(cmd)
2203
2204
    def get_ticket(self, ticket_id: str) -> Any:
2205
        """Request a single ticket