Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 4514-4538 (lines=25) @@
4511
        cmd.set_attribute("details", "1")
4512
        return self._send_xml_command(cmd)
4513
4514
    def get_roles(
4515
        self,
4516
        *,
4517
        filter: Optional[str] = None,
4518
        filter_id: Optional[str] = None,
4519
        trash: Optional[bool] = None,
4520
    ) -> Any:
4521
        """Request a list of roles
4522
4523
        Arguments:
4524
            filter: Filter term to use for the query
4525
            filter_id: UUID of an existing filter to use for the query
4526
            trash: Whether to get the trashcan roles instead
4527
4528
        Returns:
4529
            The response. See :py:meth:`send_command` for details.
4530
        """
4531
        cmd = XmlCommand("get_roles")
4532
4533
        add_filter(cmd, filter, filter_id)
4534
4535
        if trash is not None:
4536
            cmd.set_attribute("trash", to_bool(trash))
4537
4538
        return self._send_xml_command(cmd)
4539
4540
    def get_role(self, role_id: str) -> Any:
4541
        """Request a single role
@@ 4338-4362 (lines=25) @@
4335
        cmd.set_attribute("details", "1")
4336
        return self._send_xml_command(cmd)
4337
4338
    def get_permissions(
4339
        self,
4340
        *,
4341
        filter: Optional[str] = None,
4342
        filter_id: Optional[str] = None,
4343
        trash: Optional[bool] = None,
4344
    ) -> Any:
4345
        """Request a list of permissions
4346
4347
        Arguments:
4348
            filter: Filter term to use for the query
4349
            filter_id: UUID of an existing filter to use for the query
4350
            trash: Whether to get permissions in the trashcan instead
4351
4352
        Returns:
4353
            The response. See :py:meth:`send_command` for details.
4354
        """
4355
        cmd = XmlCommand("get_permissions")
4356
4357
        add_filter(cmd, filter, filter_id)
4358
4359
        if trash is not None:
4360
            cmd.set_attribute("trash", to_bool(trash))
4361
4362
        return self._send_xml_command(cmd)
4363
4364
    def get_permission(self, permission_id: str) -> Any:
4365
        """Request a single permission
@@ 4188-4212 (lines=25) @@
4185
4186
        return self._send_xml_command(cmd)
4187
4188
    def get_groups(
4189
        self,
4190
        *,
4191
        filter: Optional[str] = None,
4192
        filter_id: Optional[str] = None,
4193
        trash: Optional[bool] = None,
4194
    ) -> Any:
4195
        """Request a list of groups
4196
4197
        Arguments:
4198
            filter: Filter term to use for the query
4199
            filter_id: UUID of an existing filter to use for the query
4200
            trash: Whether to get the trashcan groups instead
4201
4202
        Returns:
4203
            The response. See :py:meth:`send_command` for details.
4204
        """
4205
        cmd = XmlCommand("get_groups")
4206
4207
        add_filter(cmd, filter, filter_id)
4208
4209
        if trash is not None:
4210
            cmd.set_attribute("trash", to_bool(trash))
4211
4212
        return self._send_xml_command(cmd)
4213
4214
    def get_group(self, group_id: str) -> Any:
4215
        """Request a single group
@@ 2509-2533 (lines=25) @@
2506
2507
        return self._send_xml_command(cmd)
2508
2509
    def get_tickets(
2510
        self,
2511
        *,
2512
        trash: Optional[bool] = None,
2513
        filter: Optional[str] = None,
2514
        filter_id: Optional[str] = None,
2515
    ) -> Any:
2516
        """Request a list of tickets
2517
2518
        Arguments:
2519
            filter: Filter term to use for the query
2520
            filter_id: UUID of an existing filter to use for the query
2521
            trash: True to request the tickets in the trashcan
2522
2523
        Returns:
2524
            The response. See :py:meth:`send_command` for details.
2525
        """
2526
        cmd = XmlCommand("get_tickets")
2527
2528
        add_filter(cmd, filter, filter_id)
2529
2530
        if trash is not None:
2531
            cmd.set_attribute("trash", to_bool(trash))
2532
2533
        return self._send_xml_command(cmd)
2534
2535
    def get_ticket(self, ticket_id: str) -> Any:
2536
        """Request a single ticket