Skip to content

Commit 8491a3a

Browse files
authored
fix(Enterprise Management): re-gen service to get new Pagers (#177)
This commit contains a re-gen of the Enterprise Management service to leverage the new Pagers emitted by the SDK generator. Signed-off-by: Phil Adams <[email protected]>
1 parent 7d98f30 commit 8491a3a

File tree

5 files changed

+1002
-241
lines changed

5 files changed

+1002
-241
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2022-11-02T20:27:43Z",
6+
"generated_at": "2022-11-03T20:16:27Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

examples/test_enterprise_management_v1_examples.py

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# (C) Copyright IBM Corp. 2021.
2+
# (C) Copyright IBM Corp. 2021, 2022.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -148,18 +148,22 @@ def test_list_account_groups_example(self):
148148
assert enterprise_id is not None
149149

150150
try:
151-
152151
print('\nlist_account_groups() result:')
153152
# begin-list_account_groups
154153

155-
list_account_groups_response = enterprise_management_service.list_account_groups(
154+
all_results = []
155+
pager = AccountGroupsPager(
156+
client=enterprise_management_service,
156157
enterprise_id=enterprise_id,
157-
).get_result()
158+
)
159+
while pager.has_next():
160+
next_page = pager.get_next()
161+
assert next_page is not None
162+
all_results.extend(next_page)
158163

159-
print(json.dumps(list_account_groups_response, indent=2))
164+
print(json.dumps(all_results, indent=2))
160165

161166
# end-list_account_groups
162-
163167
except ApiException as e:
164168
pytest.fail(str(e))
165169

@@ -276,14 +280,19 @@ def test_list_accounts_example(self):
276280
print('\nlist_accounts() result:')
277281
# begin-list_accounts
278282

279-
list_accounts_response = enterprise_management_service.list_accounts(
283+
all_results = []
284+
pager = AccountsPager(
285+
client=enterprise_management_service,
280286
enterprise_id=enterprise_id,
281-
).get_result()
287+
)
288+
while pager.has_next():
289+
next_page = pager.get_next()
290+
assert next_page is not None
291+
all_results.extend(next_page)
282292

283-
print(json.dumps(list_accounts_response, indent=2))
293+
print(json.dumps(all_results, indent=2))
284294

285295
# end-list_accounts
286-
287296
except ApiException as e:
288297
pytest.fail(str(e))
289298

@@ -374,14 +383,19 @@ def test_list_enterprises_example(self):
374383
print('\nlist_enterprises() result:')
375384
# begin-list_enterprises
376385

377-
list_enterprises_response = enterprise_management_service.list_enterprises(
386+
all_results = []
387+
pager = EnterprisesPager(
388+
client=enterprise_management_service,
378389
account_id=enterprise_account_id,
379-
).get_result()
390+
)
391+
while pager.has_next():
392+
next_page = pager.get_next()
393+
assert next_page is not None
394+
all_results.extend(next_page)
380395

381-
print(json.dumps(list_enterprises_response, indent=2))
396+
print(json.dumps(all_results, indent=2))
382397

383398
# end-list_enterprises
384-
385399
except ApiException as e:
386400
pytest.fail(str(e))
387401

0 commit comments

Comments
 (0)