Code Duplication    Length = 19-19 lines in 2 locations

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

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 4180-4198 (lines=19) @@
4177
        cmd.add_element("copy", user_id)
4178
        return self._send_xml_command(cmd)
4179
4180
    def delete_alert(
4181
        self, alert_id: str, *, ultimate: Optional[bool] = False
4182
    ) -> Any:
4183
        """Deletes an existing alert
4184
4185
        Arguments:
4186
            alert_id: UUID of the alert to be deleted.
4187
            ultimate: Whether to remove entirely, or to the trashcan.
4188
        """
4189
        if not alert_id:
4190
            raise RequiredArgument(
4191
                function=self.delete_alert.__name__, argument='alert_id'
4192
            )
4193
4194
        cmd = XmlCommand("delete_alert")
4195
        cmd.set_attribute("alert_id", alert_id)
4196
        cmd.set_attribute("ultimate", _to_bool(ultimate))
4197
4198
        return self._send_xml_command(cmd)
4199
4200
    def delete_asset(
4201
        self, *, asset_id: Optional[str] = None, report_id: Optional[str] = None