lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -30,13 +30,21 @@
#
# @option arguments [String] :set_id The id of the synonym set to retrieve the synonym rule from
# @option arguments [String] :rule_id The id of the synonym rule to retrieve
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/get-synonym-rule.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/get-synonym-rule.html
#
def get_synonym_rule(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonym_rule" }
+
+ defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable|
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
+ set_variables
+ end
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
+
raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id]
raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -50,10 +58,10 @@
method = Elasticsearch::API::HTTP_GET
path = "_synonyms/#{Utils.__listify(_set_id)}/#{Utils.__listify(_rule_id)}"
params = {}
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end