class Gitea::Repository::DeleteService < Gitea::ClientService
  attr_reader :user, :repo_name, :token

  def initialize(user, repo_name, token=nil)
    @user = user
    @repo_name = repo_name
    @token = token
  end

  def call
    delete(url, params, true)
  end

  private

  def params
    Hash.new.merge(token: token)
  end

  def url
    "/repos/#{user.login}/#{repo_name}".freeze
  end
end
