docs/PackageApi

Forgejo::PackageApi

All URIs are relative to /api/v1

Method HTTP request Description
delete_package DELETE /packages/{owner}/{type}/{name}/{version} Delete a package
get_package GET /packages/{owner}/{type}/{name}/{version} Gets a package
list_package_files GET /packages/{owner}/{type}/{name}/{version}/files Gets all files of a package
list_packages GET /packages/{owner} Gets all packages of an owner

delete_package

> delete_package(owner, type, name, version)

Delete a package

Examples

require 'time'
require 'forgejo'
# setup authorization
Forgejo.configure do |config|
  # Configure API key authorization: AuthorizationHeaderToken
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Forgejo::PackageApi.new
owner = 'owner_example' # String | owner of the package
type = 'type_example' # String | type of the package
name = 'name_example' # String | name of the package
version = 'version_example' # String | version of the package

begin
  # Delete a package
  api_instance.delete_package(owner, type, name, version)
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->delete_package: #{e}"
end

Using the delete_package_with_http_info variant

This returns an Array which contains the response data (nil in this case), status code and headers.

> delete_package_with_http_info(owner, type, name, version)

begin
  # Delete a package
  data, status_code, headers = api_instance.delete_package_with_http_info(owner, type, name, version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => nil
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->delete_package_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
owner String owner of the package
type String type of the package
name String name of the package
version String version of the package

Return type

nil (empty response body)

Authorization

AuthorizationHeaderToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/html

get_package

> get_package(owner, type, name, version)

Gets a package

Examples

require 'time'
require 'forgejo'
# setup authorization
Forgejo.configure do |config|
  # Configure API key authorization: AuthorizationHeaderToken
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Forgejo::PackageApi.new
owner = 'owner_example' # String | owner of the package
type = 'type_example' # String | type of the package
name = 'name_example' # String | name of the package
version = 'version_example' # String | version of the package

begin
  # Gets a package
  result = api_instance.get_package(owner, type, name, version)
  p result
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->get_package: #{e}"
end

Using the get_package_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> , Integer, Hash)> get_package_with_http_info(owner, type, name, version)

begin
  # Gets a package
  data, status_code, headers = api_instance.get_package_with_http_info(owner, type, name, version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => 
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->get_package_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
owner String owner of the package
type String type of the package
name String name of the package
version String version of the package

Return type

Package

Authorization

AuthorizationHeaderToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_package_files

> > list_package_files(owner, type, name, version)

Gets all files of a package

Examples

require 'time'
require 'forgejo'
# setup authorization
Forgejo.configure do |config|
  # Configure API key authorization: AuthorizationHeaderToken
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Forgejo::PackageApi.new
owner = 'owner_example' # String | owner of the package
type = 'type_example' # String | type of the package
name = 'name_example' # String | name of the package
version = 'version_example' # String | version of the package

begin
  # Gets all files of a package
  result = api_instance.list_package_files(owner, type, name, version)
  p result
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->list_package_files: #{e}"
end

Using the list_package_files_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> >, Integer, Hash)> list_package_files_with_http_info(owner, type, name, version)

begin
  # Gets all files of a package
  data, status_code, headers = api_instance.list_package_files_with_http_info(owner, type, name, version)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => >
rescue Forgejo::ApiError => e
  puts "Error when calling PackageApi->list_package_files_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
owner String owner of the package
type String type of the package
name String name of the package
version String version of the package

Return type

Array<PackageFile>

Authorization

AuthorizationHeaderToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

list_packages

> > list_packages(owner, opts)

Gets all packages of an owner

Examples

require 'time'
require 'forgejo'
# setup authorization
Forgejo.configure do |config|
  # Configure API key authorization: AuthorizationHeaderToken
  config.api_key['Authorization'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['Authorization'] = 'Bearer'
end

api_instance = Forgejo::PackageApi.new
owner = 'owner_example' # String | owner of the packages
opts = {
  page: 56, # Integer | page number of results to return (1-based)
  limit: 56, # Integer | page size of results
  type: 'alpine', # String | package type filter
  q: 'q_example' # String | name filter
}

begin
  # Gets all packages of an owner
  result = api_instance.list_packages(owner, opts)
  p result
rescue Forgejo::ApiError =&gt; e
  puts "Error when calling PackageApi-&gt;list_packages: #{e}"
end

Using the list_packages_with_http_info variant

This returns an Array which contains the response data, status code and headers.

> >, Integer, Hash)> list_packages_with_http_info(owner, opts)

begin
  # Gets all packages of an owner
  data, status_code, headers = api_instance.list_packages_with_http_info(owner, opts)
  p status_code # =&gt; 2xx
  p headers # =&gt; { ... }
  p data # =&gt; &gt;
rescue Forgejo::ApiError =&gt; e
  puts "Error when calling PackageApi-&gt;list_packages_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
owner String owner of the packages
page Integer page number of results to return (1-based) [optional]
limit Integer page size of results [optional]
type String package type filter [optional]
q String name filter [optional]

Return type

Array<Package>

Authorization

AuthorizationHeaderToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json