module Substwirp
  class Badges < Substwirp::Base
    attributes :badge_type, :badge_version

    def self.get_subscriber_badge(params)
      response = twirp_client.get_subscriber_badge(
        channel_id: params[:channel_id],
        user_id: params[:user_id]
      )
      raise response.error.msg if response.error

      self.from_twirp_object(response.data)
    end
  end
end
