Code Duplication    Length = 25-25 lines in 8 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 5552-5576 (lines=25) @@
5549
        cmd.set_attribute("details", "1")
5550
        return self._send_xml_command(cmd)
5551
5552
    def get_roles(
5553
        self,
5554
        *,
5555
        filter: Optional[str] = None,
5556
        filter_id: Optional[str] = None,
5557
        trash: Optional[bool] = None,
5558
    ) -> Any:
5559
        """Request a list of roles
5560
5561
        Arguments:
5562
            filter: Filter term to use for the query
5563
            filter_id: UUID of an existing filter to use for the query
5564
            trash: Whether to get the trashcan roles instead
5565
5566
        Returns:
5567
            The response. See :py:meth:`send_command` for details.
5568
        """
5569
        cmd = XmlCommand("get_roles")
5570
5571
        _add_filter(cmd, filter, filter_id)
5572
5573
        if trash is not None:
5574
            cmd.set_attribute("trash", _to_bool(trash))
5575
5576
        return self._send_xml_command(cmd)
5577
5578
    def get_role(self, role_id: str) -> Any:
5579
        """Request a single role
@@ 5156-5180 (lines=25) @@
5153
        cmd.set_attribute("details", "1")
5154
        return self._send_xml_command(cmd)
5155
5156
    def get_permissions(
5157
        self,
5158
        *,
5159
        filter: Optional[str] = None,
5160
        filter_id: Optional[str] = None,
5161
        trash: Optional[bool] = None,
5162
    ) -> Any:
5163
        """Request a list of permissions
5164
5165
        Arguments:
5166
            filter: Filter term to use for the query
5167
            filter_id: UUID of an existing filter to use for the query
5168
            trash: Whether to get permissions in the trashcan instead
5169
5170
        Returns:
5171
            The response. See :py:meth:`send_command` for details.
5172
        """
5173
        cmd = XmlCommand("get_permissions")
5174
5175
        _add_filter(cmd, filter, filter_id)
5176
5177
        if trash is not None:
5178
            cmd.set_attribute("trash", _to_bool(trash))
5179
5180
        return self._send_xml_command(cmd)
5181
5182
    def get_permission(self, permission_id: str) -> Any:
5183
        """Request a single permission
@@ 4905-4929 (lines=25) @@
4902
4903
        return self._send_xml_command(cmd)
4904
4905
    def get_groups(
4906
        self,
4907
        *,
4908
        filter: Optional[str] = None,
4909
        filter_id: Optional[str] = None,
4910
        trash: Optional[bool] = None,
4911
    ) -> Any:
4912
        """Request a list of groups
4913
4914
        Arguments:
4915
            filter: Filter term to use for the query
4916
            filter_id: UUID of an existing filter to use for the query
4917
            trash: Whether to get the trashcan groups instead
4918
4919
        Returns:
4920
            The response. See :py:meth:`send_command` for details.
4921
        """
4922
        cmd = XmlCommand("get_groups")
4923
4924
        _add_filter(cmd, filter, filter_id)
4925
4926
        if trash is not None:
4927
            cmd.set_attribute("trash", _to_bool(trash))
4928
4929
        return self._send_xml_command(cmd)
4930
4931
    def get_group(self, group_id: str) -> Any:
4932
        """Request a single group
@@ 2911-2935 (lines=25) @@
2908
2909
        return self._send_xml_command(cmd)
2910
2911
    def get_tickets(
2912
        self,
2913
        *,
2914
        trash: Optional[bool] = None,
2915
        filter: Optional[str] = None,
2916
        filter_id: Optional[str] = None,
2917
    ) -> Any:
2918
        """Request a list of tickets
2919
2920
        Arguments:
2921
            filter: Filter term to use for the query
2922
            filter_id: UUID of an existing filter to use for the query
2923
            trash: True to request the tickets in the trashcan
2924
2925
        Returns:
2926
            The response. See :py:meth:`send_command` for details.
2927
        """
2928
        cmd = XmlCommand("get_tickets")
2929
2930
        _add_filter(cmd, filter, filter_id)
2931
2932
        if trash is not None:
2933
            cmd.set_attribute("trash", _to_bool(trash))
2934
2935
        return self._send_xml_command(cmd)
2936
2937
    def get_ticket(self, ticket_id: str) -> Any:
2938
        """Request a single ticket

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