def build_params_for(param_type)
      return {} if @request.operations.empty?

      keys = %i(attributes to_one to_many)
      operation = @request.operations.find { |e| e.options[:data].keys & keys == keys }

      if operation.nil?
        {}
      elsif param_type == :relationship
        operation.options[:data].values_at(:to_one, :to_many).compact.reduce(&:merge)
      else
        operation.options[:data][:attributes]
      end
    end
def build_params_for(param_type)
      return {} if @request.operations.empty?

      keys = %i(attributes to_one to_many)
      operation = @request.operations.find { |e| e.options[:data].keys & keys == keys }

      if operation.nil?
        {}
      elsif param_type == :relationship
        operation.options[:data].values_at(:to_one, :to_many).compact.reduce(&:merge)
      else
        operation.options[:data][:attributes]
      end
    end
Extract params from request and build a Hash with params
 for either the main resource or relationships.

 @return [Hash]

 @api private