本文整理匯總了Python中sevenbridges.meta.transformer.Transform.to_team方法的典型用法代碼示例。如果您正苦於以下問題:Python Transform.to_team方法的具體用法?Python Transform.to_team怎麽用?Python Transform.to_team使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sevenbridges.meta.transformer.Transform
的用法示例。
在下文中一共展示了Transform.to_team方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: add_member_team
# 需要導入模塊: from sevenbridges.meta.transformer import Transform [as 別名]
# 或者: from sevenbridges.meta.transformer.Transform import to_team [as 別名]
def add_member_team(self, team, permissions):
"""
Add a member (team) to a project.
:param team: Team object or team identifier.
:param permissions: Permissions dictionary.
:return: Member object.
"""
team = Transform.to_team(team)
data = {'id': team, 'type': 'TEAM'}
if isinstance(permissions, dict):
data.update({
'permissions': permissions
})
extra = {
'resource': self.__class__.__name__,
'query': {
'id': self.id,
'data': data,
}
}
logger.info('Adding team member using team id', extra=extra)
response = self._api.post(
url=self._URL['members_query'].format(id=self.id), data=data)
member_data = response.json()
return Member(api=self._api, **member_data)
示例2: test_transform_teams
# 需要導入模塊: from sevenbridges.meta.transformer import Transform [as 別名]
# 或者: from sevenbridges.meta.transformer.Transform import to_team [as 別名]
def test_transform_teams(team):
Transform.to_team(team)