Code Duplication    Length = 25-25 lines in 8 locations

gvm/protocols/gmpv7/gmpv7.py 3 locations

@@ 3918-3942 (lines=25) @@
3915
        cmd.set_attribute("details", "1")
3916
        return self._send_xml_command(cmd)
3917
3918
    def get_roles(
3919
        self,
3920
        *,
3921
        filter: Optional[str] = None,
3922
        filter_id: Optional[str] = None,
3923
        trash: Optional[bool] = None,
3924
    ) -> Any:
3925
        """Request a list of roles
3926
3927
        Arguments:
3928
            filter: Filter term to use for the query
3929
            filter_id: UUID of an existing filter to use for the query
3930
            trash: Whether to get the trashcan roles instead
3931
3932
        Returns:
3933
            The response. See :py:meth:`send_command` for details.
3934
        """
3935
        cmd = XmlCommand("get_roles")
3936
3937
        _add_filter(cmd, filter, filter_id)
3938
3939
        if trash is not None:
3940
            cmd.set_attribute("trash", _to_bool(trash))
3941
3942
        return self._send_xml_command(cmd)
3943
3944
    def get_role(self, role_id: str) -> Any:
3945
        """Request a single role
@@ 3522-3546 (lines=25) @@
3519
        cmd.set_attribute("details", "1")
3520
        return self._send_xml_command(cmd)
3521
3522
    def get_permissions(
3523
        self,
3524
        *,
3525
        filter: Optional[str] = None,
3526
        filter_id: Optional[str] = None,
3527
        trash: Optional[bool] = None,
3528
    ) -> Any:
3529
        """Request a list of permissions
3530
3531
        Arguments:
3532
            filter: Filter term to use for the query
3533
            filter_id: UUID of an existing filter to use for the query
3534
            trash: Whether to get permissions in the trashcan instead
3535
3536
        Returns:
3537
            The response. See :py:meth:`send_command` for details.
3538
        """
3539
        cmd = XmlCommand("get_permissions")
3540
3541
        _add_filter(cmd, filter, filter_id)
3542
3543
        if trash is not None:
3544
            cmd.set_attribute("trash", _to_bool(trash))
3545
3546
        return self._send_xml_command(cmd)
3547
3548
    def get_permission(self, permission_id: str) -> Any:
3549
        """Request a single permission
@@ 3183-3207 (lines=25) @@
3180
3181
        return self._send_xml_command(cmd)
3182
3183
    def get_groups(
3184
        self,
3185
        *,
3186
        filter: Optional[str] = None,
3187
        filter_id: Optional[str] = None,
3188
        trash: Optional[bool] = None,
3189
    ) -> Any:
3190
        """Request a list of groups
3191
3192
        Arguments:
3193
            filter: Filter term to use for the query
3194
            filter_id: UUID of an existing filter to use for the query
3195
            trash: Whether to get the trashcan groups instead
3196
3197
        Returns:
3198
            The response. See :py:meth:`send_command` for details.
3199
        """
3200
        cmd = XmlCommand("get_groups")
3201
3202
        _add_filter(cmd, filter, filter_id)
3203
3204
        if trash is not None:
3205
            cmd.set_attribute("trash", _to_bool(trash))
3206
3207
        return self._send_xml_command(cmd)
3208
3209
    def get_group(self, group_id: str) -> Any:
3210
        """Request a single group

gvm/protocols/gmpv8/gmpv8.py 1 location

@@ 742-766 (lines=25) @@
739
740
        return self._send_xml_command(cmd)
741
742
    def get_tickets(
743
        self,
744
        *,
745
        trash: Optional[bool] = None,
746
        filter: Optional[str] = None,
747
        filter_id: Optional[str] = None,
748
    ) -> Any:
749
        """Request a list of tickets
750
751
        Arguments:
752
            filter: Filter term to use for the query
753
            filter_id: UUID of an existing filter to use for the query
754
            trash: True to request the tickets in the trashcan
755
756
        Returns:
757
            The response. See :py:meth:`send_command` for details.
758
        """
759
        cmd = XmlCommand("get_tickets")
760
761
        _add_filter(cmd, filter, filter_id)
762
763
        if trash is not None:
764
            cmd.set_attribute("trash", _to_bool(trash))
765
766
        return self._send_xml_command(cmd)
767
768
    def get_ticket(self, ticket_id: str) -> Any:
769
        """Request a single ticket

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 5584-5608 (lines=25) @@
5581
        cmd.set_attribute("details", "1")
