lib/elasticsearch/api/actions/transform/get_transform.rb in elasticsearch-api-8.12.2 vs lib/elasticsearch/api/actions/transform/get_transform.rb in elasticsearch-api-8.13.0
- old
+ new
@@ -29,18 +29,17 @@
# @option arguments [Integer] :size specifies a max number of transforms to get, defaults to 100
# @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)
# @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on transform PUT
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.12/get-transform.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.13/get-transform.html
#
def get_transform(arguments = {})
- request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform" }
+ request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform' }
- defined_params = [:transform_id].inject({}) do |set_variables, variable|
+ defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
set_variables[variable] = arguments[variable] if arguments.key?(variable)
- set_variables
end
request_opts[:defined_params] = defined_params unless defined_params.empty?
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -51,10 +50,10 @@
method = Elasticsearch::API::HTTP_GET
path = if _transform_id
"_transform/#{Utils.__listify(_transform_id)}"
else
- "_transform"
+ '_transform'
end
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)