=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 MiscellaneousApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Returns information about a gitignore template
# @param name [String] name of the template
# @param [Hash] opts the optional parameters
# @return [GitignoreTemplateInfo]
def get_gitignore_template_info(name, opts = {})
data, _status_code, _headers = get_gitignore_template_info_with_http_info(name, opts)
data
end
# Returns information about a gitignore template
# @param name [String] name of the template
# @param [Hash] opts the optional parameters
# @return [Array<(GitignoreTemplateInfo, Integer, Hash)>] GitignoreTemplateInfo data, response status code and response headers
def get_gitignore_template_info_with_http_info(name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_gitignore_template_info ...'
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 MiscellaneousApi.get_gitignore_template_info"
end
# resource path
local_var_path = '/gitignore/templates/{name}'.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] || 'GitignoreTemplateInfo'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.get_gitignore_template_info",
: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: MiscellaneousApi#get_gitignore_template_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns all labels in a template
# @param name [String] name of the template
# @param [Hash] opts the optional parameters
# @return [Array<LabelTemplate>]
def get_label_template_info(name, opts = {})
data, _status_code, _headers = get_label_template_info_with_http_info(name, opts)
data
end
# Returns all labels in a template
# @param name [String] name of the template
# @param [Hash] opts the optional parameters
# @return [Array<(Array<LabelTemplate>, Integer, Hash)>] Array<LabelTemplate> data, response status code and response headers
def get_label_template_info_with_http_info(name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_label_template_info ...'
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 MiscellaneousApi.get_label_template_info"
end
# resource path
local_var_path = '/label/templates/{name}'.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] || 'Array<LabelTemplate>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.get_label_template_info",
: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: MiscellaneousApi#get_label_template_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns information about a license template
# @param name [String] name of the license
# @param [Hash] opts the optional parameters
# @return [LicenseTemplateInfo]
def get_license_template_info(name, opts = {})
data, _status_code, _headers = get_license_template_info_with_http_info(name, opts)
data
end
# Returns information about a license template
# @param name [String] name of the license
# @param [Hash] opts the optional parameters
# @return [Array<(LicenseTemplateInfo, Integer, Hash)>] LicenseTemplateInfo data, response status code and response headers
def get_license_template_info_with_http_info(name, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_license_template_info ...'
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 MiscellaneousApi.get_license_template_info"
end
# resource path
local_var_path = '/licenses/{name}'.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] || 'LicenseTemplateInfo'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.get_license_template_info",
: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: MiscellaneousApi#get_license_template_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns the nodeinfo of the Gitea application
# @param [Hash] opts the optional parameters
# @return [NodeInfo]
def get_node_info(opts = {})
data, _status_code, _headers = get_node_info_with_http_info(opts)
data
end
# Returns the nodeinfo of the Gitea application
# @param [Hash] opts the optional parameters
# @return [Array<(NodeInfo, Integer, Hash)>] NodeInfo data, response status code and response headers
def get_node_info_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_node_info ...'
end
# resource path
local_var_path = '/nodeinfo'
# 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] || 'NodeInfo'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.get_node_info",
: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: MiscellaneousApi#get_node_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get default signing-key.gpg
# @param [Hash] opts the optional parameters
# @return [String]
def get_signing_key(opts = {})
data, _status_code, _headers = get_signing_key_with_http_info(opts)
data
end
# Get default signing-key.gpg
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def get_signing_key_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_signing_key ...'
end
# resource path
local_var_path = '/signing-key.gpg'
# 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 => :"MiscellaneousApi.get_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: MiscellaneousApi#get_signing_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns the version of the Gitea application
# @param [Hash] opts the optional parameters
# @return [ServerVersion]
def get_version(opts = {})
data, _status_code, _headers = get_version_with_http_info(opts)
data
end
# Returns the version of the Gitea application
# @param [Hash] opts the optional parameters
# @return [Array<(ServerVersion, Integer, Hash)>] ServerVersion data, response status code and response headers
def get_version_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.get_version ...'
end
# resource path
local_var_path = '/version'
# 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] || 'ServerVersion'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.get_version",
: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: MiscellaneousApi#get_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of all gitignore templates
# @param [Hash] opts the optional parameters
# @return [Array<String>]
def list_gitignores_templates(opts = {})
data, _status_code, _headers = list_gitignores_templates_with_http_info(opts)
data
end
# Returns a list of all gitignore templates
# @param [Hash] opts the optional parameters
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
def list_gitignores_templates_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.list_gitignores_templates ...'
end
# resource path
local_var_path = '/gitignore/templates'
# 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 => :"MiscellaneousApi.list_gitignores_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: MiscellaneousApi#list_gitignores_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of all label templates
# @param [Hash] opts the optional parameters
# @return [Array<String>]
def list_label_templates(opts = {})
data, _status_code, _headers = list_label_templates_with_http_info(opts)
data
end
# Returns a list of all label templates
# @param [Hash] opts the optional parameters
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
def list_label_templates_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.list_label_templates ...'
end
# resource path
local_var_path = '/label/templates'
# 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 => :"MiscellaneousApi.list_label_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: MiscellaneousApi#list_label_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Returns a list of all license templates
# @param [Hash] opts the optional parameters
# @return [Array<LicensesTemplateListEntry>]
def list_license_templates(opts = {})
data, _status_code, _headers = list_license_templates_with_http_info(opts)
data
end
# Returns a list of all license templates
# @param [Hash] opts the optional parameters
# @return [Array<(Array<LicensesTemplateListEntry>, Integer, Hash)>] Array<LicensesTemplateListEntry> data, response status code and response headers
def list_license_templates_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.list_license_templates ...'
end
# resource path
local_var_path = '/licenses'
# 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<LicensesTemplateListEntry>'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.list_license_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: MiscellaneousApi#list_license_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Render a markdown document as HTML
# @param [Hash] opts the optional parameters
# @option opts [MarkdownOption] :body
# @return [String]
def render_markdown(opts = {})
data, _status_code, _headers = render_markdown_with_http_info(opts)
data
end
# Render a markdown document as HTML
# @param [Hash] opts the optional parameters
# @option opts [MarkdownOption] :body
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def render_markdown_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.render_markdown ...'
end
# resource path
local_var_path = '/markdown'
# 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/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] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.render_markdown",
: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: MiscellaneousApi#render_markdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Render raw markdown as HTML
# @param body [String] Request body to render
# @param [Hash] opts the optional parameters
# @return [String]
def render_markdown_raw(body, opts = {})
data, _status_code, _headers = render_markdown_raw_with_http_info(body, opts)
data
end
# Render raw markdown as HTML
# @param body [String] Request body to render
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def render_markdown_raw_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.render_markdown_raw ...'
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 MiscellaneousApi.render_markdown_raw"
end
# resource path
local_var_path = '/markdown/raw'
# 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/html']) unless header_params['Accept']
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['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] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.render_markdown_raw",
: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: MiscellaneousApi#render_markdown_raw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Render a markup document as HTML
# @param [Hash] opts the optional parameters
# @option opts [MarkupOption] :body
# @return [String]
def render_markup(opts = {})
data, _status_code, _headers = render_markup_with_http_info(opts)
data
end
# Render a markup document as HTML
# @param [Hash] opts the optional parameters
# @option opts [MarkupOption] :body
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def render_markup_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: MiscellaneousApi.render_markup ...'
end
# resource path
local_var_path = '/markup'
# 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/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] || 'String'
# auth_names
auth_names = opts[:debug_auth_names] || ['AuthorizationHeaderToken']
new_options = opts.merge(
:operation => :"MiscellaneousApi.render_markup",
: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: MiscellaneousApi#render_markup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end