# frozen_string_literal: true

class SerializableBroadcast < JSONAPI::Serializable::Resource
  type 'broadcast'

  %i[name status stream_server_url stream_key project_id streamer_status created_at].each do |key|
    attribute key
  end

  has_many :files do
    data do
      @object.files
    end
    meta do
      { count: @object.files.size }
    end
  end
end
