diff --git a/api_generator/lib/generators/action_generator.rb b/api_generator/lib/generators/action_generator.rb index 372c4d826..b94234c32 100644 --- a/api_generator/lib/generators/action_generator.rb +++ b/api_generator/lib/generators/action_generator.rb @@ -46,6 +46,10 @@ def url api_path.build end + def has_query + @action.query_params.any? + end + def http_verb case @action.http_verbs.sort when %w[GET POST] diff --git a/api_generator/lib/templates/action.mustache b/api_generator/lib/templates/action.mustache index 2d3425866..d590c7c42 100644 --- a/api_generator/lib/templates/action.mustache +++ b/api_generator/lib/templates/action.mustache @@ -47,15 +47,17 @@ module OpenSearch method = {{{http_verb}}} url = {{{url}}} - Utils.validate_query_params args, {{valid_params_constant_name}} + Utils.validate_query_params args{{#has_query}}, {{valid_params_constant_name}}{{/has_query}} {{{perform_request}}} end + {{#has_query}} {{{valid_params_constant_name}}} = Set.new(%w[ {{#query_params}} {{{name}}} {{/query_params}} ]).freeze + {{/has_query}} end end end diff --git a/lib/opensearch/api/actions/asynchronous_search/delete.rb b/lib/opensearch/api/actions/asynchronous_search/delete.rb index dddb763f3..2d27a0c80 100644 --- a/lib/opensearch/api/actions/asynchronous_search/delete.rb +++ b/lib/opensearch/api/actions/asynchronous_search/delete.rb @@ -29,12 +29,9 @@ def delete(args = {}) method = 'DELETE' url = ['_plugins/_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/asynchronous_search/get.rb b/lib/opensearch/api/actions/asynchronous_search/get.rb index 6dff2ba71..7a1fdbe6a 100644 --- a/lib/opensearch/api/actions/asynchronous_search/get.rb +++ b/lib/opensearch/api/actions/asynchronous_search/get.rb @@ -27,12 +27,9 @@ def get(args = {}) method = 'GET' url = ['_plugins/_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/asynchronous_search/stats.rb b/lib/opensearch/api/actions/asynchronous_search/stats.rb index 59c0e2aab..9a5e29856 100644 --- a/lib/opensearch/api/actions/asynchronous_search/stats.rb +++ b/lib/opensearch/api/actions/asynchronous_search/stats.rb @@ -22,12 +22,9 @@ def stats(args = {}) method = 'GET' url = '_plugins/_asynchronous_search/stats' - Utils.validate_query_params args, STATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cat/help.rb b/lib/opensearch/api/actions/cat/help.rb index 666be05a4..285fe44a1 100644 --- a/lib/opensearch/api/actions/cat/help.rb +++ b/lib/opensearch/api/actions/cat/help.rb @@ -22,12 +22,9 @@ def help(args = {}) method = 'GET' url = '_cat' - Utils.validate_query_params args, HELP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - HELP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/clear_scroll.rb b/lib/opensearch/api/actions/clear_scroll.rb index 5168d86f2..f2926607c 100644 --- a/lib/opensearch/api/actions/clear_scroll.rb +++ b/lib/opensearch/api/actions/clear_scroll.rb @@ -28,12 +28,9 @@ def clear_scroll(args = {}) method = 'DELETE' url = ['_search/scroll', _scroll_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CLEAR_SCROLL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - CLEAR_SCROLL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb index 37c1c565c..3844673b2 100644 --- a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb @@ -24,12 +24,9 @@ def delete_decommission_awareness(args = {}) method = 'DELETE' url = '_cluster/decommission/awareness' - Utils.validate_query_params args, DELETE_DECOMMISSION_AWARENESS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_DECOMMISSION_AWARENESS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb b/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb index c58e68d2a..e333c0375 100644 --- a/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb @@ -25,12 +25,9 @@ def delete_weighted_routing(args = {}) method = 'DELETE' url = '_cluster/routing/awareness/weights' - Utils.validate_query_params args, DELETE_WEIGHTED_ROUTING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_WEIGHTED_ROUTING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb index 710acacf0..72b10cc90 100644 --- a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb @@ -27,12 +27,9 @@ def get_decommission_awareness(args = {}) method = 'GET' url = ['_cluster/decommission/awareness', _awareness_attribute_name, '_status'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_DECOMMISSION_AWARENESS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_DECOMMISSION_AWARENESS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb index 93df34b7c..8c77491e7 100644 --- a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb @@ -27,12 +27,9 @@ def get_weighted_routing(args = {}) method = 'GET' url = ['_cluster/routing/awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_WEIGHTED_ROUTING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_WEIGHTED_ROUTING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb index f252e7d5e..e131a93a3 100644 --- a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb @@ -30,12 +30,9 @@ def put_decommission_awareness(args = {}) method = 'PUT' url = ['_cluster/decommission/awareness', _awareness_attribute_name, _awareness_attribute_value].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PUT_DECOMMISSION_AWARENESS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PUT_DECOMMISSION_AWARENESS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb index ca67baae1..6ea02abc0 100644 --- a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb @@ -28,12 +28,9 @@ def put_weighted_routing(args = {}) method = 'PUT' url = ['_cluster/routing/awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PUT_WEIGHTED_ROUTING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PUT_WEIGHTED_ROUTING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/cluster/remote_info.rb b/lib/opensearch/api/actions/cluster/remote_info.rb index c329286c5..250ef1190 100644 --- a/lib/opensearch/api/actions/cluster/remote_info.rb +++ b/lib/opensearch/api/actions/cluster/remote_info.rb @@ -22,12 +22,9 @@ def remote_info(args = {}) method = 'GET' url = '_remote/info' - Utils.validate_query_params args, REMOTE_INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REMOTE_INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb b/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb index 024f00733..3696e9338 100644 --- a/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb +++ b/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb @@ -22,12 +22,9 @@ def list_dangling_indices(args = {}) method = 'GET' url = '_dangling' - Utils.validate_query_params args, LIST_DANGLING_INDICES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - LIST_DANGLING_INDICES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/delete_all_pits.rb b/lib/opensearch/api/actions/delete_all_pits.rb index be6009475..581164118 100644 --- a/lib/opensearch/api/actions/delete_all_pits.rb +++ b/lib/opensearch/api/actions/delete_all_pits.rb @@ -24,12 +24,9 @@ def delete_all_pits(args = {}) method = 'DELETE' url = '_search/point_in_time/_all' - Utils.validate_query_params args, DELETE_ALL_PITS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_ALL_PITS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/delete_pit.rb b/lib/opensearch/api/actions/delete_pit.rb index 74976244f..24f821967 100644 --- a/lib/opensearch/api/actions/delete_pit.rb +++ b/lib/opensearch/api/actions/delete_pit.rb @@ -25,12 +25,9 @@ def delete_pit(args = {}) method = 'DELETE' url = '_search/point_in_time' - Utils.validate_query_params args, DELETE_PIT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_PIT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/flow_framework/get.rb b/lib/opensearch/api/actions/flow_framework/get.rb index 62fdbfd91..90de1bc38 100644 --- a/lib/opensearch/api/actions/flow_framework/get.rb +++ b/lib/opensearch/api/actions/flow_framework/get.rb @@ -27,12 +27,9 @@ def get(args = {}) method = 'GET' url = ['_plugins/_flow_framework/workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/flow_framework/provision.rb b/lib/opensearch/api/actions/flow_framework/provision.rb index 7134da62a..2a4776cab 100644 --- a/lib/opensearch/api/actions/flow_framework/provision.rb +++ b/lib/opensearch/api/actions/flow_framework/provision.rb @@ -28,12 +28,9 @@ def provision(args = {}) method = 'POST' url = ['_plugins/_flow_framework/workflow', _workflow_id, '_provision'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PROVISION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PROVISION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/flow_framework/search.rb b/lib/opensearch/api/actions/flow_framework/search.rb index def6cf9fa..60083c868 100644 --- a/lib/opensearch/api/actions/flow_framework/search.rb +++ b/lib/opensearch/api/actions/flow_framework/search.rb @@ -25,12 +25,9 @@ def search(args = {}) method = body ? 'POST' : 'GET' url = '_plugins/_flow_framework/workflow/_search' - Utils.validate_query_params args, SEARCH_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - SEARCH_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/flow_framework/search_state.rb b/lib/opensearch/api/actions/flow_framework/search_state.rb index c021695c2..9e666ad79 100644 --- a/lib/opensearch/api/actions/flow_framework/search_state.rb +++ b/lib/opensearch/api/actions/flow_framework/search_state.rb @@ -25,12 +25,9 @@ def search_state(args = {}) method = body ? 'POST' : 'GET' url = '_plugins/_flow_framework/workflow/state/_search' - Utils.validate_query_params args, SEARCH_STATE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - SEARCH_STATE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/get_all_pits.rb b/lib/opensearch/api/actions/get_all_pits.rb index 028ca7bdf..0fc3a340a 100644 --- a/lib/opensearch/api/actions/get_all_pits.rb +++ b/lib/opensearch/api/actions/get_all_pits.rb @@ -22,12 +22,9 @@ def get_all_pits(args = {}) method = 'GET' url = '_search/point_in_time/_all' - Utils.validate_query_params args, GET_ALL_PITS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ALL_PITS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/get_script_context.rb b/lib/opensearch/api/actions/get_script_context.rb index d847c2436..a506e3422 100644 --- a/lib/opensearch/api/actions/get_script_context.rb +++ b/lib/opensearch/api/actions/get_script_context.rb @@ -22,12 +22,9 @@ def get_script_context(args = {}) method = 'GET' url = '_script_context' - Utils.validate_query_params args, GET_SCRIPT_CONTEXT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_SCRIPT_CONTEXT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/get_script_languages.rb b/lib/opensearch/api/actions/get_script_languages.rb index 217c71d73..cd15e0a83 100644 --- a/lib/opensearch/api/actions/get_script_languages.rb +++ b/lib/opensearch/api/actions/get_script_languages.rb @@ -22,12 +22,9 @@ def get_script_languages(args = {}) method = 'GET' url = '_script_language' - Utils.validate_query_params args, GET_SCRIPT_LANGUAGES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_SCRIPT_LANGUAGES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/indices/analyze.rb b/lib/opensearch/api/actions/indices/analyze.rb index 330272f33..406c99986 100644 --- a/lib/opensearch/api/actions/indices/analyze.rb +++ b/lib/opensearch/api/actions/indices/analyze.rb @@ -26,12 +26,9 @@ def analyze(args = {}) method = body ? 'POST' : 'GET' url = [_index, '_analyze'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, ANALYZE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - ANALYZE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/indices/create_data_stream.rb b/lib/opensearch/api/actions/indices/create_data_stream.rb index 5bd0a5015..09165bcf9 100644 --- a/lib/opensearch/api/actions/indices/create_data_stream.rb +++ b/lib/opensearch/api/actions/indices/create_data_stream.rb @@ -28,12 +28,9 @@ def create_data_stream(args = {}) method = 'PUT' url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_DATA_STREAM_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_DATA_STREAM_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/indices/data_streams_stats.rb b/lib/opensearch/api/actions/indices/data_streams_stats.rb index 0798a4d75..5e41a8a0c 100644 --- a/lib/opensearch/api/actions/indices/data_streams_stats.rb +++ b/lib/opensearch/api/actions/indices/data_streams_stats.rb @@ -25,12 +25,9 @@ def data_streams_stats(args = {}) method = 'GET' url = ['_data_stream', _name, '_stats'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DATA_STREAMS_STATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DATA_STREAMS_STATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/indices/delete_data_stream.rb b/lib/opensearch/api/actions/indices/delete_data_stream.rb index 3be7eb1d4..7e89fee37 100644 --- a/lib/opensearch/api/actions/indices/delete_data_stream.rb +++ b/lib/opensearch/api/actions/indices/delete_data_stream.rb @@ -29,12 +29,9 @@ def delete_data_stream(args = {}) method = 'DELETE' url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_DATA_STREAM_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_DATA_STREAM_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/indices/get_data_stream.rb b/lib/opensearch/api/actions/indices/get_data_stream.rb index 9a2793fef..72670b113 100644 --- a/lib/opensearch/api/actions/indices/get_data_stream.rb +++ b/lib/opensearch/api/actions/indices/get_data_stream.rb @@ -25,12 +25,9 @@ def get_data_stream(args = {}) method = 'GET' url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_DATA_STREAM_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_DATA_STREAM_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/info.rb b/lib/opensearch/api/actions/info.rb index a413b6f7e..6d6893479 100644 --- a/lib/opensearch/api/actions/info.rb +++ b/lib/opensearch/api/actions/info.rb @@ -22,12 +22,9 @@ def info(args = {}) method = 'GET' url = '/' - Utils.validate_query_params args, INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/add_policy.rb b/lib/opensearch/api/actions/ism/add_policy.rb index f6a32b2fb..b8140e85f 100644 --- a/lib/opensearch/api/actions/ism/add_policy.rb +++ b/lib/opensearch/api/actions/ism/add_policy.rb @@ -28,12 +28,9 @@ def add_policy(args = {}) method = 'POST' url = ['_plugins/_ism/add', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, ADD_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - ADD_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/change_policy.rb b/lib/opensearch/api/actions/ism/change_policy.rb index e08f5b6f5..2780051c8 100644 --- a/lib/opensearch/api/actions/ism/change_policy.rb +++ b/lib/opensearch/api/actions/ism/change_policy.rb @@ -28,12 +28,9 @@ def change_policy(args = {}) method = 'POST' url = ['_plugins/_ism/change_policy', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CHANGE_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CHANGE_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/delete_policy.rb b/lib/opensearch/api/actions/ism/delete_policy.rb index a6cff1d4e..f7d056ccb 100644 --- a/lib/opensearch/api/actions/ism/delete_policy.rb +++ b/lib/opensearch/api/actions/ism/delete_policy.rb @@ -29,12 +29,9 @@ def delete_policy(args = {}) method = 'DELETE' url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/exists_policy.rb b/lib/opensearch/api/actions/ism/exists_policy.rb index 397de4509..138a5ba72 100644 --- a/lib/opensearch/api/actions/ism/exists_policy.rb +++ b/lib/opensearch/api/actions/ism/exists_policy.rb @@ -27,12 +27,9 @@ def exists_policy(args = {}) method = 'HEAD' url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, EXISTS_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_head_request method, url, args, body, headers end - - EXISTS_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/explain_policy.rb b/lib/opensearch/api/actions/ism/explain_policy.rb index 5b01fed2c..1fe573b4b 100644 --- a/lib/opensearch/api/actions/ism/explain_policy.rb +++ b/lib/opensearch/api/actions/ism/explain_policy.rb @@ -26,12 +26,9 @@ def explain_policy(args = {}) method = body ? 'POST' : 'GET' url = ['_plugins/_ism/explain', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, EXPLAIN_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - EXPLAIN_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/get_policies.rb b/lib/opensearch/api/actions/ism/get_policies.rb index 738542be3..545c9b64a 100644 --- a/lib/opensearch/api/actions/ism/get_policies.rb +++ b/lib/opensearch/api/actions/ism/get_policies.rb @@ -22,12 +22,9 @@ def get_policies(args = {}) method = 'GET' url = '_plugins/_ism/policies' - Utils.validate_query_params args, GET_POLICIES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_POLICIES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/get_policy.rb b/lib/opensearch/api/actions/ism/get_policy.rb index 41463eb73..6bf8c3a5a 100644 --- a/lib/opensearch/api/actions/ism/get_policy.rb +++ b/lib/opensearch/api/actions/ism/get_policy.rb @@ -27,12 +27,9 @@ def get_policy(args = {}) method = 'GET' url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb index eb4ca1d4f..48ab5f669 100644 --- a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb +++ b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb @@ -27,12 +27,9 @@ def refresh_search_analyzers(args = {}) method = 'POST' url = ['_plugins/_refresh_search_analyzers', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, REFRESH_SEARCH_ANALYZERS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REFRESH_SEARCH_ANALYZERS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/remove_policy.rb b/lib/opensearch/api/actions/ism/remove_policy.rb index 0e8c088f0..31ce05042 100644 --- a/lib/opensearch/api/actions/ism/remove_policy.rb +++ b/lib/opensearch/api/actions/ism/remove_policy.rb @@ -27,12 +27,9 @@ def remove_policy(args = {}) method = 'POST' url = ['_plugins/_ism/remove', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, REMOVE_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REMOVE_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ism/retry_index.rb b/lib/opensearch/api/actions/ism/retry_index.rb index 77bfe848b..946744f56 100644 --- a/lib/opensearch/api/actions/ism/retry_index.rb +++ b/lib/opensearch/api/actions/ism/retry_index.rb @@ -28,12 +28,9 @@ def retry_index(args = {}) method = 'POST' url = ['_plugins/_ism/retry', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, RETRY_INDEX_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - RETRY_INDEX_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/knn/delete_model.rb b/lib/opensearch/api/actions/knn/delete_model.rb index 40b42b6f1..c5966be79 100644 --- a/lib/opensearch/api/actions/knn/delete_model.rb +++ b/lib/opensearch/api/actions/knn/delete_model.rb @@ -29,12 +29,9 @@ def delete_model(args = {}) method = 'DELETE' url = ['_plugins/_knn/models', _model_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/knn/get_model.rb b/lib/opensearch/api/actions/knn/get_model.rb index 7c44ee876..f67278bd4 100644 --- a/lib/opensearch/api/actions/knn/get_model.rb +++ b/lib/opensearch/api/actions/knn/get_model.rb @@ -27,12 +27,9 @@ def get_model(args = {}) method = 'GET' url = ['_plugins/_knn/models', _model_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/knn/warmup.rb b/lib/opensearch/api/actions/knn/warmup.rb index 6253b7479..47e807124 100644 --- a/lib/opensearch/api/actions/knn/warmup.rb +++ b/lib/opensearch/api/actions/knn/warmup.rb @@ -27,12 +27,9 @@ def warmup(args = {}) method = 'GET' url = ['_plugins/_knn/warmup', _index].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, WARMUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - WARMUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/list/help.rb b/lib/opensearch/api/actions/list/help.rb index 51ffd3079..39daf1ffa 100644 --- a/lib/opensearch/api/actions/list/help.rb +++ b/lib/opensearch/api/actions/list/help.rb @@ -22,12 +22,9 @@ def help(args = {}) method = 'GET' url = '_list' - Utils.validate_query_params args, HELP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - HELP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/create_connector.rb b/lib/opensearch/api/actions/ml/create_connector.rb index 0f8924af8..b3134a8cf 100644 --- a/lib/opensearch/api/actions/ml/create_connector.rb +++ b/lib/opensearch/api/actions/ml/create_connector.rb @@ -23,12 +23,9 @@ def create_connector(args = {}) method = 'POST' url = '_plugins/_ml/connectors/_create' - Utils.validate_query_params args, CREATE_CONNECTOR_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_CONNECTOR_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/delete_agent.rb b/lib/opensearch/api/actions/ml/delete_agent.rb index 373128865..a91b2e7ef 100644 --- a/lib/opensearch/api/actions/ml/delete_agent.rb +++ b/lib/opensearch/api/actions/ml/delete_agent.rb @@ -29,12 +29,9 @@ def delete_agent(args = {}) method = 'DELETE' url = ['_plugins/_ml/agents', _agent_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_AGENT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_AGENT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/delete_connector.rb b/lib/opensearch/api/actions/ml/delete_connector.rb index 44c1a2c1e..a53a96d08 100644 --- a/lib/opensearch/api/actions/ml/delete_connector.rb +++ b/lib/opensearch/api/actions/ml/delete_connector.rb @@ -29,12 +29,9 @@ def delete_connector(args = {}) method = 'DELETE' url = ['_plugins/_ml/connectors', _connector_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_CONNECTOR_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_CONNECTOR_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/delete_model.rb b/lib/opensearch/api/actions/ml/delete_model.rb index a8e30c831..f0e9a4f5a 100644 --- a/lib/opensearch/api/actions/ml/delete_model.rb +++ b/lib/opensearch/api/actions/ml/delete_model.rb @@ -29,12 +29,9 @@ def delete_model(args = {}) method = 'DELETE' url = ['_plugins/_ml/models', _model_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/delete_model_group.rb b/lib/opensearch/api/actions/ml/delete_model_group.rb index 8c3285d19..e2df59500 100644 --- a/lib/opensearch/api/actions/ml/delete_model_group.rb +++ b/lib/opensearch/api/actions/ml/delete_model_group.rb @@ -29,12 +29,9 @@ def delete_model_group(args = {}) method = 'DELETE' url = ['_plugins/_ml/model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_MODEL_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_MODEL_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/delete_task.rb b/lib/opensearch/api/actions/ml/delete_task.rb index b6450646a..7f17fb5e6 100644 --- a/lib/opensearch/api/actions/ml/delete_task.rb +++ b/lib/opensearch/api/actions/ml/delete_task.rb @@ -29,12 +29,9 @@ def delete_task(args = {}) method = 'DELETE' url = ['_plugins/_ml/tasks', _task_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_TASK_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_TASK_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/deploy_model.rb b/lib/opensearch/api/actions/ml/deploy_model.rb index 484fcdbc0..0eb6efa0b 100644 --- a/lib/opensearch/api/actions/ml/deploy_model.rb +++ b/lib/opensearch/api/actions/ml/deploy_model.rb @@ -27,12 +27,9 @@ def deploy_model(args = {}) method = 'POST' url = ['_plugins/_ml/models', _model_id, '_deploy'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DEPLOY_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DEPLOY_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/get_model_group.rb b/lib/opensearch/api/actions/ml/get_model_group.rb index 8419c25b3..7790dd648 100644 --- a/lib/opensearch/api/actions/ml/get_model_group.rb +++ b/lib/opensearch/api/actions/ml/get_model_group.rb @@ -27,12 +27,9 @@ def get_model_group(args = {}) method = 'GET' url = ['_plugins/_ml/model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_MODEL_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_MODEL_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/get_task.rb b/lib/opensearch/api/actions/ml/get_task.rb index 490c76611..5b8a722a4 100644 --- a/lib/opensearch/api/actions/ml/get_task.rb +++ b/lib/opensearch/api/actions/ml/get_task.rb @@ -27,12 +27,9 @@ def get_task(args = {}) method = 'GET' url = ['_plugins/_ml/tasks', _task_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_TASK_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_TASK_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/register_agents.rb b/lib/opensearch/api/actions/ml/register_agents.rb index 64d97cce4..4e2cb92cd 100644 --- a/lib/opensearch/api/actions/ml/register_agents.rb +++ b/lib/opensearch/api/actions/ml/register_agents.rb @@ -23,12 +23,9 @@ def register_agents(args = {}) method = 'POST' url = '_plugins/_ml/agents/_register' - Utils.validate_query_params args, REGISTER_AGENTS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REGISTER_AGENTS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/register_model.rb b/lib/opensearch/api/actions/ml/register_model.rb index a3276d92a..db71b3596 100644 --- a/lib/opensearch/api/actions/ml/register_model.rb +++ b/lib/opensearch/api/actions/ml/register_model.rb @@ -23,12 +23,9 @@ def register_model(args = {}) method = 'POST' url = '_plugins/_ml/models/_register' - Utils.validate_query_params args, REGISTER_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REGISTER_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/register_model_group.rb b/lib/opensearch/api/actions/ml/register_model_group.rb index 01cdb6d89..9436202b0 100644 --- a/lib/opensearch/api/actions/ml/register_model_group.rb +++ b/lib/opensearch/api/actions/ml/register_model_group.rb @@ -23,12 +23,9 @@ def register_model_group(args = {}) method = 'POST' url = '_plugins/_ml/model_groups/_register' - Utils.validate_query_params args, REGISTER_MODEL_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - REGISTER_MODEL_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/search_models.rb b/lib/opensearch/api/actions/ml/search_models.rb index e7aeb73cc..f4a8e4e61 100644 --- a/lib/opensearch/api/actions/ml/search_models.rb +++ b/lib/opensearch/api/actions/ml/search_models.rb @@ -23,12 +23,9 @@ def search_models(args = {}) method = 'GET' url = '_plugins/_ml/models/_search' - Utils.validate_query_params args, SEARCH_MODELS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - SEARCH_MODELS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ml/undeploy_model.rb b/lib/opensearch/api/actions/ml/undeploy_model.rb index cac146047..12f1fa17f 100644 --- a/lib/opensearch/api/actions/ml/undeploy_model.rb +++ b/lib/opensearch/api/actions/ml/undeploy_model.rb @@ -27,12 +27,9 @@ def undeploy_model(args = {}) method = 'POST' url = ['_plugins/_ml/models', _model_id, '_undeploy'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UNDEPLOY_MODEL_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UNDEPLOY_MODEL_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/create_config.rb b/lib/opensearch/api/actions/notifications/create_config.rb index 77bed06cb..e24a1c8ae 100644 --- a/lib/opensearch/api/actions/notifications/create_config.rb +++ b/lib/opensearch/api/actions/notifications/create_config.rb @@ -25,12 +25,9 @@ def create_config(args = {}) method = 'POST' url = '_plugins/_notifications/configs' - Utils.validate_query_params args, CREATE_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/delete_config.rb b/lib/opensearch/api/actions/notifications/delete_config.rb index cc1cf243d..d7190d229 100644 --- a/lib/opensearch/api/actions/notifications/delete_config.rb +++ b/lib/opensearch/api/actions/notifications/delete_config.rb @@ -29,12 +29,9 @@ def delete_config(args = {}) method = 'DELETE' url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/get_config.rb b/lib/opensearch/api/actions/notifications/get_config.rb index ae8939312..046cbf384 100644 --- a/lib/opensearch/api/actions/notifications/get_config.rb +++ b/lib/opensearch/api/actions/notifications/get_config.rb @@ -27,12 +27,9 @@ def get_config(args = {}) method = 'GET' url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/list_channels.rb b/lib/opensearch/api/actions/notifications/list_channels.rb index 2548b1a56..ecff3a4d3 100644 --- a/lib/opensearch/api/actions/notifications/list_channels.rb +++ b/lib/opensearch/api/actions/notifications/list_channels.rb @@ -22,12 +22,9 @@ def list_channels(args = {}) method = 'GET' url = '_plugins/_notifications/channels' - Utils.validate_query_params args, LIST_CHANNELS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - LIST_CHANNELS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/list_features.rb b/lib/opensearch/api/actions/notifications/list_features.rb index ec2b57421..8c5b7c6ed 100644 --- a/lib/opensearch/api/actions/notifications/list_features.rb +++ b/lib/opensearch/api/actions/notifications/list_features.rb @@ -22,12 +22,9 @@ def list_features(args = {}) method = 'GET' url = '_plugins/_notifications/features' - Utils.validate_query_params args, LIST_FEATURES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - LIST_FEATURES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/send_test.rb b/lib/opensearch/api/actions/notifications/send_test.rb index 06f380f6a..686b39902 100644 --- a/lib/opensearch/api/actions/notifications/send_test.rb +++ b/lib/opensearch/api/actions/notifications/send_test.rb @@ -27,12 +27,9 @@ def send_test(args = {}) method = body ? 'POST' : 'GET' url = ['_plugins/_notifications/feature/test', _config_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, SEND_TEST_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - SEND_TEST_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/notifications/update_config.rb b/lib/opensearch/api/actions/notifications/update_config.rb index b8407962f..0ed1b027e 100644 --- a/lib/opensearch/api/actions/notifications/update_config.rb +++ b/lib/opensearch/api/actions/notifications/update_config.rb @@ -29,12 +29,9 @@ def update_config(args = {}) method = 'PUT' url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UPDATE_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/create_object.rb b/lib/opensearch/api/actions/observability/create_object.rb index 6cb9ad580..020e19a38 100644 --- a/lib/opensearch/api/actions/observability/create_object.rb +++ b/lib/opensearch/api/actions/observability/create_object.rb @@ -23,12 +23,9 @@ def create_object(args = {}) method = 'POST' url = '_plugins/_observability/object' - Utils.validate_query_params args, CREATE_OBJECT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_OBJECT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/delete_object.rb b/lib/opensearch/api/actions/observability/delete_object.rb index b2335a989..6b82d0dc8 100644 --- a/lib/opensearch/api/actions/observability/delete_object.rb +++ b/lib/opensearch/api/actions/observability/delete_object.rb @@ -29,12 +29,9 @@ def delete_object(args = {}) method = 'DELETE' url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_OBJECT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_OBJECT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/get_localstats.rb b/lib/opensearch/api/actions/observability/get_localstats.rb index adbdb2339..fc51fbb6b 100644 --- a/lib/opensearch/api/actions/observability/get_localstats.rb +++ b/lib/opensearch/api/actions/observability/get_localstats.rb @@ -22,12 +22,9 @@ def get_localstats(args = {}) method = 'GET' url = '_plugins/_observability/_local/stats' - Utils.validate_query_params args, GET_LOCALSTATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_LOCALSTATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/get_object.rb b/lib/opensearch/api/actions/observability/get_object.rb index c0f5928ac..32c80fe29 100644 --- a/lib/opensearch/api/actions/observability/get_object.rb +++ b/lib/opensearch/api/actions/observability/get_object.rb @@ -27,12 +27,9 @@ def get_object(args = {}) method = 'GET' url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_OBJECT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_OBJECT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/list_objects.rb b/lib/opensearch/api/actions/observability/list_objects.rb index df82be53c..254de715f 100644 --- a/lib/opensearch/api/actions/observability/list_objects.rb +++ b/lib/opensearch/api/actions/observability/list_objects.rb @@ -22,12 +22,9 @@ def list_objects(args = {}) method = 'GET' url = '_plugins/_observability/object' - Utils.validate_query_params args, LIST_OBJECTS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - LIST_OBJECTS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/observability/update_object.rb b/lib/opensearch/api/actions/observability/update_object.rb index c3f1b07eb..86dc04fe2 100644 --- a/lib/opensearch/api/actions/observability/update_object.rb +++ b/lib/opensearch/api/actions/observability/update_object.rb @@ -28,12 +28,9 @@ def update_object(args = {}) method = 'PUT' url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UPDATE_OBJECT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_OBJECT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/ping.rb b/lib/opensearch/api/actions/ping.rb index ca0284c85..6d12cb73e 100644 --- a/lib/opensearch/api/actions/ping.rb +++ b/lib/opensearch/api/actions/ping.rb @@ -22,12 +22,9 @@ def ping(args = {}) method = 'HEAD' url = '/' - Utils.validate_query_params args, PING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_ping_request method, url, args, body, headers end - - PING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/query/datasource_delete.rb b/lib/opensearch/api/actions/query/datasource_delete.rb index ab742e985..74582a1a2 100644 --- a/lib/opensearch/api/actions/query/datasource_delete.rb +++ b/lib/opensearch/api/actions/query/datasource_delete.rb @@ -29,12 +29,9 @@ def datasource_delete(args = {}) method = 'DELETE' url = ['_plugins/_query/_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DATASOURCE_DELETE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DATASOURCE_DELETE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/query/datasource_retrieve.rb b/lib/opensearch/api/actions/query/datasource_retrieve.rb index 9f7edd704..232225e8d 100644 --- a/lib/opensearch/api/actions/query/datasource_retrieve.rb +++ b/lib/opensearch/api/actions/query/datasource_retrieve.rb @@ -27,12 +27,9 @@ def datasource_retrieve(args = {}) method = 'GET' url = ['_plugins/_query/_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DATASOURCE_RETRIEVE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DATASOURCE_RETRIEVE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/query/datasources_create.rb b/lib/opensearch/api/actions/query/datasources_create.rb index ea146891b..8c7a62caf 100644 --- a/lib/opensearch/api/actions/query/datasources_create.rb +++ b/lib/opensearch/api/actions/query/datasources_create.rb @@ -23,12 +23,9 @@ def datasources_create(args = {}) method = 'POST' url = '_plugins/_query/_datasources' - Utils.validate_query_params args, DATASOURCES_CREATE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DATASOURCES_CREATE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/query/datasources_list.rb b/lib/opensearch/api/actions/query/datasources_list.rb index ba2bc7c3d..635658276 100644 --- a/lib/opensearch/api/actions/query/datasources_list.rb +++ b/lib/opensearch/api/actions/query/datasources_list.rb @@ -22,12 +22,9 @@ def datasources_list(args = {}) method = 'GET' url = '_plugins/_query/_datasources' - Utils.validate_query_params args, DATASOURCES_LIST_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DATASOURCES_LIST_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/query/datasources_update.rb b/lib/opensearch/api/actions/query/datasources_update.rb index dc541e0c0..1a9a743a5 100644 --- a/lib/opensearch/api/actions/query/datasources_update.rb +++ b/lib/opensearch/api/actions/query/datasources_update.rb @@ -23,12 +23,9 @@ def datasources_update(args = {}) method = 'PUT' url = '_plugins/_query/_datasources' - Utils.validate_query_params args, DATASOURCES_UPDATE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - DATASOURCES_UPDATE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/render_search_template.rb b/lib/opensearch/api/actions/render_search_template.rb index 04a45ccab..cb2ff8fb5 100644 --- a/lib/opensearch/api/actions/render_search_template.rb +++ b/lib/opensearch/api/actions/render_search_template.rb @@ -26,12 +26,9 @@ def render_search_template(args = {}) method = body ? 'POST' : 'GET' url = ['_render/template', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, RENDER_SEARCH_TEMPLATE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - RENDER_SEARCH_TEMPLATE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/autofollow_stats.rb b/lib/opensearch/api/actions/replication/autofollow_stats.rb index ab4790724..8c13bea36 100644 --- a/lib/opensearch/api/actions/replication/autofollow_stats.rb +++ b/lib/opensearch/api/actions/replication/autofollow_stats.rb @@ -22,12 +22,9 @@ def autofollow_stats(args = {}) method = 'GET' url = '_plugins/_replication/autofollow_stats' - Utils.validate_query_params args, AUTOFOLLOW_STATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - AUTOFOLLOW_STATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/create_replication_rule.rb b/lib/opensearch/api/actions/replication/create_replication_rule.rb index d85cffd51..744fd54cc 100644 --- a/lib/opensearch/api/actions/replication/create_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/create_replication_rule.rb @@ -25,12 +25,9 @@ def create_replication_rule(args = {}) method = 'POST' url = '_plugins/_replication/_autofollow' - Utils.validate_query_params args, CREATE_REPLICATION_RULE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_REPLICATION_RULE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/delete_replication_rule.rb b/lib/opensearch/api/actions/replication/delete_replication_rule.rb index 0dcc1e563..507990da0 100644 --- a/lib/opensearch/api/actions/replication/delete_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/delete_replication_rule.rb @@ -27,12 +27,9 @@ def delete_replication_rule(args = {}) method = 'DELETE' url = '_plugins/_replication/_autofollow' - Utils.validate_query_params args, DELETE_REPLICATION_RULE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_REPLICATION_RULE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/follower_stats.rb b/lib/opensearch/api/actions/replication/follower_stats.rb index 714ed11bd..f8aee3ac4 100644 --- a/lib/opensearch/api/actions/replication/follower_stats.rb +++ b/lib/opensearch/api/actions/replication/follower_stats.rb @@ -22,12 +22,9 @@ def follower_stats(args = {}) method = 'GET' url = '_plugins/_replication/follower_stats' - Utils.validate_query_params args, FOLLOWER_STATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - FOLLOWER_STATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/leader_stats.rb b/lib/opensearch/api/actions/replication/leader_stats.rb index e5a3f4aac..b37dda039 100644 --- a/lib/opensearch/api/actions/replication/leader_stats.rb +++ b/lib/opensearch/api/actions/replication/leader_stats.rb @@ -22,12 +22,9 @@ def leader_stats(args = {}) method = 'GET' url = '_plugins/_replication/leader_stats' - Utils.validate_query_params args, LEADER_STATS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - LEADER_STATS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/pause.rb b/lib/opensearch/api/actions/replication/pause.rb index e345966b4..18fd6e997 100644 --- a/lib/opensearch/api/actions/replication/pause.rb +++ b/lib/opensearch/api/actions/replication/pause.rb @@ -29,12 +29,9 @@ def pause(args = {}) method = 'POST' url = ['_plugins/_replication', _index, '_pause'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PAUSE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PAUSE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/resume.rb b/lib/opensearch/api/actions/replication/resume.rb index e44dd5180..3c9bdccf5 100644 --- a/lib/opensearch/api/actions/replication/resume.rb +++ b/lib/opensearch/api/actions/replication/resume.rb @@ -29,12 +29,9 @@ def resume(args = {}) method = 'POST' url = ['_plugins/_replication', _index, '_resume'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, RESUME_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - RESUME_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/start.rb b/lib/opensearch/api/actions/replication/start.rb index 47a7a02f1..38b672b9c 100644 --- a/lib/opensearch/api/actions/replication/start.rb +++ b/lib/opensearch/api/actions/replication/start.rb @@ -29,12 +29,9 @@ def start(args = {}) method = 'PUT' url = ['_plugins/_replication', _index, '_start'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, START_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - START_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/status.rb b/lib/opensearch/api/actions/replication/status.rb index 1a934a8c1..2bc1acdf2 100644 --- a/lib/opensearch/api/actions/replication/status.rb +++ b/lib/opensearch/api/actions/replication/status.rb @@ -27,12 +27,9 @@ def status(args = {}) method = 'GET' url = ['_plugins/_replication', _index, '_status'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, STATUS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STATUS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/stop.rb b/lib/opensearch/api/actions/replication/stop.rb index 2a1c0c39a..689eef165 100644 --- a/lib/opensearch/api/actions/replication/stop.rb +++ b/lib/opensearch/api/actions/replication/stop.rb @@ -29,12 +29,9 @@ def stop(args = {}) method = 'POST' url = ['_plugins/_replication', _index, '_stop'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, STOP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STOP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/replication/update_settings.rb b/lib/opensearch/api/actions/replication/update_settings.rb index 8fcbfa561..92825d098 100644 --- a/lib/opensearch/api/actions/replication/update_settings.rb +++ b/lib/opensearch/api/actions/replication/update_settings.rb @@ -29,12 +29,9 @@ def update_settings(args = {}) method = 'PUT' url = ['_plugins/_replication', _index, '_update'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UPDATE_SETTINGS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_SETTINGS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/rollups/delete.rb b/lib/opensearch/api/actions/rollups/delete.rb index a13e90887..a42973082 100644 --- a/lib/opensearch/api/actions/rollups/delete.rb +++ b/lib/opensearch/api/actions/rollups/delete.rb @@ -29,12 +29,9 @@ def delete(args = {}) method = 'DELETE' url = ['_plugins/_rollup/jobs', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/rollups/explain.rb b/lib/opensearch/api/actions/rollups/explain.rb index 061633542..ef5711049 100644 --- a/lib/opensearch/api/actions/rollups/explain.rb +++ b/lib/opensearch/api/actions/rollups/explain.rb @@ -27,12 +27,9 @@ def explain(args = {}) method = 'GET' url = ['_plugins/_rollup/jobs', _id, '_explain'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - EXPLAIN_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/rollups/get.rb b/lib/opensearch/api/actions/rollups/get.rb index 131565b5b..76db91e22 100644 --- a/lib/opensearch/api/actions/rollups/get.rb +++ b/lib/opensearch/api/actions/rollups/get.rb @@ -27,12 +27,9 @@ def get(args = {}) method = 'GET' url = ['_plugins/_rollup/jobs', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/rollups/start.rb b/lib/opensearch/api/actions/rollups/start.rb index 1be1160c3..4bae7cdf4 100644 --- a/lib/opensearch/api/actions/rollups/start.rb +++ b/lib/opensearch/api/actions/rollups/start.rb @@ -27,12 +27,9 @@ def start(args = {}) method = 'POST' url = ['_plugins/_rollup/jobs', _id, '_start'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, START_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - START_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/rollups/stop.rb b/lib/opensearch/api/actions/rollups/stop.rb index 20e80a8b3..a00b67771 100644 --- a/lib/opensearch/api/actions/rollups/stop.rb +++ b/lib/opensearch/api/actions/rollups/stop.rb @@ -27,12 +27,9 @@ def stop(args = {}) method = 'POST' url = ['_plugins/_rollup/jobs', _id, '_stop'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, STOP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STOP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/scripts_painless_execute.rb b/lib/opensearch/api/actions/scripts_painless_execute.rb index b1e2d05d8..8c25eeb62 100644 --- a/lib/opensearch/api/actions/scripts_painless_execute.rb +++ b/lib/opensearch/api/actions/scripts_painless_execute.rb @@ -23,12 +23,9 @@ def scripts_painless_execute(args = {}) method = body ? 'POST' : 'GET' url = '_scripts/painless/_execute' - Utils.validate_query_params args, SCRIPTS_PAINLESS_EXECUTE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - SCRIPTS_PAINLESS_EXECUTE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/authtoken.rb b/lib/opensearch/api/actions/security/authtoken.rb index 7f42567b2..ccd1fdcb7 100644 --- a/lib/opensearch/api/actions/security/authtoken.rb +++ b/lib/opensearch/api/actions/security/authtoken.rb @@ -22,12 +22,9 @@ def authtoken(args = {}) method = 'POST' url = '_plugins/_security/api/authtoken' - Utils.validate_query_params args, AUTHTOKEN_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - AUTHTOKEN_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/change_password.rb b/lib/opensearch/api/actions/security/change_password.rb index 2055edc7b..5f4e47910 100644 --- a/lib/opensearch/api/actions/security/change_password.rb +++ b/lib/opensearch/api/actions/security/change_password.rb @@ -25,12 +25,9 @@ def change_password(args = {}) method = 'PUT' url = '_plugins/_security/api/account' - Utils.validate_query_params args, CHANGE_PASSWORD_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CHANGE_PASSWORD_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/config_upgrade_check.rb b/lib/opensearch/api/actions/security/config_upgrade_check.rb index 8f8c001c0..48ac1833b 100644 --- a/lib/opensearch/api/actions/security/config_upgrade_check.rb +++ b/lib/opensearch/api/actions/security/config_upgrade_check.rb @@ -22,12 +22,9 @@ def config_upgrade_check(args = {}) method = 'GET' url = '_plugins/_security/api/_upgrade_check' - Utils.validate_query_params args, CONFIG_UPGRADE_CHECK_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CONFIG_UPGRADE_CHECK_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/config_upgrade_perform.rb b/lib/opensearch/api/actions/security/config_upgrade_perform.rb index 66ae485e6..a35aa6078 100644 --- a/lib/opensearch/api/actions/security/config_upgrade_perform.rb +++ b/lib/opensearch/api/actions/security/config_upgrade_perform.rb @@ -23,12 +23,9 @@ def config_upgrade_perform(args = {}) method = 'POST' url = '_plugins/_security/api/_upgrade_perform' - Utils.validate_query_params args, CONFIG_UPGRADE_PERFORM_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CONFIG_UPGRADE_PERFORM_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_action_group.rb b/lib/opensearch/api/actions/security/create_action_group.rb index 184a17791..f04a892d1 100644 --- a/lib/opensearch/api/actions/security/create_action_group.rb +++ b/lib/opensearch/api/actions/security/create_action_group.rb @@ -29,12 +29,9 @@ def create_action_group(args = {}) method = 'PUT' url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_ACTION_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_ACTION_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_allowlist.rb b/lib/opensearch/api/actions/security/create_allowlist.rb index 25da1c4c5..a439124d3 100644 --- a/lib/opensearch/api/actions/security/create_allowlist.rb +++ b/lib/opensearch/api/actions/security/create_allowlist.rb @@ -25,12 +25,9 @@ def create_allowlist(args = {}) method = 'PUT' url = '_plugins/_security/api/allowlist' - Utils.validate_query_params args, CREATE_ALLOWLIST_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_ALLOWLIST_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_role.rb b/lib/opensearch/api/actions/security/create_role.rb index bdd60e303..7b2db875e 100644 --- a/lib/opensearch/api/actions/security/create_role.rb +++ b/lib/opensearch/api/actions/security/create_role.rb @@ -29,12 +29,9 @@ def create_role(args = {}) method = 'PUT' url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_ROLE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_ROLE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_role_mapping.rb b/lib/opensearch/api/actions/security/create_role_mapping.rb index 43817da4f..298f1e677 100644 --- a/lib/opensearch/api/actions/security/create_role_mapping.rb +++ b/lib/opensearch/api/actions/security/create_role_mapping.rb @@ -29,12 +29,9 @@ def create_role_mapping(args = {}) method = 'PUT' url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_ROLE_MAPPING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_ROLE_MAPPING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_tenant.rb b/lib/opensearch/api/actions/security/create_tenant.rb index 8f5e09b9b..41610e047 100644 --- a/lib/opensearch/api/actions/security/create_tenant.rb +++ b/lib/opensearch/api/actions/security/create_tenant.rb @@ -29,12 +29,9 @@ def create_tenant(args = {}) method = 'PUT' url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_TENANT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_TENANT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_update_tenancy_config.rb b/lib/opensearch/api/actions/security/create_update_tenancy_config.rb index b9d1499f1..66b1dffc3 100644 --- a/lib/opensearch/api/actions/security/create_update_tenancy_config.rb +++ b/lib/opensearch/api/actions/security/create_update_tenancy_config.rb @@ -25,12 +25,9 @@ def create_update_tenancy_config(args = {}) method = 'PUT' url = '_plugins/_security/api/tenancy/config' - Utils.validate_query_params args, CREATE_UPDATE_TENANCY_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_UPDATE_TENANCY_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_user.rb b/lib/opensearch/api/actions/security/create_user.rb index b9b0e46e1..994c5b57a 100644 --- a/lib/opensearch/api/actions/security/create_user.rb +++ b/lib/opensearch/api/actions/security/create_user.rb @@ -29,12 +29,9 @@ def create_user(args = {}) method = 'PUT' url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_USER_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_USER_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/create_user_legacy.rb b/lib/opensearch/api/actions/security/create_user_legacy.rb index 71ed3e9a8..472265894 100644 --- a/lib/opensearch/api/actions/security/create_user_legacy.rb +++ b/lib/opensearch/api/actions/security/create_user_legacy.rb @@ -29,12 +29,9 @@ def create_user_legacy(args = {}) method = 'PUT' url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_USER_LEGACY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_USER_LEGACY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_action_group.rb b/lib/opensearch/api/actions/security/delete_action_group.rb index 1fe4d47ac..ed7b6d828 100644 --- a/lib/opensearch/api/actions/security/delete_action_group.rb +++ b/lib/opensearch/api/actions/security/delete_action_group.rb @@ -29,12 +29,9 @@ def delete_action_group(args = {}) method = 'DELETE' url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_ACTION_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_ACTION_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_distinguished_name.rb b/lib/opensearch/api/actions/security/delete_distinguished_name.rb index 052b4cc96..4816423c5 100644 --- a/lib/opensearch/api/actions/security/delete_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/delete_distinguished_name.rb @@ -29,12 +29,9 @@ def delete_distinguished_name(args = {}) method = 'DELETE' url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_DISTINGUISHED_NAME_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_DISTINGUISHED_NAME_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_role.rb b/lib/opensearch/api/actions/security/delete_role.rb index a163b6fc4..04433b3ca 100644 --- a/lib/opensearch/api/actions/security/delete_role.rb +++ b/lib/opensearch/api/actions/security/delete_role.rb @@ -29,12 +29,9 @@ def delete_role(args = {}) method = 'DELETE' url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_ROLE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_ROLE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_role_mapping.rb b/lib/opensearch/api/actions/security/delete_role_mapping.rb index 04fda3cb2..5389c79b2 100644 --- a/lib/opensearch/api/actions/security/delete_role_mapping.rb +++ b/lib/opensearch/api/actions/security/delete_role_mapping.rb @@ -29,12 +29,9 @@ def delete_role_mapping(args = {}) method = 'DELETE' url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_ROLE_MAPPING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_ROLE_MAPPING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_tenant.rb b/lib/opensearch/api/actions/security/delete_tenant.rb index c6deb7277..fb433f3de 100644 --- a/lib/opensearch/api/actions/security/delete_tenant.rb +++ b/lib/opensearch/api/actions/security/delete_tenant.rb @@ -29,12 +29,9 @@ def delete_tenant(args = {}) method = 'DELETE' url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_TENANT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_TENANT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_user.rb b/lib/opensearch/api/actions/security/delete_user.rb index f66c38e2a..a09e6d901 100644 --- a/lib/opensearch/api/actions/security/delete_user.rb +++ b/lib/opensearch/api/actions/security/delete_user.rb @@ -29,12 +29,9 @@ def delete_user(args = {}) method = 'DELETE' url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_USER_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_USER_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/delete_user_legacy.rb b/lib/opensearch/api/actions/security/delete_user_legacy.rb index e694b57f2..e5a810107 100644 --- a/lib/opensearch/api/actions/security/delete_user_legacy.rb +++ b/lib/opensearch/api/actions/security/delete_user_legacy.rb @@ -29,12 +29,9 @@ def delete_user_legacy(args = {}) method = 'DELETE' url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_USER_LEGACY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_USER_LEGACY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/flush_cache.rb b/lib/opensearch/api/actions/security/flush_cache.rb index 3ef883ef1..730b11750 100644 --- a/lib/opensearch/api/actions/security/flush_cache.rb +++ b/lib/opensearch/api/actions/security/flush_cache.rb @@ -24,12 +24,9 @@ def flush_cache(args = {}) method = 'DELETE' url = '_plugins/_security/api/cache' - Utils.validate_query_params args, FLUSH_CACHE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - FLUSH_CACHE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/generate_obo_token.rb b/lib/opensearch/api/actions/security/generate_obo_token.rb index 6314400c1..965e81a25 100644 --- a/lib/opensearch/api/actions/security/generate_obo_token.rb +++ b/lib/opensearch/api/actions/security/generate_obo_token.rb @@ -25,12 +25,9 @@ def generate_obo_token(args = {}) method = 'POST' url = '_plugins/_security/api/generateonbehalfoftoken' - Utils.validate_query_params args, GENERATE_OBO_TOKEN_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GENERATE_OBO_TOKEN_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/generate_user_token.rb b/lib/opensearch/api/actions/security/generate_user_token.rb index 96436f724..3adb4bc98 100644 --- a/lib/opensearch/api/actions/security/generate_user_token.rb +++ b/lib/opensearch/api/actions/security/generate_user_token.rb @@ -27,12 +27,9 @@ def generate_user_token(args = {}) method = 'POST' url = ['_plugins/_security/api/internalusers', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GENERATE_USER_TOKEN_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GENERATE_USER_TOKEN_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/generate_user_token_legacy.rb b/lib/opensearch/api/actions/security/generate_user_token_legacy.rb index f66c3fe86..dc0513a40 100644 --- a/lib/opensearch/api/actions/security/generate_user_token_legacy.rb +++ b/lib/opensearch/api/actions/security/generate_user_token_legacy.rb @@ -27,12 +27,9 @@ def generate_user_token_legacy(args = {}) method = 'POST' url = ['_plugins/_security/api/user', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GENERATE_USER_TOKEN_LEGACY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GENERATE_USER_TOKEN_LEGACY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_account_details.rb b/lib/opensearch/api/actions/security/get_account_details.rb index 7821cd12d..1c759407c 100644 --- a/lib/opensearch/api/actions/security/get_account_details.rb +++ b/lib/opensearch/api/actions/security/get_account_details.rb @@ -22,12 +22,9 @@ def get_account_details(args = {}) method = 'GET' url = '_plugins/_security/api/account' - Utils.validate_query_params args, GET_ACCOUNT_DETAILS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ACCOUNT_DETAILS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_action_group.rb b/lib/opensearch/api/actions/security/get_action_group.rb index b8923d87f..0b820a977 100644 --- a/lib/opensearch/api/actions/security/get_action_group.rb +++ b/lib/opensearch/api/actions/security/get_action_group.rb @@ -27,12 +27,9 @@ def get_action_group(args = {}) method = 'GET' url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_ACTION_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ACTION_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_action_groups.rb b/lib/opensearch/api/actions/security/get_action_groups.rb index 4114bb473..c0aa1f204 100644 --- a/lib/opensearch/api/actions/security/get_action_groups.rb +++ b/lib/opensearch/api/actions/security/get_action_groups.rb @@ -22,12 +22,9 @@ def get_action_groups(args = {}) method = 'GET' url = '_plugins/_security/api/actiongroups' - Utils.validate_query_params args, GET_ACTION_GROUPS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ACTION_GROUPS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_allowlist.rb b/lib/opensearch/api/actions/security/get_allowlist.rb index 975f160a7..55bc24083 100644 --- a/lib/opensearch/api/actions/security/get_allowlist.rb +++ b/lib/opensearch/api/actions/security/get_allowlist.rb @@ -22,12 +22,9 @@ def get_allowlist(args = {}) method = 'GET' url = '_plugins/_security/api/allowlist' - Utils.validate_query_params args, GET_ALLOWLIST_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ALLOWLIST_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_audit_configuration.rb b/lib/opensearch/api/actions/security/get_audit_configuration.rb index ee946a1c7..06d1fec52 100644 --- a/lib/opensearch/api/actions/security/get_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/get_audit_configuration.rb @@ -22,12 +22,9 @@ def get_audit_configuration(args = {}) method = 'GET' url = '_plugins/_security/api/audit' - Utils.validate_query_params args, GET_AUDIT_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_AUDIT_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_certificates.rb b/lib/opensearch/api/actions/security/get_certificates.rb index d07365e65..2853d42be 100644 --- a/lib/opensearch/api/actions/security/get_certificates.rb +++ b/lib/opensearch/api/actions/security/get_certificates.rb @@ -22,12 +22,9 @@ def get_certificates(args = {}) method = 'GET' url = '_plugins/_security/api/ssl/certs' - Utils.validate_query_params args, GET_CERTIFICATES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_CERTIFICATES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_configuration.rb b/lib/opensearch/api/actions/security/get_configuration.rb index 02646a833..0c1704f22 100644 --- a/lib/opensearch/api/actions/security/get_configuration.rb +++ b/lib/opensearch/api/actions/security/get_configuration.rb @@ -22,12 +22,9 @@ def get_configuration(args = {}) method = 'GET' url = '_plugins/_security/api/securityconfig' - Utils.validate_query_params args, GET_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_dashboards_info.rb b/lib/opensearch/api/actions/security/get_dashboards_info.rb index 23586aa6d..0c21e37ae 100644 --- a/lib/opensearch/api/actions/security/get_dashboards_info.rb +++ b/lib/opensearch/api/actions/security/get_dashboards_info.rb @@ -22,12 +22,9 @@ def get_dashboards_info(args = {}) method = 'GET' url = '_plugins/_security/dashboardsinfo' - Utils.validate_query_params args, GET_DASHBOARDS_INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_DASHBOARDS_INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_permissions_info.rb b/lib/opensearch/api/actions/security/get_permissions_info.rb index f4398f23c..7ba9b89da 100644 --- a/lib/opensearch/api/actions/security/get_permissions_info.rb +++ b/lib/opensearch/api/actions/security/get_permissions_info.rb @@ -22,12 +22,9 @@ def get_permissions_info(args = {}) method = 'GET' url = '_plugins/_security/api/permissionsinfo' - Utils.validate_query_params args, GET_PERMISSIONS_INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_PERMISSIONS_INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_role.rb b/lib/opensearch/api/actions/security/get_role.rb index 16acd97e5..906c46dba 100644 --- a/lib/opensearch/api/actions/security/get_role.rb +++ b/lib/opensearch/api/actions/security/get_role.rb @@ -27,12 +27,9 @@ def get_role(args = {}) method = 'GET' url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_ROLE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ROLE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_role_mapping.rb b/lib/opensearch/api/actions/security/get_role_mapping.rb index 08e7c81c5..438b9d9a9 100644 --- a/lib/opensearch/api/actions/security/get_role_mapping.rb +++ b/lib/opensearch/api/actions/security/get_role_mapping.rb @@ -27,12 +27,9 @@ def get_role_mapping(args = {}) method = 'GET' url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_ROLE_MAPPING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ROLE_MAPPING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_role_mappings.rb b/lib/opensearch/api/actions/security/get_role_mappings.rb index 690375b8a..b87a8c814 100644 --- a/lib/opensearch/api/actions/security/get_role_mappings.rb +++ b/lib/opensearch/api/actions/security/get_role_mappings.rb @@ -22,12 +22,9 @@ def get_role_mappings(args = {}) method = 'GET' url = '_plugins/_security/api/rolesmapping' - Utils.validate_query_params args, GET_ROLE_MAPPINGS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ROLE_MAPPINGS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_roles.rb b/lib/opensearch/api/actions/security/get_roles.rb index f29e85e61..de6def475 100644 --- a/lib/opensearch/api/actions/security/get_roles.rb +++ b/lib/opensearch/api/actions/security/get_roles.rb @@ -22,12 +22,9 @@ def get_roles(args = {}) method = 'GET' url = '_plugins/_security/api/roles' - Utils.validate_query_params args, GET_ROLES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_ROLES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_tenancy_config.rb b/lib/opensearch/api/actions/security/get_tenancy_config.rb index b9054bf89..00a1cead8 100644 --- a/lib/opensearch/api/actions/security/get_tenancy_config.rb +++ b/lib/opensearch/api/actions/security/get_tenancy_config.rb @@ -22,12 +22,9 @@ def get_tenancy_config(args = {}) method = 'GET' url = '_plugins/_security/api/tenancy/config' - Utils.validate_query_params args, GET_TENANCY_CONFIG_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_TENANCY_CONFIG_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_tenant.rb b/lib/opensearch/api/actions/security/get_tenant.rb index cf8416a91..ac38b76e3 100644 --- a/lib/opensearch/api/actions/security/get_tenant.rb +++ b/lib/opensearch/api/actions/security/get_tenant.rb @@ -27,12 +27,9 @@ def get_tenant(args = {}) method = 'GET' url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_TENANT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_TENANT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_tenants.rb b/lib/opensearch/api/actions/security/get_tenants.rb index 90472e68a..fdb2793a7 100644 --- a/lib/opensearch/api/actions/security/get_tenants.rb +++ b/lib/opensearch/api/actions/security/get_tenants.rb @@ -22,12 +22,9 @@ def get_tenants(args = {}) method = 'GET' url = '_plugins/_security/api/tenants' - Utils.validate_query_params args, GET_TENANTS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_TENANTS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_user.rb b/lib/opensearch/api/actions/security/get_user.rb index 1f1a97c17..29cc4f46a 100644 --- a/lib/opensearch/api/actions/security/get_user.rb +++ b/lib/opensearch/api/actions/security/get_user.rb @@ -27,12 +27,9 @@ def get_user(args = {}) method = 'GET' url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_USER_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_USER_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_user_legacy.rb b/lib/opensearch/api/actions/security/get_user_legacy.rb index c4a07eadd..008bd5487 100644 --- a/lib/opensearch/api/actions/security/get_user_legacy.rb +++ b/lib/opensearch/api/actions/security/get_user_legacy.rb @@ -27,12 +27,9 @@ def get_user_legacy(args = {}) method = 'GET' url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_USER_LEGACY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_USER_LEGACY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_users.rb b/lib/opensearch/api/actions/security/get_users.rb index d39f6ccde..dc2a2cac8 100644 --- a/lib/opensearch/api/actions/security/get_users.rb +++ b/lib/opensearch/api/actions/security/get_users.rb @@ -22,12 +22,9 @@ def get_users(args = {}) method = 'GET' url = '_plugins/_security/api/internalusers' - Utils.validate_query_params args, GET_USERS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_USERS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/get_users_legacy.rb b/lib/opensearch/api/actions/security/get_users_legacy.rb index fdbb58767..ecd0d3830 100644 --- a/lib/opensearch/api/actions/security/get_users_legacy.rb +++ b/lib/opensearch/api/actions/security/get_users_legacy.rb @@ -22,12 +22,9 @@ def get_users_legacy(args = {}) method = 'GET' url = '_plugins/_security/api/user' - Utils.validate_query_params args, GET_USERS_LEGACY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_USERS_LEGACY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/migrate.rb b/lib/opensearch/api/actions/security/migrate.rb index 9c2cbfa57..735c3eb52 100644 --- a/lib/opensearch/api/actions/security/migrate.rb +++ b/lib/opensearch/api/actions/security/migrate.rb @@ -22,12 +22,9 @@ def migrate(args = {}) method = 'POST' url = '_plugins/_security/api/migrate' - Utils.validate_query_params args, MIGRATE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - MIGRATE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_action_group.rb b/lib/opensearch/api/actions/security/patch_action_group.rb index d019ceef9..fc408fcae 100644 --- a/lib/opensearch/api/actions/security/patch_action_group.rb +++ b/lib/opensearch/api/actions/security/patch_action_group.rb @@ -29,12 +29,9 @@ def patch_action_group(args = {}) method = 'PATCH' url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_ACTION_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ACTION_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_action_groups.rb b/lib/opensearch/api/actions/security/patch_action_groups.rb index 3045ed613..bdd2d6ec3 100644 --- a/lib/opensearch/api/actions/security/patch_action_groups.rb +++ b/lib/opensearch/api/actions/security/patch_action_groups.rb @@ -25,12 +25,9 @@ def patch_action_groups(args = {}) method = 'PATCH' url = '_plugins/_security/api/actiongroups' - Utils.validate_query_params args, PATCH_ACTION_GROUPS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ACTION_GROUPS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_allowlist.rb b/lib/opensearch/api/actions/security/patch_allowlist.rb index 4f58d84ff..2447a2357 100644 --- a/lib/opensearch/api/actions/security/patch_allowlist.rb +++ b/lib/opensearch/api/actions/security/patch_allowlist.rb @@ -25,12 +25,9 @@ def patch_allowlist(args = {}) method = 'PATCH' url = '_plugins/_security/api/allowlist' - Utils.validate_query_params args, PATCH_ALLOWLIST_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ALLOWLIST_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_audit_configuration.rb b/lib/opensearch/api/actions/security/patch_audit_configuration.rb index 3ebe8ee20..d22ab1b19 100644 --- a/lib/opensearch/api/actions/security/patch_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_audit_configuration.rb @@ -25,12 +25,9 @@ def patch_audit_configuration(args = {}) method = 'PATCH' url = '_plugins/_security/api/audit' - Utils.validate_query_params args, PATCH_AUDIT_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_AUDIT_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_configuration.rb b/lib/opensearch/api/actions/security/patch_configuration.rb index 9f612fc4b..1f5467efc 100644 --- a/lib/opensearch/api/actions/security/patch_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_configuration.rb @@ -25,12 +25,9 @@ def patch_configuration(args = {}) method = 'PATCH' url = '_plugins/_security/api/securityconfig' - Utils.validate_query_params args, PATCH_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_distinguished_name.rb b/lib/opensearch/api/actions/security/patch_distinguished_name.rb index c4b98c1c2..3fd9cafc5 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_name.rb @@ -28,12 +28,9 @@ def patch_distinguished_name(args = {}) method = 'PATCH' url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_DISTINGUISHED_NAME_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_DISTINGUISHED_NAME_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_distinguished_names.rb b/lib/opensearch/api/actions/security/patch_distinguished_names.rb index 29767f395..070b5fc16 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_names.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_names.rb @@ -25,12 +25,9 @@ def patch_distinguished_names(args = {}) method = 'PATCH' url = '_plugins/_security/api/nodesdn' - Utils.validate_query_params args, PATCH_DISTINGUISHED_NAMES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_DISTINGUISHED_NAMES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_role.rb b/lib/opensearch/api/actions/security/patch_role.rb index bb5127bdf..f5e007e42 100644 --- a/lib/opensearch/api/actions/security/patch_role.rb +++ b/lib/opensearch/api/actions/security/patch_role.rb @@ -29,12 +29,9 @@ def patch_role(args = {}) method = 'PATCH' url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_ROLE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ROLE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_role_mapping.rb b/lib/opensearch/api/actions/security/patch_role_mapping.rb index e7d2fd211..7758ed581 100644 --- a/lib/opensearch/api/actions/security/patch_role_mapping.rb +++ b/lib/opensearch/api/actions/security/patch_role_mapping.rb @@ -29,12 +29,9 @@ def patch_role_mapping(args = {}) method = 'PATCH' url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_ROLE_MAPPING_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ROLE_MAPPING_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_role_mappings.rb b/lib/opensearch/api/actions/security/patch_role_mappings.rb index 698c9b16c..dd8336718 100644 --- a/lib/opensearch/api/actions/security/patch_role_mappings.rb +++ b/lib/opensearch/api/actions/security/patch_role_mappings.rb @@ -25,12 +25,9 @@ def patch_role_mappings(args = {}) method = 'PATCH' url = '_plugins/_security/api/rolesmapping' - Utils.validate_query_params args, PATCH_ROLE_MAPPINGS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ROLE_MAPPINGS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_roles.rb b/lib/opensearch/api/actions/security/patch_roles.rb index 07f68e17e..2d3c40a50 100644 --- a/lib/opensearch/api/actions/security/patch_roles.rb +++ b/lib/opensearch/api/actions/security/patch_roles.rb @@ -25,12 +25,9 @@ def patch_roles(args = {}) method = 'PATCH' url = '_plugins/_security/api/roles' - Utils.validate_query_params args, PATCH_ROLES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_ROLES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_tenant.rb b/lib/opensearch/api/actions/security/patch_tenant.rb index 73f1baf6d..8aa56a414 100644 --- a/lib/opensearch/api/actions/security/patch_tenant.rb +++ b/lib/opensearch/api/actions/security/patch_tenant.rb @@ -29,12 +29,9 @@ def patch_tenant(args = {}) method = 'PATCH' url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_TENANT_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_TENANT_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_tenants.rb b/lib/opensearch/api/actions/security/patch_tenants.rb index c0de4984d..a80f08ac5 100644 --- a/lib/opensearch/api/actions/security/patch_tenants.rb +++ b/lib/opensearch/api/actions/security/patch_tenants.rb @@ -25,12 +25,9 @@ def patch_tenants(args = {}) method = 'PATCH' url = '_plugins/_security/api/tenants' - Utils.validate_query_params args, PATCH_TENANTS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_TENANTS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_user.rb b/lib/opensearch/api/actions/security/patch_user.rb index 98eebb984..c90c9bc85 100644 --- a/lib/opensearch/api/actions/security/patch_user.rb +++ b/lib/opensearch/api/actions/security/patch_user.rb @@ -29,12 +29,9 @@ def patch_user(args = {}) method = 'PATCH' url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, PATCH_USER_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_USER_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/patch_users.rb b/lib/opensearch/api/actions/security/patch_users.rb index 0efc69b1e..6f9c1d3b9 100644 --- a/lib/opensearch/api/actions/security/patch_users.rb +++ b/lib/opensearch/api/actions/security/patch_users.rb @@ -25,12 +25,9 @@ def patch_users(args = {}) method = 'PATCH' url = '_plugins/_security/api/internalusers' - Utils.validate_query_params args, PATCH_USERS_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PATCH_USERS_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/post_dashboards_info.rb b/lib/opensearch/api/actions/security/post_dashboards_info.rb index 5d054e061..1dc1ba78d 100644 --- a/lib/opensearch/api/actions/security/post_dashboards_info.rb +++ b/lib/opensearch/api/actions/security/post_dashboards_info.rb @@ -22,12 +22,9 @@ def post_dashboards_info(args = {}) method = 'POST' url = '_plugins/_security/dashboardsinfo' - Utils.validate_query_params args, POST_DASHBOARDS_INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - POST_DASHBOARDS_INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/reload_http_certificates.rb b/lib/opensearch/api/actions/security/reload_http_certificates.rb index 12938abd7..de1a0ba3a 100644 --- a/lib/opensearch/api/actions/security/reload_http_certificates.rb +++ b/lib/opensearch/api/actions/security/reload_http_certificates.rb @@ -22,12 +22,9 @@ def reload_http_certificates(args = {}) method = 'PUT' url = '_plugins/_security/api/ssl/http/reloadcerts' - Utils.validate_query_params args, RELOAD_HTTP_CERTIFICATES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - RELOAD_HTTP_CERTIFICATES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/reload_transport_certificates.rb b/lib/opensearch/api/actions/security/reload_transport_certificates.rb index 5463212eb..23ac580e4 100644 --- a/lib/opensearch/api/actions/security/reload_transport_certificates.rb +++ b/lib/opensearch/api/actions/security/reload_transport_certificates.rb @@ -22,12 +22,9 @@ def reload_transport_certificates(args = {}) method = 'PUT' url = '_plugins/_security/api/ssl/transport/reloadcerts' - Utils.validate_query_params args, RELOAD_TRANSPORT_CERTIFICATES_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - RELOAD_TRANSPORT_CERTIFICATES_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/tenant_info.rb b/lib/opensearch/api/actions/security/tenant_info.rb index 43117ef12..6fa1a6a5d 100644 --- a/lib/opensearch/api/actions/security/tenant_info.rb +++ b/lib/opensearch/api/actions/security/tenant_info.rb @@ -22,12 +22,9 @@ def tenant_info(args = {}) method = body ? 'POST' : 'GET' url = '_plugins/_security/tenantinfo' - Utils.validate_query_params args, TENANT_INFO_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - TENANT_INFO_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/update_audit_configuration.rb b/lib/opensearch/api/actions/security/update_audit_configuration.rb index dbe0c355a..7f660c8e6 100644 --- a/lib/opensearch/api/actions/security/update_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/update_audit_configuration.rb @@ -25,12 +25,9 @@ def update_audit_configuration(args = {}) method = 'PUT' url = '_plugins/_security/api/audit/config' - Utils.validate_query_params args, UPDATE_AUDIT_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_AUDIT_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/update_configuration.rb b/lib/opensearch/api/actions/security/update_configuration.rb index 3e88be531..d4740cba8 100644 --- a/lib/opensearch/api/actions/security/update_configuration.rb +++ b/lib/opensearch/api/actions/security/update_configuration.rb @@ -25,12 +25,9 @@ def update_configuration(args = {}) method = 'PUT' url = '_plugins/_security/api/securityconfig/config' - Utils.validate_query_params args, UPDATE_CONFIGURATION_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_CONFIGURATION_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/update_distinguished_name.rb b/lib/opensearch/api/actions/security/update_distinguished_name.rb index 11d63b42a..eabeee53a 100644 --- a/lib/opensearch/api/actions/security/update_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/update_distinguished_name.rb @@ -28,12 +28,9 @@ def update_distinguished_name(args = {}) method = 'PUT' url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UPDATE_DISTINGUISHED_NAME_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_DISTINGUISHED_NAME_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/who_am_i.rb b/lib/opensearch/api/actions/security/who_am_i.rb index 1b73cd4d6..7aa441b27 100644 --- a/lib/opensearch/api/actions/security/who_am_i.rb +++ b/lib/opensearch/api/actions/security/who_am_i.rb @@ -22,12 +22,9 @@ def who_am_i(args = {}) method = body ? 'POST' : 'GET' url = '_plugins/_security/whoami' - Utils.validate_query_params args, WHO_AM_I_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - WHO_AM_I_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/security/who_am_i_protected.rb b/lib/opensearch/api/actions/security/who_am_i_protected.rb index 88af3ec36..3045bbe1b 100644 --- a/lib/opensearch/api/actions/security/who_am_i_protected.rb +++ b/lib/opensearch/api/actions/security/who_am_i_protected.rb @@ -22,12 +22,9 @@ def who_am_i_protected(args = {}) method = 'GET' url = '_plugins/_security/whoamiprotected' - Utils.validate_query_params args, WHO_AM_I_PROTECTED_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - WHO_AM_I_PROTECTED_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/create_policy.rb b/lib/opensearch/api/actions/sm/create_policy.rb index 58fb77f68..5cf81b90a 100644 --- a/lib/opensearch/api/actions/sm/create_policy.rb +++ b/lib/opensearch/api/actions/sm/create_policy.rb @@ -28,12 +28,9 @@ def create_policy(args = {}) method = 'POST' url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, CREATE_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/delete_policy.rb b/lib/opensearch/api/actions/sm/delete_policy.rb index 794144b0a..b5fc3b945 100644 --- a/lib/opensearch/api/actions/sm/delete_policy.rb +++ b/lib/opensearch/api/actions/sm/delete_policy.rb @@ -29,12 +29,9 @@ def delete_policy(args = {}) method = 'DELETE' url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/explain_policy.rb b/lib/opensearch/api/actions/sm/explain_policy.rb index 171e5f187..e0ccf9185 100644 --- a/lib/opensearch/api/actions/sm/explain_policy.rb +++ b/lib/opensearch/api/actions/sm/explain_policy.rb @@ -27,12 +27,9 @@ def explain_policy(args = {}) method = 'GET' url = ['_plugins/_sm/policies', _policy_name, '_explain'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, EXPLAIN_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - EXPLAIN_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/get_policy.rb b/lib/opensearch/api/actions/sm/get_policy.rb index d3c3ca0d9..8ed9598f2 100644 --- a/lib/opensearch/api/actions/sm/get_policy.rb +++ b/lib/opensearch/api/actions/sm/get_policy.rb @@ -27,12 +27,9 @@ def get_policy(args = {}) method = 'GET' url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/start_policy.rb b/lib/opensearch/api/actions/sm/start_policy.rb index a166f5f3e..987162b7a 100644 --- a/lib/opensearch/api/actions/sm/start_policy.rb +++ b/lib/opensearch/api/actions/sm/start_policy.rb @@ -27,12 +27,9 @@ def start_policy(args = {}) method = 'POST' url = ['_plugins/_sm/policies', _policy_name, '_start'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, START_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - START_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/sm/stop_policy.rb b/lib/opensearch/api/actions/sm/stop_policy.rb index 5c041847a..8707ff768 100644 --- a/lib/opensearch/api/actions/sm/stop_policy.rb +++ b/lib/opensearch/api/actions/sm/stop_policy.rb @@ -27,12 +27,9 @@ def stop_policy(args = {}) method = 'POST' url = ['_plugins/_sm/policies', _policy_name, '_stop'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, STOP_POLICY_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STOP_POLICY_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/delete.rb b/lib/opensearch/api/actions/transforms/delete.rb index f006f937e..af6c774e9 100644 --- a/lib/opensearch/api/actions/transforms/delete.rb +++ b/lib/opensearch/api/actions/transforms/delete.rb @@ -29,12 +29,9 @@ def delete(args = {}) method = 'DELETE' url = ['_plugins/_transform', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/explain.rb b/lib/opensearch/api/actions/transforms/explain.rb index 46956ad92..11dfbc8ec 100644 --- a/lib/opensearch/api/actions/transforms/explain.rb +++ b/lib/opensearch/api/actions/transforms/explain.rb @@ -27,12 +27,9 @@ def explain(args = {}) method = 'GET' url = ['_plugins/_transform', _id, '_explain'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - EXPLAIN_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/get.rb b/lib/opensearch/api/actions/transforms/get.rb index d2c916331..7003beca6 100644 --- a/lib/opensearch/api/actions/transforms/get.rb +++ b/lib/opensearch/api/actions/transforms/get.rb @@ -27,12 +27,9 @@ def get(args = {}) method = 'GET' url = ['_plugins/_transform', _id].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/preview.rb b/lib/opensearch/api/actions/transforms/preview.rb index 0d77b06ed..807765f6d 100644 --- a/lib/opensearch/api/actions/transforms/preview.rb +++ b/lib/opensearch/api/actions/transforms/preview.rb @@ -23,12 +23,9 @@ def preview(args = {}) method = 'POST' url = '_plugins/_transform/_preview' - Utils.validate_query_params args, PREVIEW_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - PREVIEW_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/start.rb b/lib/opensearch/api/actions/transforms/start.rb index d38ce8e23..8185d2d1f 100644 --- a/lib/opensearch/api/actions/transforms/start.rb +++ b/lib/opensearch/api/actions/transforms/start.rb @@ -27,12 +27,9 @@ def start(args = {}) method = 'POST' url = ['_plugins/_transform', _id, '_start'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, START_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - START_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/transforms/stop.rb b/lib/opensearch/api/actions/transforms/stop.rb index fd176ebcb..27a3d05ca 100644 --- a/lib/opensearch/api/actions/transforms/stop.rb +++ b/lib/opensearch/api/actions/transforms/stop.rb @@ -27,12 +27,9 @@ def stop(args = {}) method = 'POST' url = ['_plugins/_transform', _id, '_stop'].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, STOP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - STOP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/wlm/create_query_group.rb b/lib/opensearch/api/actions/wlm/create_query_group.rb index ee0e9a0f7..3191ac84f 100644 --- a/lib/opensearch/api/actions/wlm/create_query_group.rb +++ b/lib/opensearch/api/actions/wlm/create_query_group.rb @@ -25,12 +25,9 @@ def create_query_group(args = {}) method = 'PUT' url = '_wlm/query_group' - Utils.validate_query_params args, CREATE_QUERY_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - CREATE_QUERY_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/wlm/delete_query_group.rb b/lib/opensearch/api/actions/wlm/delete_query_group.rb index abec44085..32b1ae362 100644 --- a/lib/opensearch/api/actions/wlm/delete_query_group.rb +++ b/lib/opensearch/api/actions/wlm/delete_query_group.rb @@ -29,12 +29,9 @@ def delete_query_group(args = {}) method = 'DELETE' url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, DELETE_QUERY_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) end - - DELETE_QUERY_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/wlm/get_query_group.rb b/lib/opensearch/api/actions/wlm/get_query_group.rb index f5479bb0b..5b7986091 100644 --- a/lib/opensearch/api/actions/wlm/get_query_group.rb +++ b/lib/opensearch/api/actions/wlm/get_query_group.rb @@ -25,12 +25,9 @@ def get_query_group(args = {}) method = 'GET' url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, GET_QUERY_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - GET_QUERY_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end diff --git a/lib/opensearch/api/actions/wlm/update_query_group.rb b/lib/opensearch/api/actions/wlm/update_query_group.rb index 47824fced..8f305995a 100644 --- a/lib/opensearch/api/actions/wlm/update_query_group.rb +++ b/lib/opensearch/api/actions/wlm/update_query_group.rb @@ -29,12 +29,9 @@ def update_query_group(args = {}) method = 'PUT' url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') - Utils.validate_query_params args, UPDATE_QUERY_GROUP_QUERY_PARAMS + Utils.validate_query_params args transport.perform_request(method, url, args, body, headers).body end - - UPDATE_QUERY_GROUP_QUERY_PARAMS = Set.new(%w[ - ]).freeze end end end