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
listofUpdateUserobjects. If search is specified, then onlyUpdateUserswho match those search criteria will be returned in the list. Otherwise, allUpdateUsers‘s will be returned.Parameters: search – A dictof search criteria. Key’s in thisdictmuch map to an attribute aUpdateUsersinstance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a listofUpdateUserobjects
-
dyn.tm.accounts.get_users(search=None)[source]¶ Return a
listofUserobjects. 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 dictof search criteria. Key’s in thisdictmuch map to an attribute aUserinstance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a listofUserobjects
-
dyn.tm.accounts.get_permissions_groups(search=None)[source]¶ Return a
listofPermissionGroupobjects. 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 dictof search criteria. Key’s in thisdictmuch map to an attribute aPermissionGroupinstance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a listofPermissionGroupobjects
-
dyn.tm.accounts.get_contacts(search=None)[source]¶ Return a
listofContactobjects. 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 dictof search criteria. Key’s in thisdictmuch map to an attribute aContactinstance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a listofContactobjects
-
dyn.tm.accounts.get_notifiers(search=None)[source]¶ Return a
listofNotifierobjects. 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 dictof search criteria. Key’s in thisdictmuch map to an attribute aNotifierinstance and the value mapped to by that key will be used as the search criteria for that key when searching.Returns: a listofNotifierobjects
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>]