Source code for FTrackCore.api.group

# :coding: utf-8
# :copyright: Copyright (c) 2014 ftrack

from .ftobject import FTObject
from .ftlist import FTList


[docs]def getGroups(): '''Return all top level groups.''' from .client import xmlServer response = xmlServer.action( 'getGroups', {} ) return FTList(Group, response)
[docs]class Group(FTObject): '''Represent a group.''' _type = 'group'
[docs] def getSubgroups(self): '''Return list of subgroups.''' # Local import to avoid circular. from .client import xmlServer response = xmlServer.action( 'getSubgroups', {'id': self.getId()} ) return FTList(Group, response)
[docs] def getMembers(self): '''Return list of users in the group.''' # Local import to avoid circular. from .client import xmlServer, User response = xmlServer.action( 'getMembers', {'id': self.getId()} ) return FTList(User, response)