Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 4764-4788 (lines=25) @@
4761
        cmd.set_attribute("details", "1")
4762
        return self._send_xml_command(cmd)
4763
4764
    def get_roles(
4765
        self,
4766
        *,
4767
        filter: Optional[str] = None,
4768
        filter_id: Optional[str] = None,
4769
        trash: Optional[bool] = None,
4770
    ) -> Any:
4771
        """Request a list of roles
4772
4773
        Arguments:
4774
            filter: Filter term to use for the query
4775
            filter_id: UUID of an existing filter to use for the query
4776
            trash: Whether to get the trashcan roles instead
4777
4778
        Returns:
4779
            The response. See :py:meth:`send_command` for details.
4780
        """
4781
        cmd = XmlCommand("get_roles")
4782
4783
        add_filter(cmd, filter, filter_id)
4784
4785
        if trash is not None:
4786
            cmd.set_attribute("trash", to_bool(trash))
4787
4788
        return self._send_xml_command(cmd)
4789
4790
    def get_role(self, role_id: str) -> Any:
4791
        """Request a single role
@@ 4525-4549 (lines=25) @@
4522
        cmd.set_attribute("details", "1")
4523
        return self._send_xml_command(cmd)
4524
4525
    def get_permissions(
4526
        self,
4527
        *,
4528
        filter: Optional[str] = None,
4529
        filter_id: Optional[str] = None,
4530
        trash: Optional[bool] = None,
4531
    ) -> Any:
4532
        """Request a list of permissions
4533
4534
        Arguments:
4535
            filter: Filter term to use for the query
4536
            filter_id: UUID of an existing filter to use for the query
4537
            trash: Whether to get permissions in the trashcan instead
4538
4539
        Returns:
4540
            The response. See :py:meth:`send_command` for details.
4541
        """
4542
        cmd = XmlCommand("get_permissions")
4543
4544
        add_filter(cmd, filter, filter_id)
4545
4546
        if trash is not None:
4547
            cmd.set_attribute("trash", to_bool(trash))
4548
4549
        return self._send_xml_command(cmd)
4550
4551
    def get_permission(self, permission_id: str) -> Any:
4552
        """Request a single permission
@@ 4274-4298 (lines=25) @@
4271
4272
        return self._send_xml_command(cmd)
4273
4274
    def get_groups(
4275
        self,
4276
        *,
4277
        filter: Optional[str] = None,
4278
        filter_id: Optional[str] = None,
4279
        trash: Optional[bool] = None,
4280
    ) -> Any:
4281
        """Request a list of groups
4282
4283
        Arguments:
4284
            filter: Filter term to use for the query
4285
            filter_id: UUID of an existing filter to use for the query
4286
            trash: Whether to get the trashcan groups instead
4287
4288
        Returns:
4289
            The response. See :py:meth:`send_command` for details.
4290
        """
4291
        cmd = XmlCommand("get_groups")
4292
4293
        add_filter(cmd, filter, filter_id)
4294
4295
        if trash is not None:
4296
            cmd.set_attribute("trash", to_bool(trash))
4297
4298
        return self._send_xml_command(cmd)
4299
4300
    def get_group(self, group_id: str) -> Any:
4301
        """Request a single group
@@ 2595-2619 (lines=25) @@
2592
2593
        return self._send_xml_command(cmd)
2594
2595
    def get_tickets(
2596
        self,
2597
        *,
2598
        trash: Optional[bool] = None,
2599
        filter: Optional[str] = None,
2600
        filter_id: Optional[str] = None,
2601
    ) -> Any:
2602
        """Request a list of tickets
2603
2604
        Arguments:
2605
            filter: Filter term to use for the query
2606
            filter_id: UUID of an existing filter to use for the query
2607
            trash: True to request the tickets in the trashcan
2608
2609
        Returns:
2610
            The response. See :py:meth:`send_command` for details.
2611
        """
2612
        cmd = XmlCommand("get_tickets")
2613
2614
        add_filter(cmd, filter, filter_id)
2615
2616
        if trash is not None:
2617
            cmd.set_attribute("trash", to_bool(trash))
2618
2619
        return self._send_xml_command(cmd)
2620
2621
    def get_ticket(self, ticket_id: str) -> Any:
2622
        """Request a single ticket