=begin
#Forgejo API
#This documentation describes the Forgejo API.
The version of the OpenAPI document: 10.0.0-121-28886cd+gitea-1.22.0
Generated by: https://openapi-generator.tech
Generator version: 7.12.0
=end
require 'cgi'
module Forgejo
class RepositoryApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Accept a repo transfer
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param [Hash] opts the optional parameters
# @return [Repository]
def accept_repo_transfer(owner, repo, opts = {})
data, _status_code, _headers = accept_repo_transfer_with_http_info(owner, repo, opts)
data
end
# Accept a repo transfer
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param [Hash] opts the optional parameters
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def accept_repo_transfer_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.accept_repo_transfer ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.accept_repo_transfer"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.accept_repo_transfer"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/transfer/accept'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.accept_repo_transfer",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#accept_repo_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a repository
# @param [Hash] opts the optional parameters
# @option opts [CreateRepoOption] :body
# @return [Repository]
def create_current_user_repo(opts = {})
data, _status_code, _headers = create_current_user_repo_with_http_info(opts)
data
end
# Create a repository
# @param [Hash] opts the optional parameters
# @option opts [CreateRepoOption] :body
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def create_current_user_repo_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.create_current_user_repo ...'
end
# resource path
local_var_path = '/user/repos'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.create_current_user_repo",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#create_current_user_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Fork a repository
# @param owner [String] owner of the repo to fork
# @param repo [String] name of the repo to fork
# @param [Hash] opts the optional parameters
# @option opts [CreateForkOption] :body
# @return [Repository]
def create_fork(owner, repo, opts = {})
data, _status_code, _headers = create_fork_with_http_info(owner, repo, opts)
data
end
# Fork a repository
# @param owner [String] owner of the repo to fork
# @param repo [String] name of the repo to fork
# @param [Hash] opts the optional parameters
# @option opts [CreateForkOption] :body
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def create_fork_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.create_fork ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.create_fork"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.create_fork"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/forks'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.create_fork",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#create_fork\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @option opts [CreateVariableOption] :body
# @return [nil]
def create_repo_variable(owner, repo, variablename, opts = {})
create_repo_variable_with_http_info(owner, repo, variablename, opts)
nil
end
# Create a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @option opts [CreateVariableOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def create_repo_variable_with_http_info(owner, repo, variablename, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.create_repo_variable ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.create_repo_variable"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.create_repo_variable"
end
# verify the required parameter 'variablename' is set
if @api_client.config.client_side_validation && variablename.nil?
fail ArgumentError, "Missing the required parameter 'variablename' when calling RepositoryApi.create_repo_variable"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/variables/{variablename}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'variablename' + '}', CGI.escape(variablename.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.create_repo_variable",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#create_repo_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a secret in a repository
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param secretname [String] name of the secret
# @param [Hash] opts the optional parameters
# @return [nil]
def delete_repo_secret(owner, repo, secretname, opts = {})
delete_repo_secret_with_http_info(owner, repo, secretname, opts)
nil
end
# Delete a secret in a repository
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param secretname [String] name of the secret
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_repo_secret_with_http_info(owner, repo, secretname, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.delete_repo_secret ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.delete_repo_secret"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.delete_repo_secret"
end
# verify the required parameter 'secretname' is set
if @api_client.config.client_side_validation && secretname.nil?
fail ArgumentError, "Missing the required parameter 'secretname' when calling RepositoryApi.delete_repo_secret"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/secrets/{secretname}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'secretname' + '}', CGI.escape(secretname.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.delete_repo_secret",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#delete_repo_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @return [ActionVariable]
def delete_repo_variable(owner, repo, variablename, opts = {})
data, _status_code, _headers = delete_repo_variable_with_http_info(owner, repo, variablename, opts)
data
end
# Delete a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @return [Array<(ActionVariable, Integer, Hash)>] ActionVariable data, response status code and response headers
def delete_repo_variable_with_http_info(owner, repo, variablename, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.delete_repo_variable ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.delete_repo_variable"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.delete_repo_variable"
end
# verify the required parameter 'variablename' is set
if @api_client.config.client_side_validation && variablename.nil?
fail ArgumentError, "Missing the required parameter 'variablename' when calling RepositoryApi.delete_repo_variable"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/variables/{variablename}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'variablename' + '}', CGI.escape(variablename.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'ActionVariable'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.delete_repo_variable",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#delete_repo_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Dispatches a workflow
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param workflowname [String] name of the workflow
# @param [Hash] opts the optional parameters
# @option opts [DispatchWorkflowOption] :body
# @return [nil]
def dispatch_workflow(owner, repo, workflowname, opts = {})
dispatch_workflow_with_http_info(owner, repo, workflowname, opts)
nil
end
# Dispatches a workflow
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param workflowname [String] name of the workflow
# @param [Hash] opts the optional parameters
# @option opts [DispatchWorkflowOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def dispatch_workflow_with_http_info(owner, repo, workflowname, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.dispatch_workflow ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.dispatch_workflow"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.dispatch_workflow"
end
# verify the required parameter 'workflowname' is set
if @api_client.config.client_side_validation && workflowname.nil?
fail ArgumentError, "Missing the required parameter 'workflowname' when calling RepositoryApi.dispatch_workflow"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/workflows/{workflowname}/dispatches'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'workflowname' + '}', CGI.escape(workflowname.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.dispatch_workflow",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#dispatch_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a repository using a template
# @param template_owner [String] name of the template repository owner
# @param template_repo [String] name of the template repository
# @param [Hash] opts the optional parameters
# @option opts [GenerateRepoOption] :body
# @return [Repository]
def generate_repo(template_owner, template_repo, opts = {})
data, _status_code, _headers = generate_repo_with_http_info(template_owner, template_repo, opts)
data
end
# Create a repository using a template
# @param template_owner [String] name of the template repository owner
# @param template_repo [String] name of the template repository
# @param [Hash] opts the optional parameters
# @option opts [GenerateRepoOption] :body
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def generate_repo_with_http_info(template_owner, template_repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.generate_repo ...'
end
# verify the required parameter 'template_owner' is set
if @api_client.config.client_side_validation && template_owner.nil?
fail ArgumentError, "Missing the required parameter 'template_owner' when calling RepositoryApi.generate_repo"
end
# verify the required parameter 'template_repo' is set
if @api_client.config.client_side_validation && template_repo.nil?
fail ArgumentError, "Missing the required parameter 'template_repo' when calling RepositoryApi.generate_repo"
end
# resource path
local_var_path = '/repos/{template_owner}/{template_repo}/generate'.sub('{' + 'template_owner' + '}', CGI.escape(template_owner.to_s)).sub('{' + 'template_repo' + '}', CGI.escape(template_repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.generate_repo",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#generate_repo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the tag object of an annotated tag (not lightweight tags)
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags.
# @param [Hash] opts the optional parameters
# @return [AnnotatedTag]
def get_annotated_tag(owner, repo, sha, opts = {})
data, _status_code, _headers = get_annotated_tag_with_http_info(owner, repo, sha, opts)
data
end
# Gets the tag object of an annotated tag (not lightweight tags)
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags.
# @param [Hash] opts the optional parameters
# @return [Array<(AnnotatedTag, Integer, Hash)>] AnnotatedTag data, response status code and response headers
def get_annotated_tag_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.get_annotated_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.get_annotated_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.get_annotated_tag"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.get_annotated_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/tags/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'AnnotatedTag'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.get_annotated_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#get_annotated_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the blob of a repository.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @return [GitBlobResponse]
def get_blob(owner, repo, sha, opts = {})
data, _status_code, _headers = get_blob_with_http_info(owner, repo, sha, opts)
data
end
# Gets the blob of a repository.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @return [Array<(GitBlobResponse, Integer, Hash)>] GitBlobResponse data, response status code and response headers
def get_blob_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.get_blob ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.get_blob"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.get_blob"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.get_blob"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/blobs/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'GitBlobResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.get_blob",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#get_blob\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @return [ActionVariable]
def get_repo_variable(owner, repo, variablename, opts = {})
data, _status_code, _headers = get_repo_variable_with_http_info(owner, repo, variablename, opts)
data
end
# Get a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @return [Array<(ActionVariable, Integer, Hash)>] ActionVariable data, response status code and response headers
def get_repo_variable_with_http_info(owner, repo, variablename, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.get_repo_variable ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.get_repo_variable"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.get_repo_variable"
end
# verify the required parameter 'variablename' is set
if @api_client.config.client_side_validation && variablename.nil?
fail ArgumentError, "Missing the required parameter 'variablename' when calling RepositoryApi.get_repo_variable"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/variables/{variablename}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'variablename' + '}', CGI.escape(variablename.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'ActionVariable'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.get_repo_variable",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#get_repo_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get repo-level variables list
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<ActionVariable>]
def get_repo_variables_list(owner, repo, opts = {})
data, _status_code, _headers = get_repo_variables_list_with_http_info(owner, repo, opts)
data
end
# Get repo-level variables list
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<ActionVariable>, Integer, Hash)>] Array<ActionVariable> data, response status code and response headers
def get_repo_variables_list_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.get_repo_variables_list ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.get_repo_variables_list"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.get_repo_variables_list"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/variables'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<ActionVariable>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.get_repo_variables_list",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#get_repo_variables_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the tree of a repository.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :recursive show all directories and files
# @option opts [Integer] :page page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page
# @option opts [Integer] :per_page number of items per page
# @return [GitTreeResponse]
def get_tree(owner, repo, sha, opts = {})
data, _status_code, _headers = get_tree_with_http_info(owner, repo, sha, opts)
data
end
# Gets the tree of a repository.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :recursive show all directories and files
# @option opts [Integer] :page page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page
# @option opts [Integer] :per_page number of items per page
# @return [Array<(GitTreeResponse, Integer, Hash)>] GitTreeResponse data, response status code and response headers
def get_tree_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.get_tree ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.get_tree"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.get_tree"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.get_tree"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/trees/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'recursive'] = opts[:'recursive'] if !opts[:'recursive'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'GitTreeResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.get_tree",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#get_tree\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's action tasks
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results, default maximum page size is 50
# @return [ActionTaskResponse]
def list_action_tasks(owner, repo, opts = {})
data, _status_code, _headers = list_action_tasks_with_http_info(owner, repo, opts)
data
end
# List a repository's action tasks
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results, default maximum page size is 50
# @return [Array<(ActionTaskResponse, Integer, Hash)>] ActionTaskResponse data, response status code and response headers
def list_action_tasks_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.list_action_tasks ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.list_action_tasks"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.list_action_tasks"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/tasks'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'ActionTaskResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.list_action_tasks",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#list_action_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's forks
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Repository>]
def list_forks(owner, repo, opts = {})
data, _status_code, _headers = list_forks_with_http_info(owner, repo, opts)
data
end
# List a repository's forks
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Repository>, Integer, Hash)>] Array<Repository> data, response status code and response headers
def list_forks_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.list_forks ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.list_forks"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.list_forks"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/forks'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Repository>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.list_forks",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#list_forks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Reject a repo transfer
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param [Hash] opts the optional parameters
# @return [Repository]
def reject_repo_transfer(owner, repo, opts = {})
data, _status_code, _headers = reject_repo_transfer_with_http_info(owner, repo, opts)
data
end
# Reject a repo transfer
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param [Hash] opts the optional parameters
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def reject_repo_transfer_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.reject_repo_transfer ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.reject_repo_transfer"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.reject_repo_transfer"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/transfer/reject'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.reject_repo_transfer",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#reject_repo_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a collaborator to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator to add
# @param [Hash] opts the optional parameters
# @option opts [AddCollaboratorOption] :body
# @return [nil]
def repo_add_collaborator(owner, repo, collaborator, opts = {})
repo_add_collaborator_with_http_info(owner, repo, collaborator, opts)
nil
end
# Add a collaborator to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator to add
# @param [Hash] opts the optional parameters
# @option opts [AddCollaboratorOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_add_collaborator_with_http_info(owner, repo, collaborator, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_add_collaborator ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_add_collaborator"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_add_collaborator"
end
# verify the required parameter 'collaborator' is set
if @api_client.config.client_side_validation && collaborator.nil?
fail ArgumentError, "Missing the required parameter 'collaborator' when calling RepositoryApi.repo_add_collaborator"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/collaborators/{collaborator}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_add_collaborator",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_add_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a flag to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_add_flag(owner, repo, flag, opts = {})
repo_add_flag_with_http_info(owner, repo, flag, opts)
nil
end
# Add a flag to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_add_flag_with_http_info(owner, repo, flag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_add_flag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_add_flag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_add_flag"
end
# verify the required parameter 'flag' is set
if @api_client.config.client_side_validation && flag.nil?
fail ArgumentError, "Missing the required parameter 'flag' when calling RepositoryApi.repo_add_flag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags/{flag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'flag' + '}', CGI.escape(flag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_add_flag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_add_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# add a push mirror to the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreatePushMirrorOption] :body
# @return [PushMirror]
def repo_add_push_mirror(owner, repo, opts = {})
data, _status_code, _headers = repo_add_push_mirror_with_http_info(owner, repo, opts)
data
end
# add a push mirror to the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreatePushMirrorOption] :body
# @return [Array<(PushMirror, Integer, Hash)>] PushMirror data, response status code and response headers
def repo_add_push_mirror_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_add_push_mirror ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_add_push_mirror"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_add_push_mirror"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/push_mirrors'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'PushMirror'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_add_push_mirror",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_add_push_mirror\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a team to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_add_team(owner, repo, team, opts = {})
repo_add_team_with_http_info(owner, repo, team, opts)
nil
end
# Add a team to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_add_team_with_http_info(owner, repo, team, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_add_team ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_add_team"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_add_team"
end
# verify the required parameter 'team' is set
if @api_client.config.client_side_validation && team.nil?
fail ArgumentError, "Missing the required parameter 'team' when calling RepositoryApi.repo_add_team"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/teams/{team}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'team' + '}', CGI.escape(team.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_add_team",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_add_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a topic to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param topic [String] name of the topic to add
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_add_topic(owner, repo, topic, opts = {})
repo_add_topic_with_http_info(owner, repo, topic, opts)
nil
end
# Add a topic to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param topic [String] name of the topic to add
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_add_topic_with_http_info(owner, repo, topic, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_add_topic ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_add_topic"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_add_topic"
end
# verify the required parameter 'topic' is set
if @api_client.config.client_side_validation && topic.nil?
fail ArgumentError, "Missing the required parameter 'topic' when calling RepositoryApi.repo_add_topic"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/topics/{topic}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'topic' + '}', CGI.escape(topic.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_add_topic",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_add_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Apply diff patch to repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param body [UpdateFileOptions]
# @param [Hash] opts the optional parameters
# @return [FileResponse]
def repo_apply_diff_patch(owner, repo, body, opts = {})
data, _status_code, _headers = repo_apply_diff_patch_with_http_info(owner, repo, body, opts)
data
end
# Apply diff patch to repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param body [UpdateFileOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
def repo_apply_diff_patch_with_http_info(owner, repo, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_apply_diff_patch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_apply_diff_patch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_apply_diff_patch"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_apply_diff_patch"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/diffpatch'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'FileResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_apply_diff_patch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_apply_diff_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Cancel the scheduled auto merge for the given pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to merge
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_cancel_scheduled_auto_merge(owner, repo, index, opts = {})
repo_cancel_scheduled_auto_merge_with_http_info(owner, repo, index, opts)
nil
end
# Cancel the scheduled auto merge for the given pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to merge
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_cancel_scheduled_auto_merge_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_cancel_scheduled_auto_merge ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_cancel_scheduled_auto_merge"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_cancel_scheduled_auto_merge"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_cancel_scheduled_auto_merge"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/merge'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_cancel_scheduled_auto_merge",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_cancel_scheduled_auto_merge\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Modify multiple files in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param body [ChangeFilesOptions]
# @param [Hash] opts the optional parameters
# @return [FilesResponse]
def repo_change_files(owner, repo, body, opts = {})
data, _status_code, _headers = repo_change_files_with_http_info(owner, repo, body, opts)
data
end
# Modify multiple files in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param body [ChangeFilesOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(FilesResponse, Integer, Hash)>] FilesResponse data, response status code and response headers
def repo_change_files_with_http_info(owner, repo, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_change_files ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_change_files"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_change_files"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_change_files"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'FilesResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_change_files",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_change_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Check if a user is a collaborator of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_check_collaborator(owner, repo, collaborator, opts = {})
repo_check_collaborator_with_http_info(owner, repo, collaborator, opts)
nil
end
# Check if a user is a collaborator of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_check_collaborator_with_http_info(owner, repo, collaborator, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_check_collaborator ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_check_collaborator"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_check_collaborator"
end
# verify the required parameter 'collaborator' is set
if @api_client.config.client_side_validation && collaborator.nil?
fail ArgumentError, "Missing the required parameter 'collaborator' when calling RepositoryApi.repo_check_collaborator"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/collaborators/{collaborator}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_check_collaborator",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_check_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Check if a repository has a given flag
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_check_flag(owner, repo, flag, opts = {})
repo_check_flag_with_http_info(owner, repo, flag, opts)
nil
end
# Check if a repository has a given flag
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_check_flag_with_http_info(owner, repo, flag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_check_flag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_check_flag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_check_flag"
end
# verify the required parameter 'flag' is set
if @api_client.config.client_side_validation && flag.nil?
fail ArgumentError, "Missing the required parameter 'flag' when calling RepositoryApi.repo_check_flag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags/{flag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'flag' + '}', CGI.escape(flag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_check_flag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_check_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Check if a team is assigned to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [Team]
def repo_check_team(owner, repo, team, opts = {})
data, _status_code, _headers = repo_check_team_with_http_info(owner, repo, team, opts)
data
end
# Check if a team is assigned to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [Array<(Team, Integer, Hash)>] Team data, response status code and response headers
def repo_check_team_with_http_info(owner, repo, team, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_check_team ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_check_team"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_check_team"
end
# verify the required parameter 'team' is set
if @api_client.config.client_side_validation && team.nil?
fail ArgumentError, "Missing the required parameter 'team' when calling RepositoryApi.repo_check_team"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/teams/{team}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'team' + '}', CGI.escape(team.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Team'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_check_team",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_check_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get commit comparison information
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param basehead [String] compare two branches or commits
# @param [Hash] opts the optional parameters
# @return [Compare]
def repo_compare_diff(owner, repo, basehead, opts = {})
data, _status_code, _headers = repo_compare_diff_with_http_info(owner, repo, basehead, opts)
data
end
# Get commit comparison information
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param basehead [String] compare two branches or commits
# @param [Hash] opts the optional parameters
# @return [Array<(Compare, Integer, Hash)>] Compare data, response status code and response headers
def repo_compare_diff_with_http_info(owner, repo, basehead, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_compare_diff ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_compare_diff"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_compare_diff"
end
# verify the required parameter 'basehead' is set
if @api_client.config.client_side_validation && basehead.nil?
fail ArgumentError, "Missing the required parameter 'basehead' when calling RepositoryApi.repo_compare_diff"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/compare/{basehead}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'basehead' + '}', CGI.escape(basehead.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Compare'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_compare_diff",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_compare_diff\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a branch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateBranchRepoOption] :body
# @return [Branch]
def repo_create_branch(owner, repo, opts = {})
data, _status_code, _headers = repo_create_branch_with_http_info(owner, repo, opts)
data
end
# Create a branch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateBranchRepoOption] :body
# @return [Array<(Branch, Integer, Hash)>] Branch data, response status code and response headers
def repo_create_branch_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_branch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_branch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_branch"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branches'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Branch'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_branch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a branch protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateBranchProtectionOption] :body
# @return [BranchProtection]
def repo_create_branch_protection(owner, repo, opts = {})
data, _status_code, _headers = repo_create_branch_protection_with_http_info(owner, repo, opts)
data
end
# Create a branch protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateBranchProtectionOption] :body
# @return [Array<(BranchProtection, Integer, Hash)>] BranchProtection data, response status code and response headers
def repo_create_branch_protection_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_branch_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_branch_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_branch_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branch_protections'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'BranchProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_branch_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_branch_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to create
# @param body [CreateFileOptions]
# @param [Hash] opts the optional parameters
# @return [FileResponse]
def repo_create_file(owner, repo, filepath, body, opts = {})
data, _status_code, _headers = repo_create_file_with_http_info(owner, repo, filepath, body, opts)
data
end
# Create a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to create
# @param body [CreateFileOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
def repo_create_file_with_http_info(owner, repo, filepath, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_file ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_file"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_file"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_create_file"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_create_file"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'FileResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_file",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateHookOption] :body
# @return [Hook]
def repo_create_hook(owner, repo, opts = {})
data, _status_code, _headers = repo_create_hook_with_http_info(owner, repo, opts)
data
end
# Create a hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateHookOption] :body
# @return [Array<(Hook, Integer, Hash)>] Hook data, response status code and response headers
def repo_create_hook_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Hook'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a key to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateKeyOption] :body
# @return [DeployKey]
def repo_create_key(owner, repo, opts = {})
data, _status_code, _headers = repo_create_key_with_http_info(owner, repo, opts)
data
end
# Add a key to a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateKeyOption] :body
# @return [Array<(DeployKey, Integer, Hash)>] DeployKey data, response status code and response headers
def repo_create_key_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_key ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_key"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_key"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/keys'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'DeployKey'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_key",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreatePullRequestOption] :body
# @return [PullRequest]
def repo_create_pull_request(owner, repo, opts = {})
data, _status_code, _headers = repo_create_pull_request_with_http_info(owner, repo, opts)
data
end
# Create a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreatePullRequestOption] :body
# @return [Array<(PullRequest, Integer, Hash)>] PullRequest data, response status code and response headers
def repo_create_pull_request_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_pull_request"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'PullRequest'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a review to an pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [CreatePullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [PullReview]
def repo_create_pull_review(owner, repo, index, body, opts = {})
data, _status_code, _headers = repo_create_pull_review_with_http_info(owner, repo, index, body, opts)
data
end
# Create a review to an pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [CreatePullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(PullReview, Integer, Hash)>] PullReview data, response status code and response headers
def repo_create_pull_review_with_http_info(owner, repo, index, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_create_pull_review"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_create_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'PullReview'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add a new comment to a pull request review
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [CreatePullReviewComment]
# @param [Hash] opts the optional parameters
# @return [PullReviewComment]
def repo_create_pull_review_comment(owner, repo, index, id, body, opts = {})
data, _status_code, _headers = repo_create_pull_review_comment_with_http_info(owner, repo, index, id, body, opts)
data
end
# Add a new comment to a pull request review
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [CreatePullReviewComment]
# @param [Hash] opts the optional parameters
# @return [Array<(PullReviewComment, Integer, Hash)>] PullReviewComment data, response status code and response headers
def repo_create_pull_review_comment_with_http_info(owner, repo, index, id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_pull_review_comment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_pull_review_comment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_pull_review_comment"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_create_pull_review_comment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_create_pull_review_comment"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_create_pull_review_comment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'PullReviewComment'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_pull_review_comment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_pull_review_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# create review requests for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [PullReviewRequestOptions]
# @param [Hash] opts the optional parameters
# @return [Array<PullReview>]
def repo_create_pull_review_requests(owner, repo, index, body, opts = {})
data, _status_code, _headers = repo_create_pull_review_requests_with_http_info(owner, repo, index, body, opts)
data
end
# create review requests for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [PullReviewRequestOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(Array<PullReview>, Integer, Hash)>] Array<PullReview> data, response status code and response headers
def repo_create_pull_review_requests_with_http_info(owner, repo, index, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_pull_review_requests ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_pull_review_requests"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_pull_review_requests"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_create_pull_review_requests"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_create_pull_review_requests"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/requested_reviewers'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'Array<PullReview>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_pull_review_requests",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_pull_review_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateReleaseOption] :body
# @return [Release]
def repo_create_release(owner, repo, opts = {})
data, _status_code, _headers = repo_create_release_with_http_info(owner, repo, opts)
data
end
# Create a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateReleaseOption] :body
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
def repo_create_release_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_release ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_release"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_release"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Release'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_release",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param [Hash] opts the optional parameters
# @option opts [String] :name name of the attachment
# @option opts [File] :attachment attachment to upload (this parameter is incompatible with `external_url`)
# @option opts [String] :external_url url to external asset (this parameter is incompatible with `attachment`)
# @return [Attachment]
def repo_create_release_attachment(owner, repo, id, opts = {})
data, _status_code, _headers = repo_create_release_attachment_with_http_info(owner, repo, id, opts)
data
end
# Create a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param [Hash] opts the optional parameters
# @option opts [String] :name name of the attachment
# @option opts [File] :attachment attachment to upload (this parameter is incompatible with `external_url`)
# @option opts [String] :external_url url to external asset (this parameter is incompatible with `attachment`)
# @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
def repo_create_release_attachment_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_release_attachment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_release_attachment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_release_attachment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_create_release_attachment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}/assets'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['multipart/form-data', 'application/octet-stream'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
form_params['attachment'] = opts[:'attachment'] if !opts[:'attachment'].nil?
form_params['external_url'] = opts[:'external_url'] if !opts[:'external_url'].nil?
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Attachment'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_release_attachment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_release_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a commit status
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [CreateStatusOption] :body
# @return [CommitStatus]
def repo_create_status(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_create_status_with_http_info(owner, repo, sha, opts)
data
end
# Create a commit status
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [CreateStatusOption] :body
# @return [Array<(CommitStatus, Integer, Hash)>] CommitStatus data, response status code and response headers
def repo_create_status_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_status ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_status"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_status"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_create_status"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/statuses/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'CommitStatus'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_status",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a new git tag in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateTagOption] :body
# @return [Tag]
def repo_create_tag(owner, repo, opts = {})
data, _status_code, _headers = repo_create_tag_with_http_info(owner, repo, opts)
data
end
# Create a new git tag in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateTagOption] :body
# @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
def repo_create_tag_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tags'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Tag'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a tag protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateTagProtectionOption] :body
# @return [TagProtection]
def repo_create_tag_protection(owner, repo, opts = {})
data, _status_code, _headers = repo_create_tag_protection_with_http_info(owner, repo, opts)
data
end
# Create a tag protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateTagProtectionOption] :body
# @return [Array<(TagProtection, Integer, Hash)>] TagProtection data, response status code and response headers
def repo_create_tag_protection_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_tag_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_tag_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_tag_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tag_protections'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'TagProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_tag_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_tag_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateWikiPageOptions] :body
# @return [WikiPage]
def repo_create_wiki_page(owner, repo, opts = {})
data, _status_code, _headers = repo_create_wiki_page_with_http_info(owner, repo, opts)
data
end
# Create a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [CreateWikiPageOptions] :body
# @return [Array<(WikiPage, Integer, Hash)>] WikiPage data, response status code and response headers
def repo_create_wiki_page_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_create_wiki_page ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_create_wiki_page"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_create_wiki_page"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/new'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'WikiPage'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_create_wiki_page",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_create_wiki_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a repository
# @param owner [String] owner of the repo to delete
# @param repo [String] name of the repo to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete(owner, repo, opts = {})
repo_delete_with_http_info(owner, repo, opts)
nil
end
# Delete a repository
# @param owner [String] owner of the repo to delete
# @param repo [String] name of the repo to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete"
end
# resource path
local_var_path = '/repos/{owner}/{repo}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Remove all flags from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_all_flags(owner, repo, opts = {})
repo_delete_all_flags_with_http_info(owner, repo, opts)
nil
end
# Remove all flags from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_all_flags_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_all_flags ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_all_flags"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_all_flags"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_all_flags",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_all_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete avatar
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_avatar(owner, repo, opts = {})
repo_delete_avatar_with_http_info(owner, repo, opts)
nil
end
# Delete avatar
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_avatar_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_avatar ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_avatar"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_avatar"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/avatar'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_avatar",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_avatar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a specific branch from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] branch to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_branch(owner, repo, branch, opts = {})
repo_delete_branch_with_http_info(owner, repo, branch, opts)
nil
end
# Delete a specific branch from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] branch to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_branch_with_http_info(owner, repo, branch, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_branch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_branch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_branch"
end
# verify the required parameter 'branch' is set
if @api_client.config.client_side_validation && branch.nil?
fail ArgumentError, "Missing the required parameter 'branch' when calling RepositoryApi.repo_delete_branch"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branches/{branch}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_branch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a specific branch protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_branch_protection(owner, repo, name, opts = {})
repo_delete_branch_protection_with_http_info(owner, repo, name, opts)
nil
end
# Delete a specific branch protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_branch_protection_with_http_info(owner, repo, name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_branch_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_branch_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_branch_protection"
end
# verify the required parameter 'name' is set
if @api_client.config.client_side_validation && name.nil?
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoryApi.repo_delete_branch_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branch_protections/{name}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_branch_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_branch_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a collaborator from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_collaborator(owner, repo, collaborator, opts = {})
repo_delete_collaborator_with_http_info(owner, repo, collaborator, opts)
nil
end
# Delete a collaborator from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_collaborator_with_http_info(owner, repo, collaborator, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_collaborator ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_collaborator"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_collaborator"
end
# verify the required parameter 'collaborator' is set
if @api_client.config.client_side_validation && collaborator.nil?
fail ArgumentError, "Missing the required parameter 'collaborator' when calling RepositoryApi.repo_delete_collaborator"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/collaborators/{collaborator}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_collaborator",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_collaborator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to delete
# @param body [DeleteFileOptions]
# @param [Hash] opts the optional parameters
# @return [FileDeleteResponse]
def repo_delete_file(owner, repo, filepath, body, opts = {})
data, _status_code, _headers = repo_delete_file_with_http_info(owner, repo, filepath, body, opts)
data
end
# Delete a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to delete
# @param body [DeleteFileOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(FileDeleteResponse, Integer, Hash)>] FileDeleteResponse data, response status code and response headers
def repo_delete_file_with_http_info(owner, repo, filepath, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_file ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_file"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_file"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_delete_file"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_delete_file"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'FileDeleteResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_file",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Remove a flag from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_flag(owner, repo, flag, opts = {})
repo_delete_flag_with_http_info(owner, repo, flag, opts)
nil
end
# Remove a flag from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param flag [String] name of the flag
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_flag_with_http_info(owner, repo, flag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_flag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_flag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_flag"
end
# verify the required parameter 'flag' is set
if @api_client.config.client_side_validation && flag.nil?
fail ArgumentError, "Missing the required parameter 'flag' when calling RepositoryApi.repo_delete_flag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags/{flag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'flag' + '}', CGI.escape(flag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_flag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_flag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a Git hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_git_hook(owner, repo, id, opts = {})
repo_delete_git_hook_with_http_info(owner, repo, id, opts)
nil
end
# Delete a Git hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_git_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_git_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_git_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_git_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_git_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/git/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_git_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_git_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_hook(owner, repo, id, opts = {})
repo_delete_hook_with_http_info(owner, repo, id, opts)
nil
end
# Delete a hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a key from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the key to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_key(owner, repo, id, opts = {})
repo_delete_key_with_http_info(owner, repo, id, opts)
nil
end
# Delete a key from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the key to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_key_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_key ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_key"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_key"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_key"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/keys/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_key",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a specific review from a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_pull_review(owner, repo, index, id, opts = {})
repo_delete_pull_review_with_http_info(owner, repo, index, id, opts)
nil
end
# Delete a specific review from a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_pull_review_with_http_info(owner, repo, index, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_delete_pull_review"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a pull review comment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param comment [Integer] id of the comment
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_pull_review_comment(owner, repo, index, id, comment, opts = {})
repo_delete_pull_review_comment_with_http_info(owner, repo, index, id, comment, opts)
nil
end
# Delete a pull review comment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param comment [Integer] id of the comment
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_pull_review_comment_with_http_info(owner, repo, index, id, comment, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_pull_review_comment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_pull_review_comment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_pull_review_comment"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_delete_pull_review_comment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_pull_review_comment"
end
# verify the required parameter 'comment' is set
if @api_client.config.client_side_validation && comment.nil?
fail ArgumentError, "Missing the required parameter 'comment' when calling RepositoryApi.repo_delete_pull_review_comment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_pull_review_comment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_pull_review_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# cancel review requests for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [PullReviewRequestOptions]
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_pull_review_requests(owner, repo, index, body, opts = {})
repo_delete_pull_review_requests_with_http_info(owner, repo, index, body, opts)
nil
end
# cancel review requests for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param body [PullReviewRequestOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_pull_review_requests_with_http_info(owner, repo, index, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_pull_review_requests ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_pull_review_requests"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_pull_review_requests"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_delete_pull_review_requests"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_delete_pull_review_requests"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/requested_reviewers'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_pull_review_requests",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_pull_review_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# deletes a push mirror from a repository by remoteName
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] remote name of the pushMirror
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_push_mirror(owner, repo, name, opts = {})
repo_delete_push_mirror_with_http_info(owner, repo, name, opts)
nil
end
# deletes a push mirror from a repository by remoteName
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] remote name of the pushMirror
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_push_mirror_with_http_info(owner, repo, name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_push_mirror ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_push_mirror"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_push_mirror"
end
# verify the required parameter 'name' is set
if @api_client.config.client_side_validation && name.nil?
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoryApi.repo_delete_push_mirror"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/push_mirrors/{name}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_push_mirror",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_push_mirror\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_release(owner, repo, id, opts = {})
repo_delete_release_with_http_info(owner, repo, id, opts)
nil
end
# Delete a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_release_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_release ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_release"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_release"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_release"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_release",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_release_attachment(owner, repo, id, attachment_id, opts = {})
repo_delete_release_attachment_with_http_info(owner, repo, id, attachment_id, opts)
nil
end
# Delete a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_release_attachment_with_http_info(owner, repo, id, attachment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_release_attachment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_release_attachment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_release_attachment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_release_attachment"
end
# verify the required parameter 'attachment_id' is set
if @api_client.config.client_side_validation && attachment_id.nil?
fail ArgumentError, "Missing the required parameter 'attachment_id' when calling RepositoryApi.repo_delete_release_attachment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'attachment_id' + '}', CGI.escape(attachment_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_release_attachment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_release_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a release by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] tag name of the release to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_release_by_tag(owner, repo, tag, opts = {})
repo_delete_release_by_tag_with_http_info(owner, repo, tag, opts)
nil
end
# Delete a release by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] tag name of the release to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_release_by_tag_with_http_info(owner, repo, tag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_release_by_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_release_by_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_release_by_tag"
end
# verify the required parameter 'tag' is set
if @api_client.config.client_side_validation && tag.nil?
fail ArgumentError, "Missing the required parameter 'tag' when calling RepositoryApi.repo_delete_release_by_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/tags/{tag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'tag' + '}', CGI.escape(tag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_release_by_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_release_by_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a repository's tag by name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] name of tag to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_tag(owner, repo, tag, opts = {})
repo_delete_tag_with_http_info(owner, repo, tag, opts)
nil
end
# Delete a repository's tag by name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] name of tag to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_tag_with_http_info(owner, repo, tag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_tag"
end
# verify the required parameter 'tag' is set
if @api_client.config.client_side_validation && tag.nil?
fail ArgumentError, "Missing the required parameter 'tag' when calling RepositoryApi.repo_delete_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tags/{tag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'tag' + '}', CGI.escape(tag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a specific tag protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of protected tag
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_tag_protection(owner, repo, id, opts = {})
repo_delete_tag_protection_with_http_info(owner, repo, id, opts)
nil
end
# Delete a specific tag protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of protected tag
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_tag_protection_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_tag_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_tag_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_tag_protection"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_delete_tag_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tag_protections/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_tag_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_tag_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a team from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_team(owner, repo, team, opts = {})
repo_delete_team_with_http_info(owner, repo, team, opts)
nil
end
# Delete a team from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param team [String] team name
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_team_with_http_info(owner, repo, team, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_team ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_team"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_team"
end
# verify the required parameter 'team' is set
if @api_client.config.client_side_validation && team.nil?
fail ArgumentError, "Missing the required parameter 'team' when calling RepositoryApi.repo_delete_team"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/teams/{team}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'team' + '}', CGI.escape(team.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_team",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a topic from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param topic [String] name of the topic to delete
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_topic(owner, repo, topic, opts = {})
repo_delete_topic_with_http_info(owner, repo, topic, opts)
nil
end
# Delete a topic from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param topic [String] name of the topic to delete
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_topic_with_http_info(owner, repo, topic, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_topic ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_topic"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_topic"
end
# verify the required parameter 'topic' is set
if @api_client.config.client_side_validation && topic.nil?
fail ArgumentError, "Missing the required parameter 'topic' when calling RepositoryApi.repo_delete_topic"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/topics/{topic}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'topic' + '}', CGI.escape(topic.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_topic",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_delete_wiki_page(owner, repo, page_name, opts = {})
repo_delete_wiki_page_with_http_info(owner, repo, page_name, opts)
nil
end
# Delete a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_delete_wiki_page_with_http_info(owner, repo, page_name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_delete_wiki_page ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_delete_wiki_page"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_delete_wiki_page"
end
# verify the required parameter 'page_name' is set
if @api_client.config.client_side_validation && page_name.nil?
fail ArgumentError, "Missing the required parameter 'page_name' when calling RepositoryApi.repo_delete_wiki_page"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/page/{pageName}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'pageName' + '}', CGI.escape(page_name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_delete_wiki_page",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_delete_wiki_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Dismiss a review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [DismissPullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [PullReview]
def repo_dismiss_pull_review(owner, repo, index, id, body, opts = {})
data, _status_code, _headers = repo_dismiss_pull_review_with_http_info(owner, repo, index, id, body, opts)
data
end
# Dismiss a review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [DismissPullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(PullReview, Integer, Hash)>] PullReview data, response status code and response headers
def repo_dismiss_pull_review_with_http_info(owner, repo, index, id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_dismiss_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_dismiss_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_dismiss_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_dismiss_pull_review"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_dismiss_pull_review"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_dismiss_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'PullReview'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_dismiss_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_dismiss_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a commit's diff or patch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] SHA of the commit to get
# @param diff_type [String] whether the output is diff or patch
# @param [Hash] opts the optional parameters
# @return [String]
def repo_download_commit_diff_or_patch(owner, repo, sha, diff_type, opts = {})
data, _status_code, _headers = repo_download_commit_diff_or_patch_with_http_info(owner, repo, sha, diff_type, opts)
data
end
# Get a commit's diff or patch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] SHA of the commit to get
# @param diff_type [String] whether the output is diff or patch
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def repo_download_commit_diff_or_patch_with_http_info(owner, repo, sha, diff_type, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_download_commit_diff_or_patch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_download_commit_diff_or_patch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_download_commit_diff_or_patch"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_download_commit_diff_or_patch"
end
# verify the required parameter 'diff_type' is set
if @api_client.config.client_side_validation && diff_type.nil?
fail ArgumentError, "Missing the required parameter 'diff_type' when calling RepositoryApi.repo_download_commit_diff_or_patch"
end
# verify enum value
allowable_values = ["diff", "patch"]
if @api_client.config.client_side_validation && !allowable_values.include?(diff_type)
fail ArgumentError, "invalid value for \"diff_type\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/commits/{sha}.{diffType}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s)).sub('{' + 'diffType' + '}', CGI.escape(diff_type.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_download_commit_diff_or_patch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_download_commit_diff_or_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a pull request diff or patch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param diff_type [String] whether the output is diff or patch
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :binary whether to include binary file changes. if true, the diff is applicable with `git apply`
# @return [String]
def repo_download_pull_diff_or_patch(owner, repo, index, diff_type, opts = {})
data, _status_code, _headers = repo_download_pull_diff_or_patch_with_http_info(owner, repo, index, diff_type, opts)
data
end
# Get a pull request diff or patch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param diff_type [String] whether the output is diff or patch
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :binary whether to include binary file changes. if true, the diff is applicable with `git apply`
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def repo_download_pull_diff_or_patch_with_http_info(owner, repo, index, diff_type, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_download_pull_diff_or_patch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_download_pull_diff_or_patch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_download_pull_diff_or_patch"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_download_pull_diff_or_patch"
end
# verify the required parameter 'diff_type' is set
if @api_client.config.client_side_validation && diff_type.nil?
fail ArgumentError, "Missing the required parameter 'diff_type' when calling RepositoryApi.repo_download_pull_diff_or_patch"
end
# verify enum value
allowable_values = ["diff", "patch"]
if @api_client.config.client_side_validation && !allowable_values.include?(diff_type)
fail ArgumentError, "invalid value for \"diff_type\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}.{diffType}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'diffType' + '}', CGI.escape(diff_type.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'binary'] = opts[:'binary'] if !opts[:'binary'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_download_pull_diff_or_patch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_download_pull_diff_or_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a repository's properties. Only fields that are set will be changed.
# @param owner [String] owner of the repo to edit
# @param repo [String] name of the repo to edit
# @param [Hash] opts the optional parameters
# @option opts [EditRepoOption] :body Properties of a repo that you can edit
# @return [Repository]
def repo_edit(owner, repo, opts = {})
data, _status_code, _headers = repo_edit_with_http_info(owner, repo, opts)
data
end
# Edit a repository's properties. Only fields that are set will be changed.
# @param owner [String] owner of the repo to edit
# @param repo [String] name of the repo to edit
# @param [Hash] opts the optional parameters
# @option opts [EditRepoOption] :body Properties of a repo that you can edit
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def repo_edit_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit"
end
# resource path
local_var_path = '/repos/{owner}/{repo}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a branch protections for a repository. Only fields that are set will be changed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @option opts [EditBranchProtectionOption] :body
# @return [BranchProtection]
def repo_edit_branch_protection(owner, repo, name, opts = {})
data, _status_code, _headers = repo_edit_branch_protection_with_http_info(owner, repo, name, opts)
data
end
# Edit a branch protections for a repository. Only fields that are set will be changed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @option opts [EditBranchProtectionOption] :body
# @return [Array<(BranchProtection, Integer, Hash)>] BranchProtection data, response status code and response headers
def repo_edit_branch_protection_with_http_info(owner, repo, name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_branch_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_branch_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_branch_protection"
end
# verify the required parameter 'name' is set
if @api_client.config.client_side_validation && name.nil?
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoryApi.repo_edit_branch_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branch_protections/{name}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'BranchProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_branch_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_branch_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a Git hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @option opts [EditGitHookOption] :body
# @return [GitHook]
def repo_edit_git_hook(owner, repo, id, opts = {})
data, _status_code, _headers = repo_edit_git_hook_with_http_info(owner, repo, id, opts)
data
end
# Edit a Git hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @option opts [EditGitHookOption] :body
# @return [Array<(GitHook, Integer, Hash)>] GitHook data, response status code and response headers
def repo_edit_git_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_git_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_git_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_git_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_edit_git_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/git/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'GitHook'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_git_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_git_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] index of the hook
# @param [Hash] opts the optional parameters
# @option opts [EditHookOption] :body
# @return [Hook]
def repo_edit_hook(owner, repo, id, opts = {})
data, _status_code, _headers = repo_edit_hook_with_http_info(owner, repo, id, opts)
data
end
# Edit a hook in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] index of the hook
# @param [Hash] opts the optional parameters
# @option opts [EditHookOption] :body
# @return [Array<(Hook, Integer, Hash)>] Hook data, response status code and response headers
def repo_edit_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_edit_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Hook'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update a pull request. If using deadline only the date will be taken into account, and time of day ignored.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to edit
# @param [Hash] opts the optional parameters
# @option opts [EditPullRequestOption] :body
# @return [PullRequest]
def repo_edit_pull_request(owner, repo, index, opts = {})
data, _status_code, _headers = repo_edit_pull_request_with_http_info(owner, repo, index, opts)
data
end
# Update a pull request. If using deadline only the date will be taken into account, and time of day ignored.
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to edit
# @param [Hash] opts the optional parameters
# @option opts [EditPullRequestOption] :body
# @return [Array<(PullRequest, Integer, Hash)>] PullRequest data, response status code and response headers
def repo_edit_pull_request_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_pull_request"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_edit_pull_request"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'PullRequest'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to edit
# @param [Hash] opts the optional parameters
# @option opts [EditReleaseOption] :body
# @return [Release]
def repo_edit_release(owner, repo, id, opts = {})
data, _status_code, _headers = repo_edit_release_with_http_info(owner, repo, id, opts)
data
end
# Update a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to edit
# @param [Hash] opts the optional parameters
# @option opts [EditReleaseOption] :body
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
def repo_edit_release_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_release ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_release"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_release"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_edit_release"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Release'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_release",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to edit
# @param [Hash] opts the optional parameters
# @option opts [EditAttachmentOptions] :body
# @return [Attachment]
def repo_edit_release_attachment(owner, repo, id, attachment_id, opts = {})
data, _status_code, _headers = repo_edit_release_attachment_with_http_info(owner, repo, id, attachment_id, opts)
data
end
# Edit a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to edit
# @param [Hash] opts the optional parameters
# @option opts [EditAttachmentOptions] :body
# @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
def repo_edit_release_attachment_with_http_info(owner, repo, id, attachment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_release_attachment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_release_attachment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_release_attachment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_edit_release_attachment"
end
# verify the required parameter 'attachment_id' is set
if @api_client.config.client_side_validation && attachment_id.nil?
fail ArgumentError, "Missing the required parameter 'attachment_id' when calling RepositoryApi.repo_edit_release_attachment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'attachment_id' + '}', CGI.escape(attachment_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Attachment'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_release_attachment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_release_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a tag protections for a repository. Only fields that are set will be changed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of protected tag
# @param [Hash] opts the optional parameters
# @option opts [EditTagProtectionOption] :body
# @return [TagProtection]
def repo_edit_tag_protection(owner, repo, id, opts = {})
data, _status_code, _headers = repo_edit_tag_protection_with_http_info(owner, repo, id, opts)
data
end
# Edit a tag protections for a repository. Only fields that are set will be changed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of protected tag
# @param [Hash] opts the optional parameters
# @option opts [EditTagProtectionOption] :body
# @return [Array<(TagProtection, Integer, Hash)>] TagProtection data, response status code and response headers
def repo_edit_tag_protection_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_tag_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_tag_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_tag_protection"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_edit_tag_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tag_protections/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'TagProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_tag_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_tag_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Edit a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @option opts [CreateWikiPageOptions] :body
# @return [WikiPage]
def repo_edit_wiki_page(owner, repo, page_name, opts = {})
data, _status_code, _headers = repo_edit_wiki_page_with_http_info(owner, repo, page_name, opts)
data
end
# Edit a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @option opts [CreateWikiPageOptions] :body
# @return [Array<(WikiPage, Integer, Hash)>] WikiPage data, response status code and response headers
def repo_edit_wiki_page_with_http_info(owner, repo, page_name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_edit_wiki_page ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_edit_wiki_page"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_edit_wiki_page"
end
# verify the required parameter 'page_name' is set
if @api_client.config.client_side_validation && page_name.nil?
fail ArgumentError, "Missing the required parameter 'page_name' when calling RepositoryApi.repo_edit_wiki_page"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/page/{pageName}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'pageName' + '}', CGI.escape(page_name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'WikiPage'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_edit_wiki_page",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_edit_wiki_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Repository]
def repo_get(owner, repo, opts = {})
data, _status_code, _headers = repo_get_with_http_info(owner, repo, opts)
data
end
# Get a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def repo_get_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get"
end
# resource path
local_var_path = '/repos/{owner}/{repo}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a list of all commits from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :sha SHA or branch to start listing commits from (usually 'master')
# @option opts [String] :path filepath of a file/dir
# @option opts [Boolean] :stat include diff stats for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results (ignored if used with 'path')
# @option opts [String] :_not commits that match the given specifier will not be listed.
# @return [Array<Commit>]
def repo_get_all_commits(owner, repo, opts = {})
data, _status_code, _headers = repo_get_all_commits_with_http_info(owner, repo, opts)
data
end
# Get a list of all commits from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :sha SHA or branch to start listing commits from (usually 'master')
# @option opts [String] :path filepath of a file/dir
# @option opts [Boolean] :stat include diff stats for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results (ignored if used with 'path')
# @option opts [String] :_not commits that match the given specifier will not be listed.
# @return [Array<(Array<Commit>, Integer, Hash)>] Array<Commit> data, response status code and response headers
def repo_get_all_commits_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_all_commits ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_all_commits"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_all_commits"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/commits'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'sha'] = opts[:'sha'] if !opts[:'sha'].nil?
query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
query_params[:'stat'] = opts[:'stat'] if !opts[:'stat'].nil?
query_params[:'verification'] = opts[:'verification'] if !opts[:'verification'].nil?
query_params[:'files'] = opts[:'files'] if !opts[:'files'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'not'] = opts[:'_not'] if !opts[:'_not'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Commit>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_all_commits",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_all_commits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get an archive of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param archive [String] the git reference for download with attached archive format (e.g. master.zip)
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_get_archive(owner, repo, archive, opts = {})
repo_get_archive_with_http_info(owner, repo, archive, opts)
nil
end
# Get an archive of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param archive [String] the git reference for download with attached archive format (e.g. master.zip)
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_get_archive_with_http_info(owner, repo, archive, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_archive ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_archive"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_archive"
end
# verify the required parameter 'archive' is set
if @api_client.config.client_side_validation && archive.nil?
fail ArgumentError, "Missing the required parameter 'archive' when calling RepositoryApi.repo_get_archive"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/archive/{archive}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'archive' + '}', CGI.escape(archive.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/zip', 'application/gzip']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_archive",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Return all users that have write access and can be assigned to issues
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<User>]
def repo_get_assignees(owner, repo, opts = {})
data, _status_code, _headers = repo_get_assignees_with_http_info(owner, repo, opts)
data
end
# Return all users that have write access and can be assigned to issues
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<User>, Integer, Hash)>] Array<User> data, response status code and response headers
def repo_get_assignees_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_assignees ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_assignees"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_assignees"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/assignees'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<User>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_assignees",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_assignees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Retrieve a specific branch from a repository, including its effective branch protection
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] branch to get
# @param [Hash] opts the optional parameters
# @return [Branch]
def repo_get_branch(owner, repo, branch, opts = {})
data, _status_code, _headers = repo_get_branch_with_http_info(owner, repo, branch, opts)
data
end
# Retrieve a specific branch from a repository, including its effective branch protection
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] branch to get
# @param [Hash] opts the optional parameters
# @return [Array<(Branch, Integer, Hash)>] Branch data, response status code and response headers
def repo_get_branch_with_http_info(owner, repo, branch, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_branch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_branch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_branch"
end
# verify the required parameter 'branch' is set
if @api_client.config.client_side_validation && branch.nil?
fail ArgumentError, "Missing the required parameter 'branch' when calling RepositoryApi.repo_get_branch"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branches/{branch}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Branch'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_branch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a specific branch protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @return [BranchProtection]
def repo_get_branch_protection(owner, repo, name, opts = {})
data, _status_code, _headers = repo_get_branch_protection_with_http_info(owner, repo, name, opts)
data
end
# Get a specific branch protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] name of protected branch
# @param [Hash] opts the optional parameters
# @return [Array<(BranchProtection, Integer, Hash)>] BranchProtection data, response status code and response headers
def repo_get_branch_protection_with_http_info(owner, repo, name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_branch_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_branch_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_branch_protection"
end
# verify the required parameter 'name' is set
if @api_client.config.client_side_validation && name.nil?
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoryApi.repo_get_branch_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branch_protections/{name}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'BranchProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_branch_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_branch_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a repository by id
# @param id [Integer] id of the repo to get
# @param [Hash] opts the optional parameters
# @return [Repository]
def repo_get_by_id(id, opts = {})
data, _status_code, _headers = repo_get_by_id_with_http_info(id, opts)
data
end
# Get a repository by id
# @param id [Integer] id of the repo to get
# @param [Hash] opts the optional parameters
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def repo_get_by_id_with_http_info(id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_by_id ...'
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_by_id"
end
# resource path
local_var_path = '/repositories/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_by_id",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a commit's combined status, by branch/tag/commit reference
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] name of branch/tag/commit
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [CombinedStatus]
def repo_get_combined_status_by_ref(owner, repo, ref, opts = {})
data, _status_code, _headers = repo_get_combined_status_by_ref_with_http_info(owner, repo, ref, opts)
data
end
# Get a commit's combined status, by branch/tag/commit reference
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] name of branch/tag/commit
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(CombinedStatus, Integer, Hash)>] CombinedStatus data, response status code and response headers
def repo_get_combined_status_by_ref_with_http_info(owner, repo, ref, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_combined_status_by_ref ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_combined_status_by_ref"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_combined_status_by_ref"
end
# verify the required parameter 'ref' is set
if @api_client.config.client_side_validation && ref.nil?
fail ArgumentError, "Missing the required parameter 'ref' when calling RepositoryApi.repo_get_combined_status_by_ref"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/commits/{ref}/status'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'ref' + '}', CGI.escape(ref.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'CombinedStatus'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_combined_status_by_ref",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_combined_status_by_ref\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get the pull request of the commit
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] SHA of the commit to get
# @param [Hash] opts the optional parameters
# @return [PullRequest]
def repo_get_commit_pull_request(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_get_commit_pull_request_with_http_info(owner, repo, sha, opts)
data
end
# Get the pull request of the commit
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] SHA of the commit to get
# @param [Hash] opts the optional parameters
# @return [Array<(PullRequest, Integer, Hash)>] PullRequest data, response status code and response headers
def repo_get_commit_pull_request_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_commit_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_commit_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_commit_pull_request"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_get_commit_pull_request"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/commits/{sha}/pull'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullRequest'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_commit_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_commit_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the dir, file, symlink or submodule in the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [ContentsResponse]
def repo_get_contents(owner, repo, filepath, opts = {})
data, _status_code, _headers = repo_get_contents_with_http_info(owner, repo, filepath, opts)
data
end
# Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the dir, file, symlink or submodule in the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<(ContentsResponse, Integer, Hash)>] ContentsResponse data, response status code and response headers
def repo_get_contents_with_http_info(owner, repo, filepath, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_contents ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_contents"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_contents"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_get_contents"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'ContentsResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_contents",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_contents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the metadata of all the entries of the root dir
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<ContentsResponse>]
def repo_get_contents_list(owner, repo, opts = {})
data, _status_code, _headers = repo_get_contents_list_with_http_info(owner, repo, opts)
data
end
# Gets the metadata of all the entries of the root dir
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<(Array<ContentsResponse>, Integer, Hash)>] Array<ContentsResponse> data, response status code and response headers
def repo_get_contents_list_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_contents_list ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_contents_list"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_contents_list"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<ContentsResponse>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_contents_list",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_contents_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get the EditorConfig definitions of a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [nil]
def repo_get_editor_config(owner, repo, filepath, opts = {})
repo_get_editor_config_with_http_info(owner, repo, filepath, opts)
nil
end
# Get the EditorConfig definitions of a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_get_editor_config_with_http_info(owner, repo, filepath, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_editor_config ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_editor_config"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_editor_config"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_get_editor_config"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/editorconfig/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_editor_config",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_editor_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a Git hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [GitHook]
def repo_get_git_hook(owner, repo, id, opts = {})
data, _status_code, _headers = repo_get_git_hook_with_http_info(owner, repo, id, opts)
data
end
# Get a Git hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [String] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [Array<(GitHook, Integer, Hash)>] GitHook data, response status code and response headers
def repo_get_git_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_git_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_git_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_git_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_git_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/git/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'GitHook'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_git_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_git_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [Hook]
def repo_get_hook(owner, repo, id, opts = {})
data, _status_code, _headers = repo_get_hook_with_http_info(owner, repo, id, opts)
data
end
# Get a hook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to get
# @param [Hash] opts the optional parameters
# @return [Array<(Hook, Integer, Hash)>] Hook data, response status code and response headers
def repo_get_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Hook'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns the issue config for a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [IssueConfig]
def repo_get_issue_config(owner, repo, opts = {})
data, _status_code, _headers = repo_get_issue_config_with_http_info(owner, repo, opts)
data
end
# Returns the issue config for a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(IssueConfig, Integer, Hash)>] IssueConfig data, response status code and response headers
def repo_get_issue_config_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_issue_config ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_issue_config"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_issue_config"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/issue_config'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'IssueConfig'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_issue_config",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_issue_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get available issue templates for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<IssueTemplate>]
def repo_get_issue_templates(owner, repo, opts = {})
data, _status_code, _headers = repo_get_issue_templates_with_http_info(owner, repo, opts)
data
end
# Get available issue templates for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<IssueTemplate>, Integer, Hash)>] Array<IssueTemplate> data, response status code and response headers
def repo_get_issue_templates_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_issue_templates ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_issue_templates"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_issue_templates"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/issue_templates'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<IssueTemplate>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_issue_templates",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_issue_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a repository's key by id
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the key to get
# @param [Hash] opts the optional parameters
# @return [DeployKey]
def repo_get_key(owner, repo, id, opts = {})
data, _status_code, _headers = repo_get_key_with_http_info(owner, repo, id, opts)
data
end
# Get a repository's key by id
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the key to get
# @param [Hash] opts the optional parameters
# @return [Array<(DeployKey, Integer, Hash)>] DeployKey data, response status code and response headers
def repo_get_key_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_key ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_key"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_key"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_key"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/keys/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'DeployKey'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_key",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get languages and number of bytes of code written
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Hash<String, Integer>]
def repo_get_languages(owner, repo, opts = {})
data, _status_code, _headers = repo_get_languages_with_http_info(owner, repo, opts)
data
end
# Get languages and number of bytes of code written
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Hash<String, Integer>, Integer, Hash)>] Hash<String, Integer> data, response status code and response headers
def repo_get_languages_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_languages ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_languages"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_languages"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/languages'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Hash<String, Integer>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_languages",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_languages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Release]
def repo_get_latest_release(owner, repo, opts = {})
data, _status_code, _headers = repo_get_latest_release_with_http_info(owner, repo, opts)
data
end
# Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
def repo_get_latest_release_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_latest_release ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_latest_release"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_latest_release"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/latest'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Release'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_latest_release",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_latest_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Note]
def repo_get_note(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_get_note_with_http_info(owner, repo, sha, opts)
data
end
# Get a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Array<(Note, Integer, Hash)>] Note data, response status code and response headers
def repo_get_note_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_note ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_note"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_note"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_get_note"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/notes/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'verification'] = opts[:'verification'] if !opts[:'verification'].nil?
query_params[:'files'] = opts[:'files'] if !opts[:'files'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Note'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_note",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @return [PullRequest]
def repo_get_pull_request(owner, repo, index, opts = {})
data, _status_code, _headers = repo_get_pull_request_with_http_info(owner, repo, index, opts)
data
end
# Get a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @return [Array<(PullRequest, Integer, Hash)>] PullRequest data, response status code and response headers
def repo_get_pull_request_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_request"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_request"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullRequest'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a pull request by base and head
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param base [String] base of the pull request to get
# @param head [String] head of the pull request to get
# @param [Hash] opts the optional parameters
# @return [PullRequest]
def repo_get_pull_request_by_base_head(owner, repo, base, head, opts = {})
data, _status_code, _headers = repo_get_pull_request_by_base_head_with_http_info(owner, repo, base, head, opts)
data
end
# Get a pull request by base and head
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param base [String] base of the pull request to get
# @param head [String] head of the pull request to get
# @param [Hash] opts the optional parameters
# @return [Array<(PullRequest, Integer, Hash)>] PullRequest data, response status code and response headers
def repo_get_pull_request_by_base_head_with_http_info(owner, repo, base, head, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_request_by_base_head ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_request_by_base_head"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_request_by_base_head"
end
# verify the required parameter 'base' is set
if @api_client.config.client_side_validation && base.nil?
fail ArgumentError, "Missing the required parameter 'base' when calling RepositoryApi.repo_get_pull_request_by_base_head"
end
# verify the required parameter 'head' is set
if @api_client.config.client_side_validation && head.nil?
fail ArgumentError, "Missing the required parameter 'head' when calling RepositoryApi.repo_get_pull_request_by_base_head"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{base}/{head}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'base' + '}', CGI.escape(base.to_s)).sub('{' + 'head' + '}', CGI.escape(head.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullRequest'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_request_by_base_head",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_request_by_base_head\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get commits for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Array<Commit>]
def repo_get_pull_request_commits(owner, repo, index, opts = {})
data, _status_code, _headers = repo_get_pull_request_commits_with_http_info(owner, repo, index, opts)
data
end
# Get commits for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Array<(Array<Commit>, Integer, Hash)>] Array<Commit> data, response status code and response headers
def repo_get_pull_request_commits_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_request_commits ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_request_commits"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_request_commits"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_request_commits"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/commits'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
query_params[:'verification'] = opts[:'verification'] if !opts[:'verification'].nil?
query_params[:'files'] = opts[:'files'] if !opts[:'files'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Commit>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_request_commits",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_request_commits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get changed files for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [String] :skip_to skip to given file
# @option opts [String] :whitespace whitespace behavior
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<ChangedFile>]
def repo_get_pull_request_files(owner, repo, index, opts = {})
data, _status_code, _headers = repo_get_pull_request_files_with_http_info(owner, repo, index, opts)
data
end
# Get changed files for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [String] :skip_to skip to given file
# @option opts [String] :whitespace whitespace behavior
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<ChangedFile>, Integer, Hash)>] Array<ChangedFile> data, response status code and response headers
def repo_get_pull_request_files_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_request_files ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_request_files"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_request_files"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_request_files"
end
allowable_values = ["ignore-all", "ignore-change", "ignore-eol", "show-all"]
if @api_client.config.client_side_validation && opts[:'whitespace'] && !allowable_values.include?(opts[:'whitespace'])
fail ArgumentError, "invalid value for \"whitespace\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/files'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'skip-to'] = opts[:'skip_to'] if !opts[:'skip_to'].nil?
query_params[:'whitespace'] = opts[:'whitespace'] if !opts[:'whitespace'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<ChangedFile>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_request_files",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_request_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a specific review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [PullReview]
def repo_get_pull_review(owner, repo, index, id, opts = {})
data, _status_code, _headers = repo_get_pull_review_with_http_info(owner, repo, index, id, opts)
data
end
# Get a specific review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [Array<(PullReview, Integer, Hash)>] PullReview data, response status code and response headers
def repo_get_pull_review_with_http_info(owner, repo, index, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_review"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullReview'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a pull review comment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param comment [Integer] id of the comment
# @param [Hash] opts the optional parameters
# @return [PullReviewComment]
def repo_get_pull_review_comment(owner, repo, index, id, comment, opts = {})
data, _status_code, _headers = repo_get_pull_review_comment_with_http_info(owner, repo, index, id, comment, opts)
data
end
# Get a pull review comment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param comment [Integer] id of the comment
# @param [Hash] opts the optional parameters
# @return [Array<(PullReviewComment, Integer, Hash)>] PullReviewComment data, response status code and response headers
def repo_get_pull_review_comment_with_http_info(owner, repo, index, id, comment, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_review_comment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_review_comment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_review_comment"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_review_comment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_pull_review_comment"
end
# verify the required parameter 'comment' is set
if @api_client.config.client_side_validation && comment.nil?
fail ArgumentError, "Missing the required parameter 'comment' when calling RepositoryApi.repo_get_pull_review_comment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'comment' + '}', CGI.escape(comment.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullReviewComment'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_review_comment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_review_comment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a specific review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [Array<PullReviewComment>]
def repo_get_pull_review_comments(owner, repo, index, id, opts = {})
data, _status_code, _headers = repo_get_pull_review_comments_with_http_info(owner, repo, index, id, opts)
data
end
# Get a specific review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [Array<(Array<PullReviewComment>, Integer, Hash)>] Array<PullReviewComment> data, response status code and response headers
def repo_get_pull_review_comments_with_http_info(owner, repo, index, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_pull_review_comments ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_pull_review_comments"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_pull_review_comments"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_get_pull_review_comments"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_pull_review_comments"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<PullReviewComment>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_pull_review_comments",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_pull_review_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get push mirror of the repository by remoteName
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] remote name of push mirror
# @param [Hash] opts the optional parameters
# @return [PushMirror]
def repo_get_push_mirror_by_remote_name(owner, repo, name, opts = {})
data, _status_code, _headers = repo_get_push_mirror_by_remote_name_with_http_info(owner, repo, name, opts)
data
end
# Get push mirror of the repository by remoteName
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param name [String] remote name of push mirror
# @param [Hash] opts the optional parameters
# @return [Array<(PushMirror, Integer, Hash)>] PushMirror data, response status code and response headers
def repo_get_push_mirror_by_remote_name_with_http_info(owner, repo, name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_push_mirror_by_remote_name ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_push_mirror_by_remote_name"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_push_mirror_by_remote_name"
end
# verify the required parameter 'name' is set
if @api_client.config.client_side_validation && name.nil?
fail ArgumentError, "Missing the required parameter 'name' when calling RepositoryApi.repo_get_push_mirror_by_remote_name"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/push_mirrors/{name}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PushMirror'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_push_mirror_by_remote_name",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_push_mirror_by_remote_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a file from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of the file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [File]
def repo_get_raw_file(owner, repo, filepath, opts = {})
data, _status_code, _headers = repo_get_raw_file_with_http_info(owner, repo, filepath, opts)
data
end
# Get a file from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of the file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
def repo_get_raw_file_with_http_info(owner, repo, filepath, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_raw_file ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_raw_file"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_raw_file"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_get_raw_file"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/raw/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'File'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_raw_file",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_raw_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a file or it's LFS object from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of the file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [File]
def repo_get_raw_file_or_lfs(owner, repo, filepath, opts = {})
data, _status_code, _headers = repo_get_raw_file_or_lfs_with_http_info(owner, repo, filepath, opts)
data
end
# Get a file or it's LFS object from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] filepath of the file to get
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag. Default the repository’s default branch (usually master)
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
def repo_get_raw_file_or_lfs_with_http_info(owner, repo, filepath, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_raw_file_or_lfs ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_raw_file_or_lfs"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_raw_file_or_lfs"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_get_raw_file_or_lfs"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/media/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'File'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_raw_file_or_lfs",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_raw_file_or_lfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to get
# @param [Hash] opts the optional parameters
# @return [Release]
def repo_get_release(owner, repo, id, opts = {})
data, _status_code, _headers = repo_get_release_with_http_info(owner, repo, id, opts)
data
end
# Get a release
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release to get
# @param [Hash] opts the optional parameters
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
def repo_get_release_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_release ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_release"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_release"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_release"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Release'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_release",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to get
# @param [Hash] opts the optional parameters
# @return [Attachment]
def repo_get_release_attachment(owner, repo, id, attachment_id, opts = {})
data, _status_code, _headers = repo_get_release_attachment_with_http_info(owner, repo, id, attachment_id, opts)
data
end
# Get a release attachment
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param attachment_id [Integer] id of the attachment to get
# @param [Hash] opts the optional parameters
# @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers
def repo_get_release_attachment_with_http_info(owner, repo, id, attachment_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_release_attachment ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_release_attachment"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_release_attachment"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_release_attachment"
end
# verify the required parameter 'attachment_id' is set
if @api_client.config.client_side_validation && attachment_id.nil?
fail ArgumentError, "Missing the required parameter 'attachment_id' when calling RepositoryApi.repo_get_release_attachment"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'attachment_id' + '}', CGI.escape(attachment_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Attachment'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_release_attachment",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_release_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a release by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] tag name of the release to get
# @param [Hash] opts the optional parameters
# @return [Release]
def repo_get_release_by_tag(owner, repo, tag, opts = {})
data, _status_code, _headers = repo_get_release_by_tag_with_http_info(owner, repo, tag, opts)
data
end
# Get a release by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] tag name of the release to get
# @param [Hash] opts the optional parameters
# @return [Array<(Release, Integer, Hash)>] Release data, response status code and response headers
def repo_get_release_by_tag_with_http_info(owner, repo, tag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_release_by_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_release_by_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_release_by_tag"
end
# verify the required parameter 'tag' is set
if @api_client.config.client_side_validation && tag.nil?
fail ArgumentError, "Missing the required parameter 'tag' when calling RepositoryApi.repo_get_release_by_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/tags/{tag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'tag' + '}', CGI.escape(tag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Release'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_release_by_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_release_by_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get repository permissions for a user
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator
# @param [Hash] opts the optional parameters
# @return [RepoCollaboratorPermission]
def repo_get_repo_permissions(owner, repo, collaborator, opts = {})
data, _status_code, _headers = repo_get_repo_permissions_with_http_info(owner, repo, collaborator, opts)
data
end
# Get repository permissions for a user
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param collaborator [String] username of the collaborator
# @param [Hash] opts the optional parameters
# @return [Array<(RepoCollaboratorPermission, Integer, Hash)>] RepoCollaboratorPermission data, response status code and response headers
def repo_get_repo_permissions_with_http_info(owner, repo, collaborator, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_repo_permissions ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_repo_permissions"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_repo_permissions"
end
# verify the required parameter 'collaborator' is set
if @api_client.config.client_side_validation && collaborator.nil?
fail ArgumentError, "Missing the required parameter 'collaborator' when calling RepositoryApi.repo_get_repo_permissions"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/collaborators/{collaborator}/permission'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'collaborator' + '}', CGI.escape(collaborator.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'RepoCollaboratorPermission'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_repo_permissions",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_repo_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Return all users that can be requested to review in this repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<User>]
def repo_get_reviewers(owner, repo, opts = {})
data, _status_code, _headers = repo_get_reviewers_with_http_info(owner, repo, opts)
data
end
# Return all users that can be requested to review in this repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<User>, Integer, Hash)>] Array<User> data, response status code and response headers
def repo_get_reviewers_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_reviewers ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_reviewers"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_reviewers"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/reviewers'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<User>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_reviewers",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_reviewers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a repository's actions runner registration token
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_get_runner_registration_token(owner, repo, opts = {})
repo_get_runner_registration_token_with_http_info(owner, repo, opts)
nil
end
# Get a repository's actions runner registration token
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_get_runner_registration_token_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_runner_registration_token ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_runner_registration_token"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_runner_registration_token"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/runners/registration-token'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_runner_registration_token",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_runner_registration_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :stat include diff stats for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Commit]
def repo_get_single_commit(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_get_single_commit_with_http_info(owner, repo, sha, opts)
data
end
# Get a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :stat include diff stats for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :verification include verification for every commit (disable for speedup, default 'true')
# @option opts [Boolean] :files include a list of affected files for every commit (disable for speedup, default 'true')
# @return [Array<(Commit, Integer, Hash)>] Commit data, response status code and response headers
def repo_get_single_commit_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_single_commit ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_single_commit"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_single_commit"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_get_single_commit"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/commits/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'stat'] = opts[:'stat'] if !opts[:'stat'].nil?
query_params[:'verification'] = opts[:'verification'] if !opts[:'verification'].nil?
query_params[:'files'] = opts[:'files'] if !opts[:'files'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Commit'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_single_commit",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_single_commit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get the tag of a repository by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] name of tag
# @param [Hash] opts the optional parameters
# @return [Tag]
def repo_get_tag(owner, repo, tag, opts = {})
data, _status_code, _headers = repo_get_tag_with_http_info(owner, repo, tag, opts)
data
end
# Get the tag of a repository by tag name
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param tag [String] name of tag
# @param [Hash] opts the optional parameters
# @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
def repo_get_tag_with_http_info(owner, repo, tag, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_tag ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_tag"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_tag"
end
# verify the required parameter 'tag' is set
if @api_client.config.client_side_validation && tag.nil?
fail ArgumentError, "Missing the required parameter 'tag' when calling RepositoryApi.repo_get_tag"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tags/{tag}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'tag' + '}', CGI.escape(tag.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Tag'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_tag",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a specific tag protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the tag protect to get
# @param [Hash] opts the optional parameters
# @return [TagProtection]
def repo_get_tag_protection(owner, repo, id, opts = {})
data, _status_code, _headers = repo_get_tag_protection_with_http_info(owner, repo, id, opts)
data
end
# Get a specific tag protection for the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the tag protect to get
# @param [Hash] opts the optional parameters
# @return [Array<(TagProtection, Integer, Hash)>] TagProtection data, response status code and response headers
def repo_get_tag_protection_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_tag_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_tag_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_tag_protection"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_get_tag_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tag_protections/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'TagProtection'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_tag_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_tag_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @return [WikiPage]
def repo_get_wiki_page(owner, repo, page_name, opts = {})
data, _status_code, _headers = repo_get_wiki_page_with_http_info(owner, repo, page_name, opts)
data
end
# Get a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @return [Array<(WikiPage, Integer, Hash)>] WikiPage data, response status code and response headers
def repo_get_wiki_page_with_http_info(owner, repo, page_name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_wiki_page ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_wiki_page"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_wiki_page"
end
# verify the required parameter 'page_name' is set
if @api_client.config.client_side_validation && page_name.nil?
fail ArgumentError, "Missing the required parameter 'page_name' when calling RepositoryApi.repo_get_wiki_page"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/page/{pageName}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'pageName' + '}', CGI.escape(page_name.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'WikiPage'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_wiki_page",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_wiki_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get revisions of a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @return [WikiCommitList]
def repo_get_wiki_page_revisions(owner, repo, page_name, opts = {})
data, _status_code, _headers = repo_get_wiki_page_revisions_with_http_info(owner, repo, page_name, opts)
data
end
# Get revisions of a wiki page
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param page_name [String] name of the page
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @return [Array<(WikiCommitList, Integer, Hash)>] WikiCommitList data, response status code and response headers
def repo_get_wiki_page_revisions_with_http_info(owner, repo, page_name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_wiki_page_revisions ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_wiki_page_revisions"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_wiki_page_revisions"
end
# verify the required parameter 'page_name' is set
if @api_client.config.client_side_validation && page_name.nil?
fail ArgumentError, "Missing the required parameter 'page_name' when calling RepositoryApi.repo_get_wiki_page_revisions"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/revisions/{pageName}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'pageName' + '}', CGI.escape(page_name.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'WikiCommitList'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_wiki_page_revisions",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_wiki_page_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get all wiki pages
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<WikiPageMetaData>]
def repo_get_wiki_pages(owner, repo, opts = {})
data, _status_code, _headers = repo_get_wiki_pages_with_http_info(owner, repo, opts)
data
end
# Get all wiki pages
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<WikiPageMetaData>, Integer, Hash)>] Array<WikiPageMetaData> data, response status code and response headers
def repo_get_wiki_pages_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_get_wiki_pages ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_get_wiki_pages"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_get_wiki_pages"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/wiki/pages'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<WikiPageMetaData>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_get_wiki_pages",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_get_wiki_pages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List an repo's actions secrets
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Secret>]
def repo_list_actions_secrets(owner, repo, opts = {})
data, _status_code, _headers = repo_list_actions_secrets_with_http_info(owner, repo, opts)
data
end
# List an repo's actions secrets
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Secret>, Integer, Hash)>] Array<Secret> data, response status code and response headers
def repo_list_actions_secrets_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_actions_secrets ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_actions_secrets"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_actions_secrets"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/secrets'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Secret>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_actions_secrets",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_actions_secrets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's activity feeds
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Date] :date the date of the activities to be found
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Activity>]
def repo_list_activity_feeds(owner, repo, opts = {})
data, _status_code, _headers = repo_list_activity_feeds_with_http_info(owner, repo, opts)
data
end
# List a repository's activity feeds
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Date] :date the date of the activities to be found
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Activity>, Integer, Hash)>] Array<Activity> data, response status code and response headers
def repo_list_activity_feeds_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_activity_feeds ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_activity_feeds"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_activity_feeds"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/activities/feeds'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Activity>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_activity_feeds",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_activity_feeds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get specified ref or filtered repository's refs
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<Reference>]
def repo_list_all_git_refs(owner, repo, opts = {})
data, _status_code, _headers = repo_list_all_git_refs_with_http_info(owner, repo, opts)
data
end
# Get specified ref or filtered repository's refs
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<Reference>, Integer, Hash)>] Array<Reference> data, response status code and response headers
def repo_list_all_git_refs_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_all_git_refs ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_all_git_refs"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_all_git_refs"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/refs'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Reference>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_all_git_refs",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_all_git_refs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List branch protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<BranchProtection>]
def repo_list_branch_protection(owner, repo, opts = {})
data, _status_code, _headers = repo_list_branch_protection_with_http_info(owner, repo, opts)
data
end
# List branch protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<BranchProtection>, Integer, Hash)>] Array<BranchProtection> data, response status code and response headers
def repo_list_branch_protection_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_branch_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_branch_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_branch_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branch_protections'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<BranchProtection>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_branch_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_branch_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's branches
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Branch>]
def repo_list_branches(owner, repo, opts = {})
data, _status_code, _headers = repo_list_branches_with_http_info(owner, repo, opts)
data
end
# List a repository's branches
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Branch>, Integer, Hash)>] Array<Branch> data, response status code and response headers
def repo_list_branches_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_branches ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_branches"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_branches"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branches'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Branch>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_branches",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_branches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's collaborators
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<User>]
def repo_list_collaborators(owner, repo, opts = {})
data, _status_code, _headers = repo_list_collaborators_with_http_info(owner, repo, opts)
data
end
# List a repository's collaborators
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<User>, Integer, Hash)>] Array<User> data, response status code and response headers
def repo_list_collaborators_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_collaborators ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_collaborators"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_collaborators"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/collaborators'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<User>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_collaborators",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_collaborators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's flags
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<String>]
def repo_list_flags(owner, repo, opts = {})
data, _status_code, _headers = repo_list_flags_with_http_info(owner, repo, opts)
data
end
# List a repository's flags
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
def repo_list_flags_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_flags ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_flags"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_flags"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<String>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_flags",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List the Git hooks in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<GitHook>]
def repo_list_git_hooks(owner, repo, opts = {})
data, _status_code, _headers = repo_list_git_hooks_with_http_info(owner, repo, opts)
data
end
# List the Git hooks in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<GitHook>, Integer, Hash)>] Array<GitHook> data, response status code and response headers
def repo_list_git_hooks_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_git_hooks ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_git_hooks"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_git_hooks"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/git'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<GitHook>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_git_hooks",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_git_hooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get specified ref or filtered repository's refs
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] part or full name of the ref
# @param [Hash] opts the optional parameters
# @return [Array<Reference>]
def repo_list_git_refs(owner, repo, ref, opts = {})
data, _status_code, _headers = repo_list_git_refs_with_http_info(owner, repo, ref, opts)
data
end
# Get specified ref or filtered repository's refs
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] part or full name of the ref
# @param [Hash] opts the optional parameters
# @return [Array<(Array<Reference>, Integer, Hash)>] Array<Reference> data, response status code and response headers
def repo_list_git_refs_with_http_info(owner, repo, ref, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_git_refs ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_git_refs"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_git_refs"
end
# verify the required parameter 'ref' is set
if @api_client.config.client_side_validation && ref.nil?
fail ArgumentError, "Missing the required parameter 'ref' when calling RepositoryApi.repo_list_git_refs"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/refs/{ref}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'ref' + '}', CGI.escape(ref.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Reference>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_git_refs",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_git_refs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List the hooks in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Hook>]
def repo_list_hooks(owner, repo, opts = {})
data, _status_code, _headers = repo_list_hooks_with_http_info(owner, repo, opts)
data
end
# List the hooks in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Hook>, Integer, Hash)>] Array<Hook> data, response status code and response headers
def repo_list_hooks_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_hooks ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_hooks"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_hooks"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Hook>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_hooks",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_hooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's keys
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :key_id the key_id to search for
# @option opts [String] :fingerprint fingerprint of the key
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<DeployKey>]
def repo_list_keys(owner, repo, opts = {})
data, _status_code, _headers = repo_list_keys_with_http_info(owner, repo, opts)
data
end
# List a repository's keys
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :key_id the key_id to search for
# @option opts [String] :fingerprint fingerprint of the key
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<DeployKey>, Integer, Hash)>] Array<DeployKey> data, response status code and response headers
def repo_list_keys_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_keys ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_keys"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_keys"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/keys'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'key_id'] = opts[:'key_id'] if !opts[:'key_id'].nil?
query_params[:'fingerprint'] = opts[:'fingerprint'] if !opts[:'fingerprint'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<DeployKey>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_keys",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's pinned issues
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<Issue>]
def repo_list_pinned_issues(owner, repo, opts = {})
data, _status_code, _headers = repo_list_pinned_issues_with_http_info(owner, repo, opts)
data
end
# List a repo's pinned issues
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<Issue>, Integer, Hash)>] Array<Issue> data, response status code and response headers
def repo_list_pinned_issues_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_pinned_issues ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_pinned_issues"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_pinned_issues"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/issues/pinned'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Issue>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_pinned_issues",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_pinned_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's pinned pull requests
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<PullRequest>]
def repo_list_pinned_pull_requests(owner, repo, opts = {})
data, _status_code, _headers = repo_list_pinned_pull_requests_with_http_info(owner, repo, opts)
data
end
# List a repo's pinned pull requests
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<PullRequest>, Integer, Hash)>] Array<PullRequest> data, response status code and response headers
def repo_list_pinned_pull_requests_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_pinned_pull_requests ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_pinned_pull_requests"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_pinned_pull_requests"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/pinned'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<PullRequest>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_pinned_pull_requests",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_pinned_pull_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's pull requests
# @param owner [String] Owner of the repo
# @param repo [String] Name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :state State of pull request (default to 'open')
# @option opts [String] :sort Type of sort
# @option opts [Integer] :milestone ID of the milestone
# @option opts [Array<Integer>] :labels Label IDs
# @option opts [String] :poster Filter by pull request author
# @option opts [Integer] :page Page number of results to return (1-based) (default to 1)
# @option opts [Integer] :limit Page size of results
# @return [Array<PullRequest>]
def repo_list_pull_requests(owner, repo, opts = {})
data, _status_code, _headers = repo_list_pull_requests_with_http_info(owner, repo, opts)
data
end
# List a repo's pull requests
# @param owner [String] Owner of the repo
# @param repo [String] Name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :state State of pull request (default to 'open')
# @option opts [String] :sort Type of sort
# @option opts [Integer] :milestone ID of the milestone
# @option opts [Array<Integer>] :labels Label IDs
# @option opts [String] :poster Filter by pull request author
# @option opts [Integer] :page Page number of results to return (1-based) (default to 1)
# @option opts [Integer] :limit Page size of results
# @return [Array<(Array<PullRequest>, Integer, Hash)>] Array<PullRequest> data, response status code and response headers
def repo_list_pull_requests_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_pull_requests ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_pull_requests"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_pull_requests"
end
allowable_values = ["open", "closed", "all"]
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
end
allowable_values = ["oldest", "recentupdate", "leastupdate", "mostcomment", "leastcomment", "priority"]
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
end
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling RepositoryApi.repo_list_pull_requests, must be greater than or equal to 1.'
end
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RepositoryApi.repo_list_pull_requests, must be greater than or equal to 0.'
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'milestone'] = opts[:'milestone'] if !opts[:'milestone'].nil?
query_params[:'labels'] = @api_client.build_collection_param(opts[:'labels'], :multi) if !opts[:'labels'].nil?
query_params[:'poster'] = opts[:'poster'] if !opts[:'poster'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<PullRequest>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_pull_requests",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_pull_requests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List all reviews for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<PullReview>]
def repo_list_pull_reviews(owner, repo, index, opts = {})
data, _status_code, _headers = repo_list_pull_reviews_with_http_info(owner, repo, index, opts)
data
end
# List all reviews for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<PullReview>, Integer, Hash)>] Array<PullReview> data, response status code and response headers
def repo_list_pull_reviews_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_pull_reviews ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_pull_reviews"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_pull_reviews"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_list_pull_reviews"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<PullReview>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_pull_reviews",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_pull_reviews\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get all push mirrors of the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<PushMirror>]
def repo_list_push_mirrors(owner, repo, opts = {})
data, _status_code, _headers = repo_list_push_mirrors_with_http_info(owner, repo, opts)
data
end
# Get all push mirrors of the repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<PushMirror>, Integer, Hash)>] Array<PushMirror> data, response status code and response headers
def repo_list_push_mirrors_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_push_mirrors ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_push_mirrors"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_push_mirrors"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/push_mirrors'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<PushMirror>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_push_mirrors",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_push_mirrors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List release's attachments
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param [Hash] opts the optional parameters
# @return [Array<Attachment>]
def repo_list_release_attachments(owner, repo, id, opts = {})
data, _status_code, _headers = repo_list_release_attachments_with_http_info(owner, repo, id, opts)
data
end
# List release's attachments
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the release
# @param [Hash] opts the optional parameters
# @return [Array<(Array<Attachment>, Integer, Hash)>] Array<Attachment> data, response status code and response headers
def repo_list_release_attachments_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_release_attachments ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_release_attachments"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_release_attachments"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_list_release_attachments"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases/{id}/assets'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Attachment>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_release_attachments",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_release_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's releases
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :draft filter (exclude / include) drafts, if you dont have repo write access none will show
# @option opts [Boolean] :pre_release filter (exclude / include) pre-releases
# @option opts [String] :q Search string
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<Release>]
def repo_list_releases(owner, repo, opts = {})
data, _status_code, _headers = repo_list_releases_with_http_info(owner, repo, opts)
data
end
# List a repo's releases
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Boolean] :draft filter (exclude / include) drafts, if you dont have repo write access none will show
# @option opts [Boolean] :pre_release filter (exclude / include) pre-releases
# @option opts [String] :q Search string
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<Release>, Integer, Hash)>] Array<Release> data, response status code and response headers
def repo_list_releases_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_releases ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_releases"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_releases"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/releases'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'draft'] = opts[:'draft'] if !opts[:'draft'].nil?
query_params[:'pre-release'] = opts[:'pre_release'] if !opts[:'pre_release'].nil?
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Release>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_releases",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_releases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's stargazers
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<User>]
def repo_list_stargazers(owner, repo, opts = {})
data, _status_code, _headers = repo_list_stargazers_with_http_info(owner, repo, opts)
data
end
# List a repo's stargazers
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<User>, Integer, Hash)>] Array<User> data, response status code and response headers
def repo_list_stargazers_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_stargazers ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_stargazers"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_stargazers"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/stargazers'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<User>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_stargazers",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_stargazers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a commit's statuses
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [String] :sort type of sort
# @option opts [String] :state type of state
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<CommitStatus>]
def repo_list_statuses(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_list_statuses_with_http_info(owner, repo, sha, opts)
data
end
# Get a commit's statuses
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] sha of the commit
# @param [Hash] opts the optional parameters
# @option opts [String] :sort type of sort
# @option opts [String] :state type of state
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<CommitStatus>, Integer, Hash)>] Array<CommitStatus> data, response status code and response headers
def repo_list_statuses_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_statuses ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_statuses"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_statuses"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_list_statuses"
end
allowable_values = ["oldest", "recentupdate", "leastupdate", "leastindex", "highestindex"]
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
end
allowable_values = ["pending", "success", "error", "failure", "warning"]
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/statuses/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<CommitStatus>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_statuses",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get a commit's statuses, by branch/tag/commit reference
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] name of branch/tag/commit
# @param [Hash] opts the optional parameters
# @option opts [String] :sort type of sort
# @option opts [String] :state type of state
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<CommitStatus>]
def repo_list_statuses_by_ref(owner, repo, ref, opts = {})
data, _status_code, _headers = repo_list_statuses_by_ref_with_http_info(owner, repo, ref, opts)
data
end
# Get a commit's statuses, by branch/tag/commit reference
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param ref [String] name of branch/tag/commit
# @param [Hash] opts the optional parameters
# @option opts [String] :sort type of sort
# @option opts [String] :state type of state
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<CommitStatus>, Integer, Hash)>] Array<CommitStatus> data, response status code and response headers
def repo_list_statuses_by_ref_with_http_info(owner, repo, ref, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_statuses_by_ref ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_statuses_by_ref"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_statuses_by_ref"
end
# verify the required parameter 'ref' is set
if @api_client.config.client_side_validation && ref.nil?
fail ArgumentError, "Missing the required parameter 'ref' when calling RepositoryApi.repo_list_statuses_by_ref"
end
allowable_values = ["oldest", "recentupdate", "leastupdate", "leastindex", "highestindex"]
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
end
allowable_values = ["pending", "success", "error", "failure", "warning"]
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/commits/{ref}/statuses'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'ref' + '}', CGI.escape(ref.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<CommitStatus>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_statuses_by_ref",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_statuses_by_ref\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's watchers
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<User>]
def repo_list_subscribers(owner, repo, opts = {})
data, _status_code, _headers = repo_list_subscribers_with_http_info(owner, repo, opts)
data
end
# List a repo's watchers
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<User>, Integer, Hash)>] Array<User> data, response status code and response headers
def repo_list_subscribers_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_subscribers ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_subscribers"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_subscribers"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/subscribers'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<User>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_subscribers",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_subscribers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List tag protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<TagProtection>]
def repo_list_tag_protection(owner, repo, opts = {})
data, _status_code, _headers = repo_list_tag_protection_with_http_info(owner, repo, opts)
data
end
# List tag protections for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<TagProtection>, Integer, Hash)>] Array<TagProtection> data, response status code and response headers
def repo_list_tag_protection_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_tag_protection ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_tag_protection"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_tag_protection"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tag_protections'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<TagProtection>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_tag_protection",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_tag_protection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's tags
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results, default maximum page size is 50
# @return [Array<Tag>]
def repo_list_tags(owner, repo, opts = {})
data, _status_code, _headers = repo_list_tags_with_http_info(owner, repo, opts)
data
end
# List a repository's tags
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results, default maximum page size is 50
# @return [Array<(Array<Tag>, Integer, Hash)>] Array<Tag> data, response status code and response headers
def repo_list_tags_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_tags ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_tags"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_tags"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/tags'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Tag>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_tags",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repository's teams
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<Team>]
def repo_list_teams(owner, repo, opts = {})
data, _status_code, _headers = repo_list_teams_with_http_info(owner, repo, opts)
data
end
# List a repository's teams
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(Array<Team>, Integer, Hash)>] Array<Team> data, response status code and response headers
def repo_list_teams_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_teams ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_teams"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_teams"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/teams'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<Team>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_teams",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get list of topics that a repository has
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [TopicName]
def repo_list_topics(owner, repo, opts = {})
data, _status_code, _headers = repo_list_topics_with_http_info(owner, repo, opts)
data
end
# Get list of topics that a repository has
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(TopicName, Integer, Hash)>] TopicName data, response status code and response headers
def repo_list_topics_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_list_topics ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_list_topics"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_list_topics"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/topics'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'TopicName'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_list_topics",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_list_topics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Merge a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to merge
# @param [Hash] opts the optional parameters
# @option opts [MergePullRequestOption] :body
# @return [nil]
def repo_merge_pull_request(owner, repo, index, opts = {})
repo_merge_pull_request_with_http_info(owner, repo, index, opts)
nil
end
# Merge a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to merge
# @param [Hash] opts the optional parameters
# @option opts [MergePullRequestOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_merge_pull_request_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_merge_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_merge_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_merge_pull_request"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_merge_pull_request"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/merge'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_merge_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_merge_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Migrate a remote git repository
# @param [Hash] opts the optional parameters
# @option opts [MigrateRepoOptions] :body
# @return [Repository]
def repo_migrate(opts = {})
data, _status_code, _headers = repo_migrate_with_http_info(opts)
data
end
# Migrate a remote git repository
# @param [Hash] opts the optional parameters
# @option opts [MigrateRepoOptions] :body
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def repo_migrate_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_migrate ...'
end
# resource path
local_var_path = '/repos/migrate'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_migrate",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_migrate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Sync a mirrored repository
# @param owner [String] owner of the repo to sync
# @param repo [String] name of the repo to sync
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_mirror_sync(owner, repo, opts = {})
repo_mirror_sync_with_http_info(owner, repo, opts)
nil
end
# Sync a mirrored repository
# @param owner [String] owner of the repo to sync
# @param repo [String] name of the repo to sync
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_mirror_sync_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_mirror_sync ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_mirror_sync"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_mirror_sync"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/mirror-sync'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_mirror_sync",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_mirror_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns if new Issue Pins are allowed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [NewIssuePinsAllowed]
def repo_new_pin_allowed(owner, repo, opts = {})
data, _status_code, _headers = repo_new_pin_allowed_with_http_info(owner, repo, opts)
data
end
# Returns if new Issue Pins are allowed
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(NewIssuePinsAllowed, Integer, Hash)>] NewIssuePinsAllowed data, response status code and response headers
def repo_new_pin_allowed_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_new_pin_allowed ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_new_pin_allowed"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_new_pin_allowed"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/new_pin_allowed'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'NewIssuePinsAllowed'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_new_pin_allowed",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_new_pin_allowed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Check if a pull request has been merged
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_pull_request_is_merged(owner, repo, index, opts = {})
repo_pull_request_is_merged_with_http_info(owner, repo, index, opts)
nil
end
# Check if a pull request has been merged
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_pull_request_is_merged_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_pull_request_is_merged ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_pull_request_is_merged"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_pull_request_is_merged"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_pull_request_is_merged"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/merge'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_pull_request_is_merged",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_pull_request_is_merged\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Sync all push mirrored repository
# @param owner [String] owner of the repo to sync
# @param repo [String] name of the repo to sync
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_push_mirror_sync(owner, repo, opts = {})
repo_push_mirror_sync_with_http_info(owner, repo, opts)
nil
end
# Sync all push mirrored repository
# @param owner [String] owner of the repo to sync
# @param repo [String] name of the repo to sync
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_push_mirror_sync_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_push_mirror_sync ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_push_mirror_sync"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_push_mirror_sync"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/push_mirrors-sync'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_push_mirror_sync",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_push_mirror_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Removes a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @return [nil]
def repo_remove_note(owner, repo, sha, opts = {})
repo_remove_note_with_http_info(owner, repo, sha, opts)
nil
end
# Removes a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_remove_note_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_remove_note ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_remove_note"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_remove_note"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_remove_note"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/notes/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_remove_note",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_remove_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Replace all flags of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [ReplaceFlagsOption] :body
# @return [nil]
def repo_replace_all_flags(owner, repo, opts = {})
repo_replace_all_flags_with_http_info(owner, repo, opts)
nil
end
# Replace all flags of a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [ReplaceFlagsOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_replace_all_flags_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_replace_all_flags ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_replace_all_flags"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_replace_all_flags"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/flags'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_replace_all_flags",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_replace_all_flags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Search for repositories
# @param [Hash] opts the optional parameters
# @option opts [String] :q keyword
# @option opts [Boolean] :topic Limit search to repositories with keyword as topic
# @option opts [Boolean] :include_desc include search of keyword within repository description
# @option opts [Integer] :uid search only for repos that the user with the given id owns or contributes to
# @option opts [Integer] :priority_owner_id repo owner to prioritize in the results
# @option opts [Integer] :team_id search only for repos that belong to the given team id
# @option opts [Integer] :starred_by search only for repos that the user with the given id has starred
# @option opts [Boolean] :private include private repositories this user has access to (defaults to true)
# @option opts [Boolean] :is_private show only pubic, private or all repositories (defaults to all)
# @option opts [Boolean] :template include template repositories this user has access to (defaults to true)
# @option opts [Boolean] :archived show only archived, non-archived or all repositories (defaults to all)
# @option opts [String] :mode type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\"
# @option opts [Boolean] :exclusive if `uid` is given, search only for repos that the user owns
# @option opts [String] :sort sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", \"git_size\", \"lfs_size\", \"stars\", \"forks\" and \"id\". Default is \"alpha\"
# @option opts [String] :order sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [SearchResults]
def repo_search(opts = {})
data, _status_code, _headers = repo_search_with_http_info(opts)
data
end
# Search for repositories
# @param [Hash] opts the optional parameters
# @option opts [String] :q keyword
# @option opts [Boolean] :topic Limit search to repositories with keyword as topic
# @option opts [Boolean] :include_desc include search of keyword within repository description
# @option opts [Integer] :uid search only for repos that the user with the given id owns or contributes to
# @option opts [Integer] :priority_owner_id repo owner to prioritize in the results
# @option opts [Integer] :team_id search only for repos that belong to the given team id
# @option opts [Integer] :starred_by search only for repos that the user with the given id has starred
# @option opts [Boolean] :private include private repositories this user has access to (defaults to true)
# @option opts [Boolean] :is_private show only pubic, private or all repositories (defaults to all)
# @option opts [Boolean] :template include template repositories this user has access to (defaults to true)
# @option opts [Boolean] :archived show only archived, non-archived or all repositories (defaults to all)
# @option opts [String] :mode type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\"
# @option opts [Boolean] :exclusive if `uid` is given, search only for repos that the user owns
# @option opts [String] :sort sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", \"git_size\", \"lfs_size\", \"stars\", \"forks\" and \"id\". Default is \"alpha\"
# @option opts [String] :order sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified.
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(SearchResults, Integer, Hash)>] SearchResults data, response status code and response headers
def repo_search_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_search ...'
end
# resource path
local_var_path = '/repos/search'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
query_params[:'topic'] = opts[:'topic'] if !opts[:'topic'].nil?
query_params[:'includeDesc'] = opts[:'include_desc'] if !opts[:'include_desc'].nil?
query_params[:'uid'] = opts[:'uid'] if !opts[:'uid'].nil?
query_params[:'priority_owner_id'] = opts[:'priority_owner_id'] if !opts[:'priority_owner_id'].nil?
query_params[:'team_id'] = opts[:'team_id'] if !opts[:'team_id'].nil?
query_params[:'starredBy'] = opts[:'starred_by'] if !opts[:'starred_by'].nil?
query_params[:'private'] = opts[:'private'] if !opts[:'private'].nil?
query_params[:'is_private'] = opts[:'is_private'] if !opts[:'is_private'].nil?
query_params[:'template'] = opts[:'template'] if !opts[:'template'].nil?
query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
query_params[:'mode'] = opts[:'mode'] if !opts[:'mode'].nil?
query_params[:'exclusive'] = opts[:'exclusive'] if !opts[:'exclusive'].nil?
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'SearchResults'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_search",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Set a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [NoteOptions] :body
# @return [Note]
def repo_set_note(owner, repo, sha, opts = {})
data, _status_code, _headers = repo_set_note_with_http_info(owner, repo, sha, opts)
data
end
# Set a note corresponding to a single commit from a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param sha [String] a git ref or commit sha
# @param [Hash] opts the optional parameters
# @option opts [NoteOptions] :body
# @return [Array<(Note, Integer, Hash)>] Note data, response status code and response headers
def repo_set_note_with_http_info(owner, repo, sha, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_set_note ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_set_note"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_set_note"
end
# verify the required parameter 'sha' is set
if @api_client.config.client_side_validation && sha.nil?
fail ArgumentError, "Missing the required parameter 'sha' when calling RepositoryApi.repo_set_note"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/git/notes/{sha}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'sha' + '}', CGI.escape(sha.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type] || 'Note'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_set_note",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_set_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get signing-key.gpg for given repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [String]
def repo_signing_key(owner, repo, opts = {})
data, _status_code, _headers = repo_signing_key_with_http_info(owner, repo, opts)
data
end
# Get signing-key.gpg for given repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def repo_signing_key_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_signing_key ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_signing_key"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_signing_key"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/signing-key.gpg'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['text/plain']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_signing_key",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Submit a pending review to an pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [SubmitPullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [PullReview]
def repo_submit_pull_review(owner, repo, index, id, body, opts = {})
data, _status_code, _headers = repo_submit_pull_review_with_http_info(owner, repo, index, id, body, opts)
data
end
# Submit a pending review to an pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param body [SubmitPullReviewOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(PullReview, Integer, Hash)>] PullReview data, response status code and response headers
def repo_submit_pull_review_with_http_info(owner, repo, index, id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_submit_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_submit_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_submit_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_submit_pull_review"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_submit_pull_review"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_submit_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'PullReview'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_submit_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_submit_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Test a push webhook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to test
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag, indicates which commit will be loaded to the webhook payload.
# @return [nil]
def repo_test_hook(owner, repo, id, opts = {})
repo_test_hook_with_http_info(owner, repo, id, opts)
nil
end
# Test a push webhook
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param id [Integer] id of the hook to test
# @param [Hash] opts the optional parameters
# @option opts [String] :ref The name of the commit/branch/tag, indicates which commit will be loaded to the webhook payload.
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_test_hook_with_http_info(owner, repo, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_test_hook ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_test_hook"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_test_hook"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_test_hook"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/hooks/{id}/tests'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'ref'] = opts[:'ref'] if !opts[:'ref'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_test_hook",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_test_hook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a repo's tracked times
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :user optional filter by user (available for issue managers)
# @option opts [Time] :since Only show times updated after the given time. This is a timestamp in RFC 3339 format
# @option opts [Time] :before Only show times updated before the given time. This is a timestamp in RFC 3339 format
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<TrackedTime>]
def repo_tracked_times(owner, repo, opts = {})
data, _status_code, _headers = repo_tracked_times_with_http_info(owner, repo, opts)
data
end
# List a repo's tracked times
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [String] :user optional filter by user (available for issue managers)
# @option opts [Time] :since Only show times updated after the given time. This is a timestamp in RFC 3339 format
# @option opts [Time] :before Only show times updated before the given time. This is a timestamp in RFC 3339 format
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<TrackedTime>, Integer, Hash)>] Array<TrackedTime> data, response status code and response headers
def repo_tracked_times_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_tracked_times ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_tracked_times"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_tracked_times"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/times'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<TrackedTime>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_tracked_times",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_tracked_times\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Transfer a repo ownership
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param body [TransferRepoOption] Transfer Options
# @param [Hash] opts the optional parameters
# @return [Repository]
def repo_transfer(owner, repo, body, opts = {})
data, _status_code, _headers = repo_transfer_with_http_info(owner, repo, body, opts)
data
end
# Transfer a repo ownership
# @param owner [String] owner of the repo to transfer
# @param repo [String] name of the repo to transfer
# @param body [TransferRepoOption] Transfer Options
# @param [Hash] opts the optional parameters
# @return [Array<(Repository, Integer, Hash)>] Repository data, response status code and response headers
def repo_transfer_with_http_info(owner, repo, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_transfer ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_transfer"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_transfer"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_transfer"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/transfer'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'Repository'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_transfer",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Cancel to dismiss a review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [PullReview]
def repo_un_dismiss_pull_review(owner, repo, index, id, opts = {})
data, _status_code, _headers = repo_un_dismiss_pull_review_with_http_info(owner, repo, index, id, opts)
data
end
# Cancel to dismiss a review for a pull request
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request
# @param id [Integer] id of the review
# @param [Hash] opts the optional parameters
# @return [Array<(PullReview, Integer, Hash)>] PullReview data, response status code and response headers
def repo_un_dismiss_pull_review_with_http_info(owner, repo, index, id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_un_dismiss_pull_review ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_un_dismiss_pull_review"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_un_dismiss_pull_review"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_un_dismiss_pull_review"
end
# verify the required parameter 'id' is set
if @api_client.config.client_side_validation && id.nil?
fail ArgumentError, "Missing the required parameter 'id' when calling RepositoryApi.repo_un_dismiss_pull_review"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'PullReview'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_un_dismiss_pull_review",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_un_dismiss_pull_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update avatar
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [UpdateRepoAvatarOption] :body
# @return [nil]
def repo_update_avatar(owner, repo, opts = {})
repo_update_avatar_with_http_info(owner, repo, opts)
nil
end
# Update avatar
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [UpdateRepoAvatarOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_update_avatar_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_update_avatar ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_update_avatar"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_update_avatar"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/avatar'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_update_avatar",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_update_avatar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update a branch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] name of the branch
# @param [Hash] opts the optional parameters
# @option opts [UpdateBranchRepoOption] :body
# @return [nil]
def repo_update_branch(owner, repo, branch, opts = {})
repo_update_branch_with_http_info(owner, repo, branch, opts)
nil
end
# Update a branch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param branch [String] name of the branch
# @param [Hash] opts the optional parameters
# @option opts [UpdateBranchRepoOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_update_branch_with_http_info(owner, repo, branch, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_update_branch ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_update_branch"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_update_branch"
end
# verify the required parameter 'branch' is set
if @api_client.config.client_side_validation && branch.nil?
fail ArgumentError, "Missing the required parameter 'branch' when calling RepositoryApi.repo_update_branch"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/branches/{branch}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'branch' + '}', CGI.escape(branch.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_update_branch",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_update_branch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to update
# @param body [UpdateFileOptions]
# @param [Hash] opts the optional parameters
# @return [FileResponse]
def repo_update_file(owner, repo, filepath, body, opts = {})
data, _status_code, _headers = repo_update_file_with_http_info(owner, repo, filepath, body, opts)
data
end
# Update a file in a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param filepath [String] path of the file to update
# @param body [UpdateFileOptions]
# @param [Hash] opts the optional parameters
# @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
def repo_update_file_with_http_info(owner, repo, filepath, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_update_file ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_update_file"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_update_file"
end
# verify the required parameter 'filepath' is set
if @api_client.config.client_side_validation && filepath.nil?
fail ArgumentError, "Missing the required parameter 'filepath' when calling RepositoryApi.repo_update_file"
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling RepositoryApi.repo_update_file"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/contents/{filepath}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'filepath' + '}', CGI.escape(filepath.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
# return_type
return_type = opts[:debug_return_type] || 'FileResponse'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_update_file",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_update_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Merge PR's baseBranch into headBranch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [String] :style how to update pull request
# @return [nil]
def repo_update_pull_request(owner, repo, index, opts = {})
repo_update_pull_request_with_http_info(owner, repo, index, opts)
nil
end
# Merge PR's baseBranch into headBranch
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param index [Integer] index of the pull request to get
# @param [Hash] opts the optional parameters
# @option opts [String] :style how to update pull request
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_update_pull_request_with_http_info(owner, repo, index, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_update_pull_request ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_update_pull_request"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_update_pull_request"
end
# verify the required parameter 'index' is set
if @api_client.config.client_side_validation && index.nil?
fail ArgumentError, "Missing the required parameter 'index' when calling RepositoryApi.repo_update_pull_request"
end
allowable_values = ["merge", "rebase"]
if @api_client.config.client_side_validation && opts[:'style'] && !allowable_values.include?(opts[:'style'])
fail ArgumentError, "invalid value for \"style\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/pulls/{index}/update'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'index' + '}', CGI.escape(index.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'style'] = opts[:'style'] if !opts[:'style'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_update_pull_request",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_update_pull_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Replace list of topics for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [RepoTopicOptions] :body
# @return [nil]
def repo_update_topics(owner, repo, opts = {})
repo_update_topics_with_http_info(owner, repo, opts)
nil
end
# Replace list of topics for a repository
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @option opts [RepoTopicOptions] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def repo_update_topics_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_update_topics ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_update_topics"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_update_topics"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/topics'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_update_topics",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_update_topics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns the validation information for a issue config
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [IssueConfigValidation]
def repo_validate_issue_config(owner, repo, opts = {})
data, _status_code, _headers = repo_validate_issue_config_with_http_info(owner, repo, opts)
data
end
# Returns the validation information for a issue config
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(IssueConfigValidation, Integer, Hash)>] IssueConfigValidation data, response status code and response headers
def repo_validate_issue_config_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.repo_validate_issue_config ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.repo_validate_issue_config"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.repo_validate_issue_config"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/issue_config/validate'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'IssueConfigValidation'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.repo_validate_issue_config",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#repo_validate_issue_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# search topics via keyword
# @param q [String] keywords to search
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<TopicResponse>]
def topic_search(q, opts = {})
data, _status_code, _headers = topic_search_with_http_info(q, opts)
data
end
# search topics via keyword
# @param q [String] keywords to search
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page page number of results to return (1-based)
# @option opts [Integer] :limit page size of results
# @return [Array<(Array<TopicResponse>, Integer, Hash)>] Array<TopicResponse> data, response status code and response headers
def topic_search_with_http_info(q, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.topic_search ...'
end
# verify the required parameter 'q' is set
if @api_client.config.client_side_validation && q.nil?
fail ArgumentError, "Missing the required parameter 'q' when calling RepositoryApi.topic_search"
end
# resource path
local_var_path = '/topics/search'
# query parameters
query_params = opts[:query_params] || {}
query_params[:'q'] = q
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<TopicResponse>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.topic_search",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#topic_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create or Update a secret value in a repository
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param secretname [String] name of the secret
# @param [Hash] opts the optional parameters
# @option opts [CreateOrUpdateSecretOption] :body
# @return [nil]
def update_repo_secret(owner, repo, secretname, opts = {})
update_repo_secret_with_http_info(owner, repo, secretname, opts)
nil
end
# Create or Update a secret value in a repository
# @param owner [String] owner of the repository
# @param repo [String] name of the repository
# @param secretname [String] name of the secret
# @param [Hash] opts the optional parameters
# @option opts [CreateOrUpdateSecretOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def update_repo_secret_with_http_info(owner, repo, secretname, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.update_repo_secret ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.update_repo_secret"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.update_repo_secret"
end
# verify the required parameter 'secretname' is set
if @api_client.config.client_side_validation && secretname.nil?
fail ArgumentError, "Missing the required parameter 'secretname' when calling RepositoryApi.update_repo_secret"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/secrets/{secretname}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'secretname' + '}', CGI.escape(secretname.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.update_repo_secret",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#update_repo_secret\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @option opts [UpdateVariableOption] :body
# @return [nil]
def update_repo_variable(owner, repo, variablename, opts = {})
update_repo_variable_with_http_info(owner, repo, variablename, opts)
nil
end
# Update a repo-level variable
# @param owner [String] name of the owner
# @param repo [String] name of the repository
# @param variablename [String] name of the variable
# @param [Hash] opts the optional parameters
# @option opts [UpdateVariableOption] :body
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def update_repo_variable_with_http_info(owner, repo, variablename, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.update_repo_variable ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.update_repo_variable"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.update_repo_variable"
end
# verify the required parameter 'variablename' is set
if @api_client.config.client_side_validation && variablename.nil?
fail ArgumentError, "Missing the required parameter 'variablename' when calling RepositoryApi.update_repo_variable"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/actions/variables/{variablename}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'variablename' + '}', CGI.escape(variablename.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json', 'text/plain'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.update_repo_variable",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#update_repo_variable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Check if the current user is watching a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [WatchInfo]
def user_current_check_subscription(owner, repo, opts = {})
data, _status_code, _headers = user_current_check_subscription_with_http_info(owner, repo, opts)
data
end
# Check if the current user is watching a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(WatchInfo, Integer, Hash)>] WatchInfo data, response status code and response headers
def user_current_check_subscription_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.user_current_check_subscription ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.user_current_check_subscription"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.user_current_check_subscription"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/subscription'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'WatchInfo'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.user_current_check_subscription",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#user_current_check_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Unwatch a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [nil]
def user_current_delete_subscription(owner, repo, opts = {})
user_current_delete_subscription_with_http_info(owner, repo, opts)
nil
end
# Unwatch a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def user_current_delete_subscription_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.user_current_delete_subscription ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.user_current_delete_subscription"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.user_current_delete_subscription"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/subscription'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.user_current_delete_subscription",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#user_current_delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Watch a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [WatchInfo]
def user_current_put_subscription(owner, repo, opts = {})
data, _status_code, _headers = user_current_put_subscription_with_http_info(owner, repo, opts)
data
end
# Watch a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param [Hash] opts the optional parameters
# @return [Array<(WatchInfo, Integer, Hash)>] WatchInfo data, response status code and response headers
def user_current_put_subscription_with_http_info(owner, repo, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.user_current_put_subscription ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.user_current_put_subscription"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.user_current_put_subscription"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/subscription'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/html']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'WatchInfo'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.user_current_put_subscription",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#user_current_put_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List a user's tracked times in a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param user [String] username of user
# @param [Hash] opts the optional parameters
# @return [Array<TrackedTime>]
def user_tracked_times(owner, repo, user, opts = {})
data, _status_code, _headers = user_tracked_times_with_http_info(owner, repo, user, opts)
data
end
# List a user's tracked times in a repo
# @param owner [String] owner of the repo
# @param repo [String] name of the repo
# @param user [String] username of user
# @param [Hash] opts the optional parameters
# @return [Array<(Array<TrackedTime>, Integer, Hash)>] Array<TrackedTime> data, response status code and response headers
def user_tracked_times_with_http_info(owner, repo, user, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: RepositoryApi.user_tracked_times ...'
end
# verify the required parameter 'owner' is set
if @api_client.config.client_side_validation && owner.nil?
fail ArgumentError, "Missing the required parameter 'owner' when calling RepositoryApi.user_tracked_times"
end
# verify the required parameter 'repo' is set
if @api_client.config.client_side_validation && repo.nil?
fail ArgumentError, "Missing the required parameter 'repo' when calling RepositoryApi.user_tracked_times"
end
# verify the required parameter 'user' is set
if @api_client.config.client_side_validation && user.nil?
fail ArgumentError, "Missing the required parameter 'user' when calling RepositoryApi.user_tracked_times"
end
# resource path
local_var_path = '/repos/{owner}/{repo}/times/{user}'.sub('{' + 'owner' + '}', CGI.escape(owner.to_s)).sub('{' + 'repo' + '}', CGI.escape(repo.to_s)).sub('{' + 'user' + '}', CGI.escape(user.to_s))
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body]
# return_type
return_type = opts[:debug_return_type] || 'Array<TrackedTime>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"RepositoryApi.user_tracked_times",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RepositoryApi#user_tracked_times\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end