Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 3 locations

@@ 1567-1591 (lines=25) @@
1564
        cmd.set_attribute("details", "1")
1565
        return self._send_xml_command(cmd)
1566
1567
    def get_roles(
1568
        self,
1569
        *,
1570
        filter: Optional[str] = None,
1571
        filter_id: Optional[str] = None,
1572
        trash: Optional[bool] = None,
1573
    ) -> Any:
1574
        """Request a list of roles
1575
1576
        Arguments:
1577
            filter: Filter term to use for the query
1578
            filter_id: UUID of an existing filter to use for the query
1579
            trash: Whether to get the trashcan roles instead
1580
1581
        Returns:
1582
            The response. See :py:meth:`send_command` for details.
1583
        """
1584
        cmd = XmlCommand("get_roles")
1585
1586
        add_filter(cmd, filter, filter_id)
1587
1588
        if trash is not None:
1589
            cmd.set_attribute("trash", to_bool(trash))
1590
1591
        return self._send_xml_command(cmd)
1592
1593
    def get_role(self, role_id: str) -> Any:
1594
        """Request a single role
@@ 1393-1417 (lines=25) @@
1390
1391
        return self._send_xml_command(cmd)
1392
1393
    def get_groups(
1394
        self,
1395
        *,
1396
        filter: Optional[str] = None,
1397
        filter_id: Optional[str] = None,
1398
        trash: Optional[bool] = None,
1399
    ) -> Any:
1400
        """Request a list of groups
1401
1402
        Arguments:
1403
            filter: Filter term to use for the query
1404
            filter_id: UUID of an existing filter to use for the query
1405
            trash: Whether to get the trashcan groups instead
1406
1407
        Returns:
1408
            The response. See :py:meth:`send_command` for details.
1409
        """
1410
        cmd = XmlCommand("get_groups")
1411
1412
        add_filter(cmd, filter, filter_id)
1413
1414
        if trash is not None:
1415
            cmd.set_attribute("trash", to_bool(trash))
1416
1417
        return self._send_xml_command(cmd)
1418
1419
    def get_group(self, group_id: str) -> Any:
1420
        """Request a single group
@@ 596-620 (lines=25) @@
593
594
        return self._send_xml_command(cmd)
595
596
    def get_tickets(
597
        self,
598
        *,
599
        trash: Optional[bool] = None,
600
        filter: Optional[str] = None,
601
        filter_id: Optional[str] = None,
602
    ) -> Any:
603
        """Request a list of tickets
604
605
        Arguments:
606
            filter: Filter term to use for the query
607
            filter_id: UUID of an existing filter to use for the query
608
            trash: True to request the tickets in the trashcan
609
610
        Returns:
611
            The response. See :py:meth:`send_command` for details.
612
        """
613
        cmd = XmlCommand("get_tickets")
614
615
        add_filter(cmd, filter, filter_id)
616
617
        if trash is not None:
618
            cmd.set_attribute("trash", to_bool(trash))
619
620
        return self._send_xml_command(cmd)
621
622
    def get_ticket(self, ticket_id: str) -> Any:
623
        """Request a single ticket

gvm/protocols/gmpv208/entities/permissions.py 1 location

@@ 186-210 (lines=25) @@
183
184
        return self._send_xml_command(cmd)
185
186
    def get_permissions(
187
        self,
188
        *,
189
        filter: Optional[str] = None,
190
        filter_id: Optional[str] = None,
191
        trash: Optional[bool] = None,
192
    ) -> Any:
193
        """Request a list of permissions
194
195
        Arguments:
196
            filter: Filter term to use for the query
197
            filter_id: UUID of an existing filter to use for the query
198
            trash: Whether to get permissions in the trashcan instead
199
200
        Returns:
201
            The response. See :py:meth:`send_command` for details.
202
        """
203
        cmd = XmlCommand("get_permissions")
204
205
        add_filter(cmd, filter, filter_id)
206
207
        if trash is not None:
208
            cmd.set_attribute("trash", to_bool(trash))
209
210
        return self._send_xml_command(cmd)
211
212
    def get_permission(self, permission_id: str) -> Any:
213
        """Request a single permission