diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb deleted file mode 100644 index 145194db14..0000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Updates the stats of last sync in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Object with stats related to the last connector sync run. (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.19/update-connector-last-sync-api.html - # - def last_sync(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.last_sync' } - - defined_params = [:connector_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _connector_id = arguments.delete(:connector_id) - - method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_last_sync" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb index b4c1468f30..0ded8efd98 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb @@ -22,7 +22,7 @@ module Elasticsearch module API module Watcher module Actions - # Creates a new watch, or updates an existing one. + # Create or update a watch # # @option arguments [String] :id Watch ID # @option arguments [Boolean] :active Specify whether the watch is in/active by default @@ -30,9 +30,9 @@ module Actions # @option arguments [Number] :if_seq_no only update the watch if the last operation that has changed the watch has the specified sequence number # @option arguments [Number] :if_primary_term only update the watch if the last operation that has changed the watch has the specified primary term # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The watch + # @option arguments [Hash] :body The watch (*Required*) # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.19/watcher-api-put-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-watcher-put-watch # def put_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.put_watch' } @@ -42,6 +42,7 @@ def put_watch(arguments = {}) end request_opts[:defined_params] = defined_params unless defined_params.empty? + raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/connector/last_sync_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/connector/last_sync_spec.rb deleted file mode 100644 index 68cb2b635e..0000000000 --- a/elasticsearch-api/spec/elasticsearch/api/actions/connector/last_sync_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Licensed to Elasticsearch B.V. under one or more contributor -# license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright -# ownership. Elasticsearch B.V. licenses this file to you under -# the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -require 'spec_helper' - -describe 'client.connector#last_sync' do - let(:expected_args) do - [ - 'PUT', - '_connector/foo/_last_sync', - {}, - {}, - {}, - { - :defined_params=>{ connector_id: 'foo' }, - endpoint: 'connector.last_sync' - } - ] - end - - it 'performs the request' do - expect(client_double.connector.last_sync(connector_id: 'foo', body: {})).to be_a Elasticsearch::API::Response - end -end