Skip to content

UserList

Hugh Jeremy edited this page Mar 27, 2019 · 2 revisions

Documentation > UserList

A User List is a collection of Users for whom the retrieving User has billing responsibility, and who were created using the Amatino API.

The User List excludes Users managed by the billing dashboard. See the User object documentation page for a description of the distinction between API-created users and those managed by the billing dashboard.

UserList complies with the Python Sequence protocol, meaning you can iterate over constituent Users, call len(), and access elements by integer subscript.

Properties

.generated_time - datetime

The time at which this UserList was computed.


.number_of_pages - int

The total number of pages required to display the entire UserList. Each UserList instance represents a single page.

Example: 3


.page - int

The single page this UserList represents.

Example: 1


.users - List[User]

A list of Users.


.state - State enum

The state of the Users in this UserList, either State.ALL, State.DELETED, or State.ACTIVE.

Example: State.ACTIVE


.has_more_pages - bool

Boolean indication of whether there are more pages to retrieve to fully display this UserList.

Example: False

Methods

classmethod .retrieve() -> UserList

Return a newly created User.

Parameters

  1. session - Session
  2. state - State enum
  3. page - _int_ = 1

Example

from amatino import State, UserList
user_list = UserList.retrieve(
   session=session,
   state=State.ACTIVE
)

Clone this wiki locally