Method: Github::Client::Orgs::Teams#add_membership

Defined in:
lib/github_api/client/orgs/teams.rb

#add_membership(*args) ⇒ Object Also known as: add_team_membership

Add a team membership

In order to add a user to a team, the authenticated user must have ‘admin’ permissions to the team or be an owner of the org that the team is associated with.

Examples:

github = Github.new oauth_token: '...'
github.orgs.teams.add_membership 'team-id', 'user-name'

Parameters:

  • :team_id (Integer)
  • :username (String)
  • :params (Hash)
  • params (Hash)

    a customizable set of options

See Also:



299
300
301
302
303
304
# File 'lib/github_api/client/orgs/teams.rb', line 299

def add_membership(*args)
  arguments(args, required: [:team_id, :user])

  put_request("/teams/#{arguments.team_id}/memberships/#{arguments.user}",
              arguments.params)
end