#!/usr/bin/ruby.ruby3.4 
$LOAD_PATH << File.join(__dir__, "lib")
require "forgejo"

Forgejo.configure do |config|
  config.scheme = "https"
  config.host = "codeberg.org"
  config.base_path = "/api/v1/"
  config.api_key["Authorization"] = ENV["TOKEN"] # note that token must have "token " prefixed
  config.configure_faraday_connection do |conn|
    conn.response :logger, nil, headers: true, bodies: false, log_level: :debug
  end
end

api = Forgejo::UserApi.new
pp api.user_get("gemmaro")