5582
        return self._send_xml_command(cmd)
5583
5584
    def get_roles(
5585
        self,
5586
        *,
5587
        filter: Optional[str] = None,
5588
        filter_id: Optional[str] = None,
5589
        trash: Optional[bool] = None,
5590
    ) -> Any:
5591
        """Request a list of roles
5592
5593
        Arguments:
5594
            filter: Filter term to use for the query
5595
            filter_id: UUID of an existing filter to use for the query
5596
            trash: Whether to get the trashcan roles instead
5597
5598
        Returns:
5599
            The response. See :py:meth:`send_command` for details.
5600
        """
5601
        cmd = XmlCommand("get_roles")
5602
5603
        _add_filter(cmd, filter, filter_id)
5604
5605
        if trash is not None:
5606
            cmd.set_attribute("trash", _to_bool(trash))
5607
5608
        return self._send_xml_command(cmd)
5609
5610
    def get_role(self, role_id: str) -> Any:
5611
        """Request a single role
@@ 5188-5212 (lines=25) @@
5185
        cmd.set_attribute("details", "1")
5186
        return self._send_xml_command(cmd)
5187
5188
    def get_permissions(
5189
        self,
5190
        *,
5191
        filter: Optional[str] = None,
5192
        filter_id: Optional[str] = None,
5193
        trash: Optional[bool] = None,
5194
    ) -> Any:
5195
        """Request a list of permissions
5196
5197
        Arguments:
5198
            filter: Filter term to use for the query
5199
            filter_id: UUID of an existing filter to use for the query
5200
            trash: Whether to get permissions in the trashcan instead
5201
5202
        Returns:
5203
            The response. See :py:meth:`send_command` for details.
5204
        """
5205
        cmd = XmlCommand("get_permissions")
5206
5207
        _add_filter(cmd, filter, filter_id)
5208
5209
        if trash is not None:
5210
            cmd.set_attribute("trash", _to_bool(trash))
5211
5212
        return self._send_xml_command(cmd)
5213
5214
    def get_permission(self, permission_id: str) -> Any:
5215
        """Request a single permission
@@ 4937-4961 (lines=25) @@
4934
4935
        return self._send_xml_command(cmd)
4936
4937
    def get_groups(
4938
        self,
4939
        *,
4940
        filter: Optional[str] = None,
4941
        filter_id: Optional[str] = None,
4942
        trash: Optional[bool] = None,
4943
    ) -> Any:
4944
        """Request a list of groups
4945
4946
        Arguments:
4947
            filter: Filter term to use for the query
4948
            filter_id: UUID of an existing filter to use for the query
4949
            trash: Whether to get the trashcan groups instead
4950
4951
        Returns:
4952
            The response. See :py:meth:`send_command` for details.
4953
        """
4954
        cmd = XmlCommand("get_groups")
4955
4956
        _add_filter(cmd, filter, filter_id)
4957
4958
        if trash is not None:
4959
            cmd.set_attribute("trash", _to_bool(trash))
4960
4961
        return self._send_xml_command(cmd)
4962
4963
    def get_group(self, group_id: str) -> Any:
4964
        """Request a single group
@@ 2943-2967 (lines=25) @@
2940
2941
        return self._send_xml_command(cmd)
2942
2943
    def get_tickets(
2944
        self,
2945
        *,
2946
        trash: Optional[bool] = None,
2947
        filter: Optional[str] = None,
2948
        filter_id: Optional[str] = None,
2949
    ) -> Any:
2950
        """Request a list of tickets
2951
2952
        Arguments:
2953
            filter: Filter term to use for the query
2954
            filter_id: UUID of an existing filter to use for the query
2955
            trash: True to request the tickets in the trashcan
2956
2957
        Returns:
2958
            The response. See :py:meth:`send_command` for details.
2959
        """
2960
        cmd = XmlCommand("get_tickets")
2961
2962
        _add_filter(cmd, filter, filter_id)
2963
2964
        if trash is not None:
2965
            cmd.set_attribute("trash", _to_bool(trash))
2966
2967
        return self._send_xml_command(cmd)
2968
2969
    def get_ticket(self, ticket_id: str) -> Any:
2970
        """Request a single ticket