lib/elasticsearch/api/actions/machine_learning/get_calendars.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/machine_learning/get_calendars.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -28,13 +28,21 @@
# @option arguments [Integer] :from skips a number of calendars
# @option arguments [Integer] :size specifies a max number of calendars to get
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body The from and size parameters optionally sent in the body
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/ml-get-calendar.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/ml-get-calendar.html
#
def get_calendars(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "ml.get_calendars" }
+
+ defined_params = [:calendar_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?
+
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
body = arguments.delete(:body)
@@ -52,10 +60,10 @@
"_ml/calendars"
end
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end