class Tinybucket::Api::CommitsApi
Commits Api
client
@!attribute [rw] repo_owner
@return [String] repository owner name.
@!attribute [rw] repo_slug
@return [String] {https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D repository slug}.
Attributes
Public Instance Methods
Send 'POST a commit approval' request @see developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/approve#post
POST a commit approval request
@param revision [String] @param options [Hash] @return [true, false]
# File lib/tinybucket/api/commits_api.rb, line 57 def approve(revision, options = {}) result = post_path(path_to_approve(revision), options) (result['approved'] == true) rescue Tinybucket::Error::Conflict => e logger.debug 'Already approved: ' + e.inspect true end
Send 'GET commits for a branch' request
GET an individual commit
@param name [String] The branch name or a SHA1 value for the commit. @param options [Hash] @return [Tinybucket::Model::Commit]
# File lib/tinybucket/api/commits_api.rb, line 88 def branch(name, options = {}) get_path( path_to_branch(name), options, get_parser(:collection, Tinybucket::Model::Commit) ) end
Send 'GET an individual commit' request
GET an individual commit
@param revision [String] A SHA1 value for the commit. @param options [Hash] @return [Tinybucket::Model::Commit]
# File lib/tinybucket/api/commits_api.rb, line 42 def find(revision, options = {}) get_path( path_to_find(revision), options, get_parser(:object, Tinybucket::Model::Commit) ) end
Send 'GET a commits list for a repository' request
GET a commits list for a repository
@note This method does not support 'compare commits across branches'
API call, yet.
@param options [Hash] @return [Tinybucket::Model::Page]
# File lib/tinybucket/api/commits_api.rb, line 26 def list(options = {}) get_path( path_to_list, options, get_parser(:collection, Tinybucket::Model::Commit) ) end
Send 'DELETE a commit approval' request @see developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bnode%7D/approve#delete
DELETE a commit approval (unapprove the commit)
@param revision [String] @param options [Hash] @return [true, false]
# File lib/tinybucket/api/commits_api.rb, line 72 def unapprove(revision, options = {}) delete_path(path_to_approve(revision), options) true rescue Tinybucket::Error::NotFound => e logger.debug 'Already unapproved: ' + e.inspect true end