Code Duplication    Length = 35-36 lines in 2 locations

gvm/protocols/gmpv208/entities/port_lists.py 1 location

@@ 207-241 (lines=35) @@
204
205
        return self._send_xml_command(cmd)
206
207
    def get_port_lists(
208
        self,
209
        *,
210
        filter: Optional[str] = None,
211
        filter_id: Optional[str] = None,
212
        details: Optional[bool] = None,
213
        targets: Optional[bool] = None,
214
        trash: Optional[bool] = None,
215
    ) -> Any:
216
        """Request a list of port lists
217
218
        Arguments:
219
            filter: Filter term to use for the query
220
            filter_id: UUID of an existing filter to use for the query
221
            details: Whether to include full port list details
222
            targets: Whether to include targets using this port list
223
            trash: Whether to get port lists in the trashcan instead
224
225
        Returns:
226
            The response. See :py:meth:`send_command` for details.
227
        """
228
        cmd = XmlCommand("get_port_lists")
229
230
        add_filter(cmd, filter, filter_id)
231
232
        if details is not None:
233
            cmd.set_attribute("details", to_bool(details))
234
235
        if targets is not None:
236
            cmd.set_attribute("targets", to_bool(targets))
237
238
        if trash is not None:
239
            cmd.set_attribute("trash", to_bool(trash))
240
241
        return self._send_xml_command(cmd)
242
243
    def get_port_list(self, port_list_id: str):
244
        """Request a single port list

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 3393-3428 (lines=36) @@
3390
3391
        return self._send_xml_command(cmd)
3392
3393
    def get_credentials(
3394
        self,
3395
        *,
3396
        filter: Optional[str] = None,
3397
        filter_id: Optional[str] = None,
3398
        scanners: Optional[bool] = None,
3399
        trash: Optional[bool] = None,
3400
        targets: Optional[bool] = None,
3401
    ) -> Any:
3402
        """Request a list of credentials
3403
3404
        Arguments:
3405
            filter: Filter term to use for the query
3406
            filter_id: UUID of an existing filter to use for the query
3407
            scanners: Whether to include a list of scanners using the
3408
                credentials
3409
            trash: Whether to get the trashcan credentials instead
3410
            targets: Whether to include a list of targets using the credentials
3411
3412
        Returns:
3413
            The response. See :py:meth:`send_command` for details.
3414
        """
3415
        cmd = XmlCommand("get_credentials")
3416
3417
        add_filter(cmd, filter, filter_id)
3418
3419
        if scanners is not None:
3420
            cmd.set_attribute("scanners", to_bool(scanners))
3421
3422
        if trash is not None:
3423
            cmd.set_attribute("trash", to_bool(trash))
3424
3425
        if targets is not None:
3426
            cmd.set_attribute("targets", to_bool(targets))
3427
3428
        return self._send_xml_command(cmd)
3429
3430
    def get_credential(
3431
        self,