0.4.3 - 2020-02-21
Added
py42.settings.items_per_page
. This effectively replacespage_size
for the methods that were changed below.
Changed
The following resources no longer accept page_num
and page_size
parameters and no longer return a
requests.Response
object:
UserClient.get_users()
DeviceClient.get_devices()
OrgClient.get_orgs()
LegalHoldClient.get_legal_holds()
LegalHoldClient.get_legal_hold_memberships()
DepartingEmployeeClient.get_all_departing_employees()
They instead return a generator object that is iterated over to retrieve all the pages, eliminating the need to
manually compose loops to retrieve each page. For example, the below snippet will retrieve all pages of users:
for page in users.get_users():
user_list = json.loads(page.text)["data"]["users"]