Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 4621-4656 (lines=36) @@
4618
4619
        return self._send_xml_command(cmd)
4620
4621
    def get_credentials(
4622
        self,
4623
        *,
4624
        filter: Optional[str] = None,
4625
        filter_id: Optional[str] = None,
4626
        scanners: Optional[bool] = None,
4627
        trash: Optional[bool] = None,
4628
        targets: Optional[bool] = None,
4629
    ) -> Any:
4630
        """Request a list of credentials
4631
4632
        Arguments:
4633
            filter: Filter term to use for the query
4634
            filter_id: UUID of an existing filter to use for the query
4635
            scanners: Whether to include a list of scanners using the
4636
                credentials
4637
            trash: Whether to get the trashcan credentials instead
4638
            targets: Whether to include a list of targets using the credentials
4639
4640
        Returns:
4641
            The response. See :py:meth:`send_command` for details.
4642
        """
4643
        cmd = XmlCommand("get_credentials")
4644
4645
        add_filter(cmd, filter, filter_id)
4646
4647
        if scanners is not None:
4648
            cmd.set_attribute("scanners", to_bool(scanners))
4649
4650
        if trash is not None:
4651
            cmd.set_attribute("trash", to_bool(trash))
4652
4653
        if targets is not None:
4654
            cmd.set_attribute("targets", to_bool(targets))
4655
4656
        return self._send_xml_command(cmd)
4657
4658
    def get_credential(
4659
        self,
@@ 5065-5099 (lines=35) @@
5062
        cmd.set_attribute("permission_id", permission_id)
5063
        return self._send_xml_command(cmd)
5064
5065
    def get_port_lists(
5066
        self,
5067
        *,
5068
        filter: Optional[str] = None,
5069
        filter_id: Optional[str] = None,
5070
        details: Optional[bool] = None,
5071
        targets: Optional[bool] = None,
5072
        trash: Optional[bool] = None,
5073
    ) -> Any:
5074
        """Request a list of port lists
5075
5076
        Arguments:
5077
            filter: Filter term to use for the query
5078
            filter_id: UUID of an existing filter to use for the query
5079
            details: Whether to include full port list details
5080
            targets: Whether to include targets using this port list
5081
            trash: Whether to get port lists in the trashcan instead
5082
5083
        Returns:
5084
            The response. See :py:meth:`send_command` for details.
5085
        """
5086
        cmd = XmlCommand("get_port_lists")
5087
5088
        add_filter(cmd, filter, filter_id)
5089
5090
        if details is not None:
5091
            cmd.set_attribute("details", to_bool(details))
5092
5093
        if targets is not None:
5094
            cmd.set_attribute("targets", to_bool(targets))
5095
5096
        if trash is not None:
5097
            cmd.set_attribute("trash", to_bool(trash))
5098
5099
        return self._send_xml_command(cmd)
5100
5101
    def get_port_list(self, port_list_id: str):
5102
        """Request a single port list