Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 3471-3495 (lines=25) @@
3468
        cmd.set_attribute("details", "1")
3469
        return self._send_xml_command(cmd)
3470
3471
    def get_roles(
3472
        self,
3473
        *,
3474
        filter: Optional[str] = None,
3475
        filter_id: Optional[str] = None,
3476
        trash: Optional[bool] = None,
3477
    ) -> Any:
3478
        """Request a list of roles
3479
3480
        Arguments:
3481
            filter: Filter term to use for the query
3482
            filter_id: UUID of an existing filter to use for the query
3483
            trash: Whether to get the trashcan roles instead
3484
3485
        Returns:
3486
            The response. See :py:meth:`send_command` for details.
3487
        """
3488
        cmd = XmlCommand("get_roles")
3489
3490
        add_filter(cmd, filter, filter_id)
3491
3492
        if trash is not None:
3493
            cmd.set_attribute("trash", to_bool(trash))
3494
3495
        return self._send_xml_command(cmd)
3496
3497
    def get_role(self, role_id: str) -> Any:
3498
        """Request a single role
@@ 3295-3319 (lines=25) @@
3292
        cmd.set_attribute("group_id", group_id)
3293
        return self._send_xml_command(cmd)
3294
3295
    def get_permissions(
3296
        self,
3297
        *,
3298
        filter: Optional[str] = None,
3299
        filter_id: Optional[str] = None,
3300
        trash: Optional[bool] = None,
3301
    ) -> Any:
3302
        """Request a list of permissions
3303
3304
        Arguments:
3305
            filter: Filter term to use for the query
3306
            filter_id: UUID of an existing filter to use for the query
3307
            trash: Whether to get permissions in the trashcan instead
3308
3309
        Returns:
3310
            The response. See :py:meth:`send_command` for details.
3311
        """
3312
        cmd = XmlCommand("get_permissions")
3313
3314
        add_filter(cmd, filter, filter_id)
3315
3316
        if trash is not None:
3317
            cmd.set_attribute("trash", to_bool(trash))
3318
3319
        return self._send_xml_command(cmd)
3320
3321
    def get_permission(self, permission_id: str) -> Any:
3322
        """Request a single permission
@@ 3250-3274 (lines=25) @@
3247
3248
        return self._send_xml_command(cmd)
3249
3250
    def get_groups(
3251
        self,
3252
        *,
3253
        filter: Optional[str] = None,
3254
        filter_id: Optional[str] = None,
3255
        trash: Optional[bool] = None,
3256
    ) -> Any:
3257
        """Request a list of groups
3258
3259
        Arguments:
3260
            filter: Filter term to use for the query
3261
            filter_id: UUID of an existing filter to use for the query
3262
            trash: Whether to get the trashcan groups instead
3263
3264
        Returns:
3265
            The response. See :py:meth:`send_command` for details.
3266
        """
3267
        cmd = XmlCommand("get_groups")
3268
3269
        add_filter(cmd, filter, filter_id)
3270
3271
        if trash is not None:
3272
            cmd.set_attribute("trash", to_bool(trash))
3273
3274
        return self._send_xml_command(cmd)
3275
3276
    def get_group(self, group_id: str) -> Any:
3277
        """Request a single group
@@ 1997-2021 (lines=25) @@
1994
1995
        return self._send_xml_command(cmd)
1996
1997
    def get_tickets(
1998
        self,
1999
        *,
2000
        trash: Optional[bool] = None,
2001
        filter: Optional[str] = None,
2002
        filter_id: Optional[str] = None,
2003
    ) -> Any:
2004
        """Request a list of tickets
2005
2006
        Arguments:
2007
            filter: Filter term to use for the query
2008
            filter_id: UUID of an existing filter to use for the query
2009
            trash: True to request the tickets in the trashcan
2010
2011
        Returns:
2012
            The response. See :py:meth:`send_command` for details.
2013
        """
2014
        cmd = XmlCommand("get_tickets")
2015
2016
        add_filter(cmd, filter, filter_id)
2017
2018
        if trash is not None:
2019
            cmd.set_attribute("trash", to_bool(trash))
2020
2021
        return self._send_xml_command(cmd)
2022
2023
    def get_ticket(self, ticket_id: str) -> Any:
2024
        """Request a single ticket