__init__ constructor
init
Initializes a new instance of User class.
def __init__(self):
...
init
Initializes a new instance of User.
def __init__(self, id, name, role):
...
| Parameter | Type | Description |
|---|---|---|
| id | int |
The user id. |
| name | str |
The user name. |
| role | Role |
The user role. |
Example
from groupdocs.annotation.models import User, Role
# Create a user with a name and role
user = User(name="Tom", role=Role.EDITOR)
# Create a user with an explicit id
user_with_id = User(id=123, name="Jack", role=Role.VIEWER)
See Also
- class
User