module <%= class_name %>Item::Provided
  extend ActiveSupport::Concern

  def <%= file_name %>_provider
    return nil unless credentials_configured?

    # TODO: Implement provider instantiation
    # Provider::<%= class_name %>.new(<%= parsed_fields.select { |f| f[:secret] }.first&.dig(:name) || 'api_key' %><%= parsed_fields.select { |f| f[:default] }.any? ? ", " + parsed_fields.select { |f| f[:default] }.map { |f| "#{f[:name]}: effective_#{f[:name]}" }.join(", ") : "" %>)
    raise NotImplementedError, "Implement <%= file_name %>_provider method in #{__FILE__}"
  end
end
