Skip to content

Commit 814f55e

Browse files
author
David-Lim0305
committed
feat(User Management): support include_settings and substring search for GET list users API (#198)
Signed-off-by: David Lim <[email protected]>
1 parent 22e1f19 commit 814f55e

File tree

4 files changed

+580
-86
lines changed

4 files changed

+580
-86
lines changed

examples/test_user_management_v1_examples.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,58 @@ def test_list_users_example(self):
186186
except ApiException as e:
187187
pytest.fail(str(e))
188188

189+
@needscredentials
190+
def test_list_users_example_with_include_settings(self):
191+
"""
192+
list_users request example
193+
"""
194+
try:
195+
print('\nlist_users() result:')
196+
# begin-list_users
197+
198+
all_results = []
199+
pager = UsersPager(
200+
client=user_management_service,
201+
account_id=account_id,
202+
include_settings=True,
203+
)
204+
while pager.has_next():
205+
next_page = pager.get_next()
206+
assert next_page is not None
207+
all_results.extend(next_page)
208+
209+
print(json.dumps(all_results, indent=2))
210+
211+
# end-list_users
212+
except ApiException as e:
213+
pytest.fail(str(e))
214+
215+
@needscredentials
216+
def test_list_users_example_with_search(self):
217+
"""
218+
list_users request example
219+
"""
220+
try:
221+
print('\nlist_users() result:')
222+
# begin-list_users
223+
224+
all_results = []
225+
pager = UsersPager(
226+
client=user_management_service,
227+
account_id=account_id,
228+
search="state%3AACTIVE",
229+
)
230+
while pager.has_next():
231+
next_page = pager.get_next()
232+
assert next_page is not None
233+
all_results.extend(next_page)
234+
235+
print(json.dumps(all_results, indent=2))
236+
237+
# end-list_users
238+
except ApiException as e:
239+
pytest.fail(str(e))
240+
189241
@needscredentials
190242
def test_remove_user_example(self):
191243
"""

0 commit comments

Comments
 (0)