github code42/py42 v0.4.3

latest releases: v1.27.1, v1.27.0, v1.26.2...
4 years ago

0.4.3 - 2020-02-21

Added

  • py42.settings.items_per_page. This effectively replaces page_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"]

Don't miss a new py42 release

NewReleases is sending notifications on new releases.