Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generated code for 8.15 #2466

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions elasticsearch-api/lib/elasticsearch/api/actions/fleet/msearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ def msearch(arguments = {})
params = {}

if body.is_a?(Array) && body.any? { |d| d.has_key? :search }
payload = body
.each_with_object([]) do |item, sum|
meta = item
data = meta.delete(:search)
payload = body.each_with_object([]) do |item, sum|
meta = item
data = meta.delete(:search)

sum << meta
sum << data
end
.map { |item| Elasticsearch::API.serializer.dump(item) }
sum << meta
sum << data
end.map { |item| Elasticsearch::API.serializer.dump(item) }
payload << '' unless payload.empty?
payload = payload.join("\n")
elsif body.is_a?(Array)
Expand Down
14 changes: 6 additions & 8 deletions elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ def msearch(arguments = {})
params = Utils.process_params(arguments)

if body.is_a?(Array) && body.any? { |d| d.has_key? :search }
payload = body
.each_with_object([]) do |item, sum|
meta = item
data = meta.delete(:search)
payload = body.each_with_object([]) do |item, sum|
meta = item
data = meta.delete(:search)

sum << meta
sum << data
end
.map { |item| Elasticsearch::API.serializer.dump(item) }
sum << meta
sum << data
end.map { |item| Elasticsearch::API.serializer.dump(item) }
payload << '' unless payload.empty?
payload = payload.join("\n")
elsif body.is_a?(Array)
Expand Down
6 changes: 2 additions & 4 deletions elasticsearch-api/utils/thor/endpoint_specifics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,14 @@ def msearch_body_helper
<<~SRC
case
when body.is_a?(Array) && body.any? { |d| d.has_key? :search }
payload = body.
inject([]) do |sum, item|
payload = body.inject([]) do |sum, item|
meta = item
data = meta.delete(:search)

sum << meta
sum << data
sum
end.
map { |item| Elasticsearch::API.serializer.dump(item) }
end.map { |item| Elasticsearch::API.serializer.dump(item) }
payload << "" unless payload.empty?
payload = payload.join("\\n")
when body.is_a?(Array)
Expand Down