Class: BitBucket::Users::Account

Inherits:
API
  • Object
show all
Defined in:
lib/bitbucket_rest_api/users/account.rb

Constant Summary

Constants included from Validations

Validations::VALID_API_KEYS

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

Connection::ALLOWED_OPTIONS

Constants included from Constants

Constants::ACCEPT, Constants::ACCEPT_CHARSET, Constants::CACHE_CONTROL, Constants::CONTENT_LENGTH, Constants::CONTENT_TYPE, Constants::DATE, Constants::ETAG, Constants::HEADER_LAST, Constants::HEADER_LINK, Constants::HEADER_NEXT, Constants::LOCATION, Constants::META_FIRST, Constants::META_LAST, Constants::META_NEXT, Constants::META_PREV, Constants::META_REL, Constants::PARAM_PAGE, Constants::PARAM_PER_PAGE, Constants::PARAM_START_PAGE, Constants::QUERY_STR_SEP, Constants::RATELIMIT_LIMIT, Constants::RATELIMIT_REMAINING, Constants::SERVER, Constants::USER_AGENT

Instance Method Summary collapse

Methods inherited from API

#_merge_mime_type, #_merge_user_into_params!, #_merge_user_repo_into_params!, #_update_user_repo_params, #api_methods_in, inherited, #initialize, #method_missing, #process_basic_auth, #set_api_client, #setup, #update_and_validate_user_repo_params

Methods included from Normalizer

#normalize!

Methods included from ParameterFilter

#filter!

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

#validates_token_for

Methods included from Validations::Format

#assert_valid_values

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

This class inherits a constructor from BitBucket::API

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BitBucket::API

Instance Method Details

#delete_key(accountname, key_id) ⇒ Object

DELETE a key



49
50
51
# File 'lib/bitbucket_rest_api/users/account.rb', line 49

def delete_key(accountname, key_id)
  response = delete_request("/1.0/users/#{accountname}/ssh-keys/#{key_id}")
end

#emails(accountname) ⇒ Object

GET the emails



23
24
25
# File 'lib/bitbucket_rest_api/users/account.rb', line 23

def emails(accountname)
  response = get_request("/1.0/users/#{accountname}/emails")
end

#events(accountname) ⇒ Object

GET the events



33
34
35
# File 'lib/bitbucket_rest_api/users/account.rb', line 33

def events(accountname)
  response = get_request("/1.0/users/#{accountname}/events")
end

#followers(accountname) ⇒ Object

GET the followers



28
29
30
# File 'lib/bitbucket_rest_api/users/account.rb', line 28

def followers(accountname)
  response = get_request("/1.0/users/#{accountname}/followers")
end

#keys(accountname) ⇒ Object

GET the keys



38
39
40
# File 'lib/bitbucket_rest_api/users/account.rb', line 38

def keys(accountname)
  response = get_request("/1.0/users/#{accountname}/ssh-keys")
end

#new_key(accountname, params) ⇒ Object

POST a new key params should be in format “”, label:“”



44
45
46
# File 'lib/bitbucket_rest_api/users/account.rb', line 44

def new_key(accountname, params)
  response = post_request("/1.0/users/#{accountname}/ssh-keys/", params)
end

#plan(accountname) ⇒ Object

GET the account plan



18
19
20
# File 'lib/bitbucket_rest_api/users/account.rb', line 18

def plan(accountname)
  response = get_request("/1.0/users/#{accountname}/plan")
end

#profile(accountname) ⇒ Object

GET the account profile



13
14
15
# File 'lib/bitbucket_rest_api/users/account.rb', line 13

def profile(accountname)
  response = get_request("/1.0/users/#{accountname}")
end