MCPcopy
hub / github.com/donnemartin/gitsome / create_team

Method create_team

gitsome/lib/github3/orgs.py:388–411  ·  view source on GitHub ↗

Create a new team and return it. This only works if the authenticated user owns this organization. :param str name: (required), name to be given to the team :param list repo_names: (optional) repositories, e.g. ['github/dotfiles'] :param str permission:

(self, name, repo_names=[], permission='')

Source from the content-addressed store, hash-verified

386
387 @requires_auth
388 def create_team(self, name, repo_names=[], permission=''):
389 """Create a new team and return it.
390
391 This only works if the authenticated user owns this organization.
392
393 :param str name: (required), name to be given to the team
394 :param list repo_names: (optional) repositories, e.g.
395 ['github/dotfiles']
396 :param str permission: (optional), options:
397
398 - ``pull`` -- (default) members can not push or administer
399 repositories accessible by this team
400 - ``push`` -- members can push and pull but not administer
401 repositories accessible by this team
402 - ``admin`` -- members can push, pull and administer
403 repositories accessible by this team
404
405 :returns: :class:`Team <Team>`
406 """
407 data = {'name': name, 'repo_names': repo_names,
408 'permission': permission}
409 url = self._build_url('teams', base_url=self._api)
410 json = self._json(self._post(url, data), 201)
411 return self._instance_or_null(Team, json)
412
413 @requires_auth
414 def edit(self, billing_email=None, company=None, email=None, location=None,

Callers

nothing calls this directly

Calls 4

_build_urlMethod · 0.80
_jsonMethod · 0.80
_postMethod · 0.80
_instance_or_nullMethod · 0.80

Tested by

no test coverage detected