@@ 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 |
@@ 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 |