Code Duplication    Length = 19-19 lines in 2 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4148-4166 (lines=19) @@
4145
        cmd.add_element("copy", user_id)
4146
        return self._send_xml_command(cmd)
4147
4148
    def delete_alert(
4149
        self, alert_id: str, *, ultimate: Optional[bool] = False
4150
    ) -> Any:
4151
        """Deletes an existing alert
4152
4153
        Arguments:
4154
            alert_id: UUID of the alert to be deleted.
4155
            ultimate: Whether to remove entirely, or to the trashcan.
4156
        """
4157
        if not alert_id:
4158
            raise RequiredArgument(
4159
                function=self.delete_alert.__name__, argument='alert_id'
4160
            )
4161
4162
        cmd = XmlCommand("delete_alert")
4163
        cmd.set_attribute("alert_id", alert_id)
4164
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4165
4166
        return self._send_xml_command(cmd)
4167
4168
    def delete_asset(
4169
        self, *, asset_id: Optional[str] = None, report_id: Optional[str] = None

gvm/protocols/gmpv7/gmpv7.py 1 location

@@ 2271-2289 (lines=19) @@
2268
2269
        return self._send_xml_command(cmd)
2270
2271
    def delete_alert(
2272
        self, alert_id: str, *, ultimate: Optional[bool] = False
2273
    ) -> Any:
2274
        """Deletes an existing alert
2275
2276
        Arguments:
2277
            alert_id: UUID of the alert to be deleted.
2278
            ultimate: Whether to remove entirely, or to the trashcan.
2279
        """
2280
        if not alert_id:
2281
            raise RequiredArgument(
2282
                function=self.delete_alert.__name__, argument='alert_id'
2283
            )
2284
2285
        cmd = XmlCommand("delete_alert")
2286
        cmd.set_attribute("alert_id", alert_id)
2287
        cmd.set_attribute("ultimate", _to_bool(ultimate))
2288
2289
        return self._send_xml_command(cmd)
2290
2291
    def delete_asset(
2292
        self, *, asset_id: Optional[str] = None, report_id: Optional[str] = None