Class: Tinybucket::Api::BranchRestrictionsApi
- Includes:
- Helper::BranchRestrictionsHelper
- Defined in:
- lib/tinybucket/api/branch_restrictions_api.rb
Overview
BranchRestrictions API client
Constant Summary
Constants included from Connection
Connection::DEFAULT_USER_AGENT
Instance Attribute Summary collapse
-
#repo_owner ⇒ String
Repository owner name.
- #repo_slug ⇒ String
Instance Method Summary collapse
-
#find(restriction_id, options = {}) ⇒ Tinybucket::Model::BranchRestriction
Send ‘GET a specific restriction’ request.
-
#list(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the branch-restrictions’ request.
Methods included from Connection
#caching?, #clear_cache, #connection
Instance Attribute Details
#repo_owner ⇒ String
Returns repository owner name.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/tinybucket/api/branch_restrictions_api.rb', line 14 class BranchRestrictionsApi < BaseApi include Tinybucket::Api::Helper::BranchRestrictionsHelper attr_accessor :repo_owner, :repo_slug # Send 'GET the branch-restrictions' request. # # @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions#get # GET the branch-restrictions # # @param options [Hash] # @return [Tinybucket::Model::Page] def list( = {}) get_path( path_to_list, , get_parser(:collection, Tinybucket::Model::BranchRestriction) ) end # Send 'GET a specific restriction' request. # # @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#get # GET a specific restriction # # @param restriction_id [String] The restriction's identifier # @param options [Hash] # @return [Tinybucket::Model::BranchRestriction] def find(restriction_id, = {}) get_path( path_to_find(restriction_id), , get_parser(:object, Tinybucket::Model::BranchRestriction) ) end end |
#repo_slug ⇒ String
Returns repository slug.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/tinybucket/api/branch_restrictions_api.rb', line 14 class BranchRestrictionsApi < BaseApi include Tinybucket::Api::Helper::BranchRestrictionsHelper attr_accessor :repo_owner, :repo_slug # Send 'GET the branch-restrictions' request. # # @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions#get # GET the branch-restrictions # # @param options [Hash] # @return [Tinybucket::Model::Page] def list( = {}) get_path( path_to_list, , get_parser(:collection, Tinybucket::Model::BranchRestriction) ) end # Send 'GET a specific restriction' request. # # @see https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#get # GET a specific restriction # # @param restriction_id [String] The restriction's identifier # @param options [Hash] # @return [Tinybucket::Model::BranchRestriction] def find(restriction_id, = {}) get_path( path_to_find(restriction_id), , get_parser(:object, Tinybucket::Model::BranchRestriction) ) end end |
Instance Method Details
#find(restriction_id, options = {}) ⇒ Tinybucket::Model::BranchRestriction
Send ‘GET a specific restriction’ request.
42 43 44 45 46 47 48 |
# File 'lib/tinybucket/api/branch_restrictions_api.rb', line 42 def find(restriction_id, = {}) get_path( path_to_find(restriction_id), , get_parser(:object, Tinybucket::Model::BranchRestriction) ) end |
#list(options = {}) ⇒ Tinybucket::Model::Page
Send ‘GET the branch-restrictions’ request.
26 27 28 29 30 31 32 |
# File 'lib/tinybucket/api/branch_restrictions_api.rb', line 26 def list( = {}) get_path( path_to_list, , get_parser(:collection, Tinybucket::Model::BranchRestriction) ) end |