Roles
- class Role(...)
- delete()
Since roles cannot be deletet via REST API, this method is not implemented
- Raises:
NotImplementedError
- last_request_age_s()
- Returns:
time in seconds since the last request
- Return type:
float | None
- reload(expand=False)
Update the object properties by requesting the current data from the server.
- Parameters:
expand – if
Truethe properties will contain additional information.
Note
if
EXPANDED_ATTRIBUTEScontains'*'expand will always beTrue
- update(**kwargs)
Update the resource properties.
- Parameters:
kwargs – values to be updated (depending on the resource)
- Returns:
a new instance of the updated resource
- Return type:
same as object
- view()
returns a mapping view of the objects internal properties as returned by the REST API.
- EXPANDED_ATTRIBUTES = ('created_by', 'groups', 'knowledge_base_permissions', 'permissions', 'updated_by')
- active
- created_at: datetime
- default_at_signup: bool
- id
- knowledge_base_permissions: List[str]
- name
- note
- permissions: List[str]
- updated_at: datetime
- url
the API endpoint URL
- class Roles(...)
- create(name, **kwargs)
Create a new role.
- Parameters:
name (str) – role identifier name
kwargs – additional role properties
- Returns:
the newly created object
- Return type:
- iter(*args, **params)
Iterate through all objects.
With
paramsyou can also override the pagination defaults set inClient.paginationThe returned iterable can be used in for loops or fill a Python container like
listortuple.items = tuple(resource.iter(...)) for item in resource.iter(page=5, page_size=20, expand=True): print(item)
- Parameters:
args – additional endpoint arguments
params – additional pagination options like
page,page_size,extend
- DEFAULT_CACHE_SIZE = -1
controls the LRU cache behaviour
LRU disabled, cache unbounded (-1)
disable caching (0)
limited LRU caching (>0)
- cache
resource LRU cache
- endpoint: str
- url