4.3. Accounts¶
The accounts
module contains interfaces for all of the various Account
management features offered by the dyn.tm REST API
4.3.1. Search/List Functions¶
The following functions are primarily helper functions which will perform API
“Get All” calls. These functions all return a single list
containing
class representations of their respective types. For instance
get_all_users()
returns a list
of User
objects.
-
dyn.tm.accounts.
get_updateusers
(search=None)[source]¶ Return a
list
ofUpdateUser
objects. If search is specified, then onlyUpdateUsers
who match those search criteria will be returned in the list. Otherwise, allUpdateUsers
‘s will be returned.Parameters: search – A dict
of search criteria. Key’s in thisdict
much map to an attribute aUpdateUsers
instance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a list
ofUpdateUser
objects
-
dyn.tm.accounts.
get_users
(search=None)[source]¶ Return a
list
ofUser
objects. If search is specified, then only users who match those search parameters will be returned in the list. Otherwise, allUser
‘s will be returned.Parameters: search – A dict
of search criteria. Key’s in thisdict
much map to an attribute aUser
instance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a list
ofUser
objects
-
dyn.tm.accounts.
get_permissions_groups
(search=None)[source]¶ Return a
list
ofPermissionGroup
objects. If search is specified, then onlyPermissionGroup
‘s that match those search criteria will be returned in the list. Otherwise, allPermissionGroup
‘s will be returned.Parameters: search – A dict
of search criteria. Key’s in thisdict
much map to an attribute aPermissionGroup
instance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a list
ofPermissionGroup
objects
-
dyn.tm.accounts.
get_contacts
(search=None)[source]¶ Return a
list
ofContact
objects. If search is specified, then onlyContact
‘s who match those search criteria will be returned in the list. Otherwise, allContact
‘s will be returned.Parameters: search – A dict
of search criteria. Key’s in thisdict
much map to an attribute aContact
instance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a list
ofContact
objects
-
dyn.tm.accounts.
get_notifiers
(search=None)[source]¶ Return a
list
ofNotifier
objects. If search is specified, then onlyNotifier
‘s who match those search criteria will be returned in the list. Otherwise, allNotifier
‘s will be returned.Parameters: search – A dict
of search criteria. Key’s in thisdict
much map to an attribute aNotifier
instance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a list
ofNotifier
objects
4.3.1.1. Search/List Function Examples¶
Using these search functions is a fairly straightforward endeavour, you can either leave your search criteria as None and get a list of ALL objects of that type, or you can specify a search dict like so
>>> from dyn.tm.accounts import get_users
>>> all_users = get_users()
>>> all_users
[User: <jnappi>, User: <rshort>, User: <tmpuser35932>,...]
>>> search_criteria = {'first_name': 'Jon'}
>>> jons = get_users(search_criteria)
>>> jons
[User: <jnappi>, User: <jsmith>]