class BitBucket::Teams

Public Class Methods

new(options = { }) click to toggle source
Calls superclass method BitBucket::API::new
# File lib/bitbucket_rest_api/teams.rb, line 7
def initialize(options = { })
  super(options)
end

Public Instance Methods

all(user_role)
Alias for: list
followers(team_name) { |el| ... } click to toggle source

List followers of the provided team

Examples

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.followers(:team_name_here)
bitbucket.teams.followers(:team_name_here) { |follower| ... }
# File lib/bitbucket_rest_api/teams.rb, line 54
def followers(team_name)
  response = get_request("/2.0/teams/#{team_name.to_s}/followers")
  return response["values"] unless block_given?
  response["values"].each { |el| yield el }
end
following(team_name) { |el| ... } click to toggle source

List accounts following the provided team

Examples

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.following(:team_name_here)
bitbucket.teams.following(:team_name_here) { |followee| ... }
# File lib/bitbucket_rest_api/teams.rb, line 66
def following(team_name)
  response = get_request("/2.0/teams/#{team_name.to_s}/following")
  return response["values"] unless block_given?
  response["values"].each { |el| yield el }
end
list(user_role) { |el| ... } click to toggle source

List teams for the authenticated user where the user has the provided role Roles are :admin, :contributor, :member

Examples

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.list(:admin)
bitbucket.teams.list('member')
bitbucket.teams.list(:contributor) { |team| ... }
# File lib/bitbucket_rest_api/teams.rb, line 19
def list(user_role)
  response = get_request("/2.0/teams/?role=#{user_role.to_s}")
  return response["values"] unless block_given?
  response["values"].each { |el| yield el }
end
Also aliased as: all
members(team_name) { |el| ... } click to toggle source

List members of the provided team

Examples

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.members(:team_name_here)
bitbucket.teams.members(:team_name_here) { |member| ... }
# File lib/bitbucket_rest_api/teams.rb, line 42
def members(team_name)
  response = get_request("/2.0/teams/#{team_name.to_s}/members")
  return response["values"] unless block_given?
  response["values"].each { |el| yield el }
end
profile(team_name) click to toggle source

Return the profile for the provided team

Example

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.profile(:team_name_here)
# File lib/bitbucket_rest_api/teams.rb, line 32
def profile(team_name)
  get_request("/2.0/teams/#{team_name.to_s}")
end
repos(team_name) { |el| ... } click to toggle source

List repos for provided team Private repos will only be returned if the user is authorized to view them

Examples

bitbucket = BitBucket.new :oauth_token => '...', :oauth_secret => '...'
bitbucket.teams.repos(:team_name_here)
bitbucket.teams.repos(:team_name_here) { |repo| ... }
# File lib/bitbucket_rest_api/teams.rb, line 79
def repos(team_name)
  response = get_request("/2.0/repositories/#{team_name.to_s}")
  return response["values"] unless block_given?
  response["values"].each { |el| yield el }
end
Also aliased as: repositories
repositories(team_name)
Alias for: repos