Code Duplication    Length = 29-29 lines in 2 locations

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2510-2538 (lines=29) @@
2507
2508
        return self._send_xml_command(cmd)
2509
2510
    def delete_report_format(
2511
        self,
2512
        report_format_id: Optional[Union[str, ReportFormatType]] = None,
2513
        *,
2514
        ultimate: Optional[bool] = False,
2515
    ) -> Any:
2516
        """Deletes an existing report format
2517
2518
        Arguments:
2519
            report_format_id: UUID of the report format to be deleted.
2520
                              or ReportFormatType (enum)
2521
            ultimate: Whether to remove entirely, or to the trashcan.
2522
        """
2523
        if not report_format_id:
2524
            raise RequiredArgument(
2525
                function=self.delete_report_format.__name__,
2526
                argument='report_format_id',
2527
            )
2528
2529
        cmd = XmlCommand("delete_report_format")
2530
2531
        if isinstance(report_format_id, ReportFormatType):
2532
            report_format_id = report_format_id.value
2533
2534
        cmd.set_attribute("report_format_id", report_format_id)
2535
2536
        cmd.set_attribute("ultimate", _to_bool(ultimate))
2537
2538
        return self._send_xml_command(cmd)
2539
2540
    def delete_role(
2541
        self, role_id: str, *, ultimate: Optional[bool] = False

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4419-4447 (lines=29) @@
4416
4417
        return self._send_xml_command(cmd)
4418
4419
    def delete_report_format(
4420
        self,
4421
        report_format_id: Optional[Union[str, ReportFormatType]] = None,
4422
        *,
4423
        ultimate: Optional[bool] = False,
4424
    ) -> Any:
4425
        """Deletes an existing report format
4426
4427
        Arguments:
4428
            report_format_id: UUID of the report format to be deleted.
4429
                              or ReportFormatType (enum)
4430
            ultimate: Whether to remove entirely, or to the trashcan.
4431
        """
4432
        if not report_format_id:
4433
            raise RequiredArgument(
4434
                function=self.delete_report_format.__name__,
4435
                argument='report_format_id',
4436
            )
4437
4438
        cmd = XmlCommand("delete_report_format")
4439
4440
        if isinstance(report_format_id, ReportFormatType):
4441
            report_format_id = report_format_id.value
4442
4443
        cmd.set_attribute("report_format_id", report_format_id)
4444
4445
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4446
4447
        return self._send_xml_command(cmd)
4448
4449
    def delete_role(
4450
        self, role_id: str, *, ultimate: Optional[bool] = False