Code Duplication    Length = 25-25 lines in 3 locations

gvm/protocols/gmpv208/gmpv208.py 1 location

@@ 270-294 (lines=25) @@
267
        """
268
        return self._send_xml_command(XmlCommand("empty_trashcan"))
269
270
    def get_groups(
271
        self,
272
        *,
273
        filter: Optional[str] = None,
274
        filter_id: Optional[str] = None,
275
        trash: Optional[bool] = None,
276
    ) -> Any:
277
        """Request a list of groups
278
279
        Arguments:
280
            filter: Filter term to use for the query
281
            filter_id: UUID of an existing filter to use for the query
282
            trash: Whether to get the trashcan groups instead
283
284
        Returns:
285
            The response. See :py:meth:`send_command` for details.
286
        """
287
        cmd = XmlCommand("get_groups")
288
289
        add_filter(cmd, filter, filter_id)
290
291
        if trash is not None:
292
            cmd.set_attribute("trash", to_bool(trash))
293
294
        return self._send_xml_command(cmd)
295
296
    def get_group(self, group_id: str) -> Any:
297
        """Request a single group

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

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

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

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