Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 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
@@ 4701-4725 (lines=25) @@
4698
        cmd.set_attribute("details", "1")
4699
        return self._send_xml_command(cmd)
4700
4701
    def get_roles(
4702
        self,
4703
        *,
4704
        filter: Optional[str] = None,
4705
        filter_id: Optional[str] = None,
4706
        trash: Optional[bool] = None,
4707
    ) -> Any:
4708
        """Request a list of roles
4709
4710
        Arguments:
4711
            filter: Filter term to use for the query
4712
            filter_id: UUID of an existing filter to use for the query
4713
            trash: Whether to get the trashcan roles instead
4714
4715
        Returns:
4716
            The response. See :py:meth:`send_command` for details.
4717
        """
4718
        cmd = XmlCommand("get_roles")
4719
4720
        add_filter(cmd, filter, filter_id)
4721
4722
        if trash is not None:
4723
            cmd.set_attribute("trash", to_bool(trash))
4724
4725
        return self._send_xml_command(cmd)
4726
4727
    def get_role(self, role_id: str) -> Any:
4728
        """Request a single role