# frozen_string_literal: true

require_relative "synor_storage/version"
require_relative "synor_storage/types"
require_relative "synor_storage/client"

# Synor Storage SDK for Ruby
#
# Decentralized storage operations including upload, download, pinning, and directory management.
#
# @example Quick Start
#   require 'synor_storage'
#
#   # Create client
#   client = SynorStorage::Client.new(api_key: 'your-api-key')
#
#   # Upload a file
#   result = client.upload(File.read('document.pdf'), name: 'document.pdf')
#   puts "CID: #{result.cid}"
#
#   # Download a file
#   data = client.download(result.cid)
#   File.write('downloaded.pdf', data)
#
#   # Get gateway URL
#   url = client.get_gateway_url(result.cid)
#   puts "URL: #{url}"
#
module SynorStorage
  class Error < StandardError; end
  class ApiError < Error
    attr_reader :status_code

    def initialize(message, status_code: nil)
      super(message)
      @status_code = status_code
    end
  end
  class ClientClosedError < Error; end
end
