class Github::Client::Orgs::Teams

Api calls that require explicit permissions are noted.
who is a member of the owner’s team in the :org being managed.
All actions against teams require at a minimum an authenticated user

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_membership(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :role (String) --

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

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#add-team-membership -
def add_membership(*args)
  arguments(args, required: [:team_id, :user])
  put_request("/teams/#{arguments.team_id}/memberships/#{arguments.user}",
              arguments.params)
end

def add_repo(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#add-team-repo -
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

Options Hash: (**params)
  • :permission (String) --
  • :privacy (String) --
  • :repo_names (Array[String]) --
  • :description (String) --
  • :name (String) --

Parameters:
  • params (Hash) --

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#create-team -
def create(*args)
  arguments(args, required: [:org_name]) do
    assert_required %w(name)
  end
  post_request("/orgs/#{arguments.org_name}/teams", arguments.params)
end

def delete(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#delete-team -
def delete(*args)
  arguments(args, required: [:id])
  delete_request("/teams/#{arguments.id}", arguments.params)
end

def edit(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :permission (String) --
  • :privacy (String) --
  • :description (String) --
  • :name (String) --

Parameters:
  • params (Hash) --

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#edit-team -
def edit(*args)
  arguments(args, required: [:id]) do
    assert_required %w(name)
  end
  patch_request("/teams/#{arguments.id}", arguments.params)
end

def get(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#get-team -
def get(*args)
  arguments(args, required: [:id])
  get_request("/teams/#{arguments.id}", arguments.params)
end

def list(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#list-teams -
def list(*args)
  params = arguments(args).params
  if (org = params.delete('org'))
    response = get_request("/orgs/#{org}/teams", params)
  else
    response = 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

Parameters:
  • :team_id (Integer) --

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#list-team-members -
def list_members(*args)
  arguments(args, required: [:team_id])
  response = get_request("/teams/#{arguments.team_id}/members", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def list_repos(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#list-team-repos -
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

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#remove-team-member -
def remove_member(*args)
  arguments(args, required: [:id, :user])
  delete_request("/teams/#{arguments.id}/members/#{arguments.user}",
                 arguments.params)
end

def remove_membership(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#remove-team-membership -
def remove_membership(*args)
  arguments(args, required: [:team_id, :user])
  delete_request("/teams/#{arguments.team_id}/memberships/#{arguments.user}",
                 arguments.params)
end

def remove_repo(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#remove-team-repo -
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

Parameters:
  • :username (String) --
  • :team_id (Integer) --

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#get-team-member -
def team_member?(*args)
  arguments(args, required: [:team_id, :user])
  response = get_request("/teams/#{arguments.team_id}/members/#{arguments.user}", arguments.params)
  response.status == 204
rescue Github::Error::NotFound
  false
end

def team_membership(*args)

Other tags:
    Api: - public

Parameters:
  • :username (String) --
  • :team_id (Integer) --

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#get-team-membership -
def team_membership(*args)
  arguments(args, required: [:team_id, :username])
  get_request("/teams/#{arguments.team_id}/memberships/#{arguments.username}",
              arguments.params)
end

def team_repo?(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/orgs/teams/#get-team-repo -
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