Code Duplication    Length = 25-25 lines in 4 locations

gvm/protocols/gmpv208/entities/permissions.py 1 location

@@ 183-207 (lines=25) @@
180
181
        return self._send_xml_command(cmd)
182
183
    def get_permissions(
184
        self,
185
        *,
186
        filter_string: Optional[str] = None,
187
        filter_id: Optional[str] = None,
188
        trash: Optional[bool] = None,
189
    ) -> Any:
190
        """Request a list of permissions
191
192
        Arguments:
193
            filter_string: Filter term to use for the query
194
            filter_id: UUID of an existing filter to use for the query
195
            trash: Whether to get permissions in the trashcan instead
196
197
        Returns:
198
            The response. See :py:meth:`send_command` for details.
199
        """
200
        cmd = XmlCommand("get_permissions")
201
202
        add_filter(cmd, filter_string, filter_id)
203
204
        if trash is not None:
205
            cmd.set_attribute("trash", to_bool(trash))
206
207
        return self._send_xml_command(cmd)
208
209
    def get_permission(self, permission_id: str) -> Any:
210
        """Request a single permission

gvm/protocols/gmpv208/entities/tickets.py 1 location

@@ 144-168 (lines=25) @@
141
142
        return self._send_xml_command(cmd)
143
144
    def get_tickets(
145
        self,
146
        *,
147
        trash: Optional[bool] = None,
148
        filter_string: Optional[str] = None,
149
        filter_id: Optional[str] = None,
150
    ) -> Any:
151
        """Request a list of tickets
152
153
        Arguments:
154
            filter_string: Filter term to use for the query
155
            filter_id: UUID of an existing filter to use for the query
156
            trash: True to request the tickets in the trashcan
157
158
        Returns:
159
            The response. See :py:meth:`send_command` for details.
160
        """
161
        cmd = XmlCommand("get_tickets")
162
163
        add_filter(cmd, filter_string, filter_id)
164
165
        if trash is not None:
166
            cmd.set_attribute("trash", to_bool(trash))
167
168
        return self._send_xml_command(cmd)
169
170
    def get_ticket(self, ticket_id: str) -> Any:
171
        """Request a single ticket

gvm/protocols/gmpv208/entities/groups.py 1 location

@@ 105-129 (lines=25) @@
102
103
        return self._send_xml_command(cmd)
104
105
    def get_groups(
106
        self,
107
        *,
108
        filter_string: Optional[str] = None,
109
        filter_id: Optional[str] = None,
110
        trash: Optional[bool] = None,
111
    ) -> Any:
112
        """Request a list of groups
113
114
        Arguments:
115
            filter_string: Filter term to use for the query
116
            filter_id: UUID of an existing filter to use for the query
117
            trash: Whether to get the trashcan groups instead
118
119
        Returns:
120
            The response. See :py:meth:`send_command` for details.
121
        """
122
        cmd = XmlCommand("get_groups")
123
124
        add_filter(cmd, filter_string, filter_id)
125
126
        if trash is not None:
127
            cmd.set_attribute("trash", to_bool(trash))
128
129
        return self._send_xml_command(cmd)
130
131
    def get_group(self, group_id: str) -> Any:
132
        """Request a single group

gvm/protocols/gmpv208/entities/roles.py 1 location

@@ 99-123 (lines=25) @@
96
97
        return self._send_xml_command(cmd)
98
99
    def get_roles(
100
        self,
101
        *,
102
        filter_string: Optional[str] = None,
103
        filter_id: Optional[str] = None,
104
        trash: Optional[bool] = None,
105
    ) -> Any:
106
        """Request a list of roles
107
108
        Arguments:
109
            filter_string: Filter term to use for the query
110
            filter_id: UUID of an existing filter to use for the query
111
            trash: Whether to get the trashcan roles instead
112
113
        Returns:
114
            The response. See :py:meth:`send_command` for details.
115
        """
116
        cmd = XmlCommand("get_roles")
117
118
        add_filter(cmd, filter_string, filter_id)
119
120
        if trash is not None:
121
            cmd.set_attribute("trash", to_bool(trash))
122
123
        return self._send_xml_command(cmd)
124
125
    def get_role(self, role_id: str) -> Any:
126
        """Request a single role