Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/gmpv208.py 4 locations

@@ 5140-5164 (lines=25) @@
5137
        cmd.set_attribute("details", "1")
5138
        return self._send_xml_command(cmd)
5139
5140
    def get_roles(
5141
        self,
5142
        *,
5143
        filter: Optional[str] = None,
5144
        filter_id: Optional[str] = None,
5145
        trash: Optional[bool] = None,
5146
    ) -> Any:
5147
        """Request a list of roles
5148
5149
        Arguments:
5150
            filter: Filter term to use for the query
5151
            filter_id: UUID of an existing filter to use for the query
5152
            trash: Whether to get the trashcan roles instead
5153
5154
        Returns:
5155
            The response. See :py:meth:`send_command` for details.
5156
        """
5157
        cmd = XmlCommand("get_roles")
5158
5159
        add_filter(cmd, filter, filter_id)
5160
5161
        if trash is not None:
5162
            cmd.set_attribute("trash", to_bool(trash))
5163
5164
        return self._send_xml_command(cmd)
5165
5166
    def get_role(self, role_id: str) -> Any:
5167
        """Request a single role
@@ 4842-4866 (lines=25) @@
4839
        cmd.set_attribute("details", "1")
4840
        return self._send_xml_command(cmd)
4841
4842
    def get_permissions(
4843
        self,
4844
        *,
4845
        filter: Optional[str] = None,
4846
        filter_id: Optional[str] = None,
4847
        trash: Optional[bool] = None,
4848
    ) -> Any:
4849
        """Request a list of permissions
4850
4851
        Arguments:
4852
            filter: Filter term to use for the query
4853
            filter_id: UUID of an existing filter to use for the query
4854
            trash: Whether to get permissions in the trashcan instead
4855
4856
        Returns:
4857
            The response. See :py:meth:`send_command` for details.
4858
        """
4859
        cmd = XmlCommand("get_permissions")
4860
4861
        add_filter(cmd, filter, filter_id)
4862
4863
        if trash is not None:
4864
            cmd.set_attribute("trash", to_bool(trash))
4865
4866
        return self._send_xml_command(cmd)
4867
4868
    def get_permission(self, permission_id: str) -> Any:
4869
        """Request a single permission
@@ 4591-4615 (lines=25) @@
4588
4589
        return self._send_xml_command(cmd)
4590
4591
    def get_groups(
4592
        self,
4593
        *,
4594
        filter: Optional[str] = None,
4595
        filter_id: Optional[str] = None,
4596
        trash: Optional[bool] = None,
4597
    ) -> Any:
4598
        """Request a list of groups
4599
4600
        Arguments:
4601
            filter: Filter term to use for the query
4602
            filter_id: UUID of an existing filter to use for the query
4603
            trash: Whether to get the trashcan groups instead
4604
4605
        Returns:
4606
            The response. See :py:meth:`send_command` for details.
4607
        """
4608
        cmd = XmlCommand("get_groups")
4609
4610
        add_filter(cmd, filter, filter_id)
4611
4612
        if trash is not None:
4613
            cmd.set_attribute("trash", to_bool(trash))
4614
4615
        return self._send_xml_command(cmd)
4616
4617
    def get_group(self, group_id: str) -> Any:
4618
        """Request a single group
@@ 2723-2747 (lines=25) @@
2720
2721
        return self._send_xml_command(cmd)
2722
2723
    def get_tickets(
2724
        self,
2725
        *,
2726
        trash: Optional[bool] = None,
2727
        filter: Optional[str] = None,
2728
        filter_id: Optional[str] = None,
2729
    ) -> Any:
2730
        """Request a list of tickets
2731
2732
        Arguments:
2733
            filter: Filter term to use for the query
2734
            filter_id: UUID of an existing filter to use for the query
2735
            trash: True to request the tickets in the trashcan
2736
2737
        Returns:
2738
            The response. See :py:meth:`send_command` for details.
2739
        """
2740
        cmd = XmlCommand("get_tickets")
2741
2742
        add_filter(cmd, filter, filter_id)
2743
2744
        if trash is not None:
2745
            cmd.set_attribute("trash", to_bool(trash))
2746
2747
        return self._send_xml_command(cmd)
2748
2749
    def get_ticket(self, ticket_id: str) -> Any:
2750
        """Request a single ticket