class Github::Client::Orgs::Teams

def add_member(*args)

Other tags:
    Api: - public
def add_member(*args)
  arguments(args, required: [:id, :user])
  put_request("/teams/#{arguments.id}/members/#{arguments.user}", arguments.params)
end

def add_repo(*args)

Other tags:
    Api: - public
def add_repo(*args)
  arguments(args, required: [:id, :user, :repo])
  put_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params)
end

def create(*args)

Other tags:
    Api: - public

Parameters:
  • params (Hash) --
def create(*args)
  arguments(args, required: [:org_name]) do
    permit VALID_TEAM_PARAM_NAMES
    assert_values VALID_TEAM_PARAM_VALUES
    assert_required %w[name]
  end
  post_request("/orgs/#{arguments.org_name}/teams", arguments.params)
end

def delete(*args)


github.orgs.teams.delete 'team-id'
github = Github.new oauth_token: '...'
@example

of the org that the team is associated with
In order to delete a team, the authenticated user must be an owner

Delete a team
def delete(*args)
  arguments(args, required: [:id])
  delete_request("/teams/#{arguments.id}", arguments.params)
end

def edit(*args)

Other tags:
    Api: - public

Parameters:
  • params (Hash) --
def edit(*args)
  arguments(args, required: [:id]) do
    permit VALID_TEAM_PARAM_NAMES
    assert_values VALID_TEAM_PARAM_VALUES
    assert_required %w[name]
  end
  patch_request("/teams/#{arguments.id}", arguments.params)
end

def get(*args)

Other tags:
    Api: - public
def get(*args)
  arguments(args, required: [:id])
  get_request("/teams/#{arguments.id}", arguments.params)
end

def list(*args)

Other tags:
    Api: - public
def list(*args)
  params = arguments(args).params
  response = if org = params.delete('org')
    get_request("/orgs/#{org}/teams", params)
  else
    get_request("/user/teams", params)
  end
  return response unless block_given?
  response.each { |el| yield el }
end

def list_members(*args)

Other tags:
    Api: - public
def list_members(*args)
  arguments(args, required: [:id])
  response = get_request("/teams/#{arguments.id}/members", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def list_repos(*args)

Other tags:
    Api: - public
def list_repos(*args)
  arguments(args, required: [:id])
  response = get_request("/teams/#{arguments.id}/repos", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def remove_member(*args)

Other tags:
    Api: - public
def remove_member(*args)
  arguments(args, required: [:id, :user])
  delete_request("/teams/#{arguments.id}/members/#{arguments.user}", arguments.params)
end

def remove_repo(*args)

Other tags:
    Api: - public
def remove_repo(*args)
  arguments(args, required: [:id, :user, :repo])
  delete_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params)
end

def team_member?(*args)

Other tags:
    Api: - public
def team_member?(*args)
  arguments(args, required: [:id, :user])
  response = get_request("/teams/#{arguments.id}/members/#{arguments.user}", arguments.params)
  response.status == 204
rescue Github::Error::NotFound
  false
end

def team_repo?(*args)

Other tags:
    Api: - public
def team_repo?(*args)
  arguments(args, required: [:id, :user, :repo])
  response = get_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params)
  response.status == 204
rescue Github::Error::NotFound
  false
end