lib/elasticsearch/api/actions/get_source.rb in elasticsearch-api-7.6.0 vs lib/elasticsearch/api/actions/get_source.rb in elasticsearch-api-7.7.0.pre
- old
+ new
@@ -19,22 +19,25 @@
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
# @option arguments [Number] :version Explicit version number for concurrency control
# @option arguments [String] :version_type Specific version type
# (options: internal,external,external_gte,force)
+ # @option arguments [Hash] :headers Custom HTTP headers
#
# *Deprecation notice*:
# Specifying types in urls has been deprecated
# Deprecated since version 7.0.0
#
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-get.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
#
def get_source(arguments = {})
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
+ headers = arguments.delete(:headers) || {}
+
arguments = arguments.clone
_id = arguments.delete(:id)
_index = arguments.delete(:index)
@@ -48,10 +51,10 @@
"#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
end
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
body = nil
- perform_request(method, path, params, body).body
+ perform_request(method, path, params, body, headers).body
end
# Register this action with its valid params when the module is loaded.
#
# @since 6.2.0