Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 2 locations

@@ 4443-4478 (lines=36) @@
4440
4441
        return self._send_xml_command(cmd)
4442
4443
    def get_credentials(
4444
        self,
4445
        *,
4446
        filter: Optional[str] = None,
4447
        filter_id: Optional[str] = None,
4448
        scanners: Optional[bool] = None,
4449
        trash: Optional[bool] = None,
4450
        targets: Optional[bool] = None,
4451
    ) -> Any:
4452
        """Request a list of credentials
4453
4454
        Arguments:
4455
            filter: Filter term to use for the query
4456
            filter_id: UUID of an existing filter to use for the query
4457
            scanners: Whether to include a list of scanners using the
4458
                credentials
4459
            trash: Whether to get the trashcan credentials instead
4460
            targets: Whether to include a list of targets using the credentials
4461
4462
        Returns:
4463
            The response. See :py:meth:`send_command` for details.
4464
        """
4465
        cmd = XmlCommand("get_credentials")
4466
4467
        add_filter(cmd, filter, filter_id)
4468
4469
        if scanners is not None:
4470
            cmd.set_attribute("scanners", to_bool(scanners))
4471
4472
        if trash is not None:
4473
            cmd.set_attribute("trash", to_bool(trash))
4474
4475
        if targets is not None:
4476
            cmd.set_attribute("targets", to_bool(targets))
4477
4478
        return self._send_xml_command(cmd)
4479
4480
    def get_credential(
4481
        self,
@@ 4887-4921 (lines=35) @@
4884
        cmd.set_attribute("permission_id", permission_id)
4885
        return self._send_xml_command(cmd)
4886
4887
    def get_port_lists(
4888
        self,
4889
        *,
4890
        filter: Optional[str] = None,
4891
        filter_id: Optional[str] = None,
4892
        details: Optional[bool] = None,
4893
        targets: Optional[bool] = None,
4894
        trash: Optional[bool] = None,
4895
    ) -> Any:
4896
        """Request a list of port lists
4897
4898
        Arguments:
4899
            filter: Filter term to use for the query
4900
            filter_id: UUID of an existing filter to use for the query
4901
            details: Whether to include full port list details
4902
            targets: Whether to include targets using this port list
4903
            trash: Whether to get port lists in the trashcan instead
4904
4905
        Returns:
4906
            The response. See :py:meth:`send_command` for details.
4907
        """
4908
        cmd = XmlCommand("get_port_lists")
4909
4910
        add_filter(cmd, filter, filter_id)
4911
4912
        if details is not None:
4913
            cmd.set_attribute("details", to_bool(details))
4914
4915
        if targets is not None:
4916
            cmd.set_attribute("targets", to_bool(targets))
4917
4918
        if trash is not None:
4919
            cmd.set_attribute("trash", to_bool(trash))
4920
4921
        return self._send_xml_command(cmd)
4922
4923
    def get_port_list(self, port_list_id: str):
4924
        """Request a single port list