Class: BitBucket::User
Constant Summary collapse
- DEFAULT_USER_OPTIONS =
{ 'first_name' => '', 'last_name' => '', 'avatar' => '' # TODO: can this filed be modified? # "resource_uri" => "" }.freeze
Constants included from Validations
Constants included from Validations::Token
Validations::Token::TOKEN_REQUIRED, Validations::Token::TOKEN_REQUIRED_REGEXP
Constants included from Request
Request::METHODS, Request::METHODS_WITH_BODIES
Constants included from Connection
Instance Method Summary collapse
-
#dashboard ⇒ Object
GET the list of repositories on the dashboard Gets the repositories list from the account’s dashboard.
-
#follows ⇒ Object
GET a list of repositories an account follows Gets the details of the repositories that the individual or team account follows.
-
#initialize(options = {}) ⇒ User
constructor
Creates new User API.
-
#overview ⇒ Object
GET a list of repositories the account is following Gets a list of the repositories the account follows.
-
#privileges ⇒ Object
GET a list of user privileges.
-
#profile ⇒ Object
Gets the basic information associated with an account and a list of all of the repositories owned by the user.
-
#repositories ⇒ Object
(also: #repos)
GET a list of repositories visible to an account Gets the details of the repositories that the user owns or has at least read access to.
-
#update(params = {}) ⇒ Object
Parameters *
:first_name
Optional string *:last_name
Optional string *:avatar
Optional string *:resource_uri
Optional string.
Methods inherited from API
#_merge_mime_type, #_merge_user_into_params!, #_merge_user_repo_into_params!, #_update_user_repo_params, #api_methods_in, inherited, #method_missing, #process_basic_auth, #set_api_client, #setup, #update_and_validate_user_repo_params
Methods included from Normalizer
Methods included from ParameterFilter
Methods included from AutoloadHelper
#autoload_all, #lookup_constant, #register_constant
Methods included from Validations::Required
#assert_required_keys, #assert_required_values_present, #parse_values
Methods included from Validations::Token
Methods included from Validations::Format
Methods included from Validations::Presence
#_validate_presence_of, #_validate_user_repo_params
Methods included from Request
#delete_request, #get_request, #patch_request, #post_request, #put_request, #request
Methods included from Connection
caching?, clear_cache, connection, default_middleware, default_options, stack
Methods included from Authorization
#authenticated?, #authentication, #basic_authed?
Constructor Details
#initialize(options = {}) ⇒ User
Creates new User API
13 14 15 |
# File 'lib/bitbucket_rest_api/user.rb', line 13 def initialize( = {}) super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BitBucket::API
Instance Method Details
#dashboard ⇒ Object
GET the list of repositories on the dashboard Gets the repositories list from the account’s dashboard.
83 84 85 |
# File 'lib/bitbucket_rest_api/user.rb', line 83 def dashboard get_request('/1.0/user/repositories/dashboard') end |
#follows ⇒ Object
GET a list of repositories an account follows Gets the details of the repositories that the individual or team account follows. This call returns the full data about the repositories including if the repository is a fork of another repository. An account always “follows” its own repositories.
60 61 62 |
# File 'lib/bitbucket_rest_api/user.rb', line 60 def follows get_request('/1.0/user/follows') end |
#overview ⇒ Object
GET a list of repositories the account is following Gets a list of the repositories the account follows. This is the same list that appears on the Following tab on your account dashboard.
77 78 79 |
# File 'lib/bitbucket_rest_api/user.rb', line 77 def overview get_request('/1.0/user/repositories/overview') end |
#privileges ⇒ Object
GET a list of user privileges
51 52 53 |
# File 'lib/bitbucket_rest_api/user.rb', line 51 def privileges get_request('/1.0/user/privileges') end |
#profile ⇒ Object
Gets the basic information associated with an account and a list of all of the repositories owned by the user. See confluence.atlassian.com/display/BITBUCKET/user+Endpoint#userEndpoint-GETauserprofile
Examples
bitbucket = BitBucket.new
bitbucket.user_api.profile
25 26 27 |
# File 'lib/bitbucket_rest_api/user.rb', line 25 def profile get_request('/1.0/user') end |
#repositories ⇒ Object Also known as: repos
GET a list of repositories visible to an account Gets the details of the repositories that the user owns or has at least read access to. Use this if you’re looking for a full list of all of the repositories associated with a user.
68 69 70 |
# File 'lib/bitbucket_rest_api/user.rb', line 68 def repositories get_request('/1.0/user/repositories') end |
#update(params = {}) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/bitbucket_rest_api/user.rb', line 43 def update(params = {}) normalize! params filter! DEFAULT_USER_OPTIONS, params put_request('/1.0/user', DEFAULT_USER_OPTIONS.merge(params)) end |