From 60bd2493dd1479829cebd1ad87fe76248bb1241b Mon Sep 17 00:00:00 2001 From: Theo Truong Date: Fri, 20 Dec 2024 14:10:26 -0700 Subject: [PATCH] # Removed active support Signed-off-by: Theo Truong --- Gemfile | 1 - api_generator/lib/generators/action_generator.rb | 2 +- api_generator/lib/templates/action.mustache | 2 +- api_generator/lib/templates/client.mustache | 1 - lib/opensearch.rb | 1 - lib/opensearch/api/actions/asynchronous_search/delete.rb | 2 +- lib/opensearch/api/actions/asynchronous_search/get.rb | 2 +- lib/opensearch/api/actions/bulk.rb | 4 ++-- lib/opensearch/api/actions/bulk_stream.rb | 4 ++-- lib/opensearch/api/actions/cat/snapshots.rb | 2 +- .../api/actions/cluster/delete_component_template.rb | 2 +- .../api/actions/cluster/exists_component_template.rb | 2 +- .../api/actions/cluster/get_decommission_awareness.rb | 2 +- .../api/actions/cluster/get_weighted_routing.rb | 2 +- .../api/actions/cluster/put_component_template.rb | 4 ++-- .../api/actions/cluster/put_decommission_awareness.rb | 4 ++-- lib/opensearch/api/actions/cluster/put_settings.rb | 2 +- .../api/actions/cluster/put_weighted_routing.rb | 2 +- lib/opensearch/api/actions/create.rb | 6 +++--- lib/opensearch/api/actions/create_pit.rb | 2 +- .../api/actions/dangling_indices/delete_dangling_index.rb | 4 ++-- .../api/actions/dangling_indices/import_dangling_index.rb | 4 ++-- lib/opensearch/api/actions/delete.rb | 4 ++-- lib/opensearch/api/actions/delete_by_query.rb | 4 ++-- lib/opensearch/api/actions/delete_by_query_rethrottle.rb | 2 +- lib/opensearch/api/actions/delete_script.rb | 2 +- lib/opensearch/api/actions/exists.rb | 4 ++-- lib/opensearch/api/actions/exists_source.rb | 4 ++-- lib/opensearch/api/actions/explain.rb | 4 ++-- lib/opensearch/api/actions/flow_framework/delete.rb | 2 +- lib/opensearch/api/actions/flow_framework/deprovision.rb | 2 +- lib/opensearch/api/actions/flow_framework/get.rb | 2 +- lib/opensearch/api/actions/flow_framework/get_status.rb | 2 +- lib/opensearch/api/actions/flow_framework/provision.rb | 2 +- lib/opensearch/api/actions/flow_framework/search.rb | 2 +- lib/opensearch/api/actions/flow_framework/search_state.rb | 2 +- lib/opensearch/api/actions/flow_framework/update.rb | 2 +- lib/opensearch/api/actions/get.rb | 4 ++-- lib/opensearch/api/actions/get_script.rb | 2 +- lib/opensearch/api/actions/get_source.rb | 4 ++-- lib/opensearch/api/actions/index.rb | 6 +++--- lib/opensearch/api/actions/indices/add_block.rb | 4 ++-- lib/opensearch/api/actions/indices/clone.rb | 4 ++-- lib/opensearch/api/actions/indices/close.rb | 2 +- lib/opensearch/api/actions/indices/create.rb | 2 +- lib/opensearch/api/actions/indices/create_data_stream.rb | 2 +- lib/opensearch/api/actions/indices/delete.rb | 2 +- lib/opensearch/api/actions/indices/delete_alias.rb | 4 ++-- lib/opensearch/api/actions/indices/delete_data_stream.rb | 2 +- .../api/actions/indices/delete_index_template.rb | 2 +- lib/opensearch/api/actions/indices/delete_template.rb | 2 +- lib/opensearch/api/actions/indices/exists.rb | 2 +- lib/opensearch/api/actions/indices/exists_alias.rb | 2 +- .../api/actions/indices/exists_index_template.rb | 2 +- lib/opensearch/api/actions/indices/exists_template.rb | 2 +- lib/opensearch/api/actions/indices/get.rb | 2 +- lib/opensearch/api/actions/indices/get_field_mapping.rb | 2 +- lib/opensearch/api/actions/indices/open.rb | 2 +- lib/opensearch/api/actions/indices/put_alias.rb | 2 +- lib/opensearch/api/actions/indices/put_index_template.rb | 4 ++-- lib/opensearch/api/actions/indices/put_mapping.rb | 4 ++-- lib/opensearch/api/actions/indices/put_settings.rb | 2 +- lib/opensearch/api/actions/indices/put_template.rb | 4 ++-- lib/opensearch/api/actions/indices/resolve_index.rb | 2 +- lib/opensearch/api/actions/indices/rollover.rb | 2 +- lib/opensearch/api/actions/indices/shrink.rb | 4 ++-- .../api/actions/indices/simulate_index_template.rb | 2 +- lib/opensearch/api/actions/indices/split.rb | 4 ++-- lib/opensearch/api/actions/indices/update_aliases.rb | 2 +- lib/opensearch/api/actions/ingest/delete_pipeline.rb | 2 +- lib/opensearch/api/actions/ingest/put_pipeline.rb | 4 ++-- lib/opensearch/api/actions/ingest/simulate.rb | 2 +- lib/opensearch/api/actions/insights/top_queries.rb | 2 +- lib/opensearch/api/actions/ism/add_policy.rb | 2 +- lib/opensearch/api/actions/ism/change_policy.rb | 2 +- lib/opensearch/api/actions/ism/delete_policy.rb | 2 +- lib/opensearch/api/actions/ism/exists_policy.rb | 2 +- lib/opensearch/api/actions/ism/get_policy.rb | 2 +- lib/opensearch/api/actions/ism/put_policies.rb | 2 +- lib/opensearch/api/actions/ism/put_policy.rb | 2 +- .../api/actions/ism/refresh_search_analyzers.rb | 2 +- lib/opensearch/api/actions/ism/remove_policy.rb | 2 +- lib/opensearch/api/actions/ism/retry_index.rb | 2 +- lib/opensearch/api/actions/knn/delete_model.rb | 2 +- lib/opensearch/api/actions/knn/get_model.rb | 2 +- lib/opensearch/api/actions/knn/warmup.rb | 2 +- lib/opensearch/api/actions/mget.rb | 2 +- lib/opensearch/api/actions/ml/delete_agent.rb | 2 +- lib/opensearch/api/actions/ml/delete_connector.rb | 2 +- lib/opensearch/api/actions/ml/delete_model.rb | 2 +- lib/opensearch/api/actions/ml/delete_model_group.rb | 2 +- lib/opensearch/api/actions/ml/delete_task.rb | 2 +- lib/opensearch/api/actions/ml/deploy_model.rb | 2 +- lib/opensearch/api/actions/ml/get_model_group.rb | 2 +- lib/opensearch/api/actions/ml/get_task.rb | 2 +- lib/opensearch/api/actions/ml/undeploy_model.rb | 2 +- lib/opensearch/api/actions/msearch.rb | 2 +- lib/opensearch/api/actions/msearch_template.rb | 2 +- lib/opensearch/api/actions/notifications/create_config.rb | 2 +- lib/opensearch/api/actions/notifications/delete_config.rb | 2 +- .../api/actions/notifications/delete_configs.rb | 2 +- lib/opensearch/api/actions/notifications/get_config.rb | 2 +- lib/opensearch/api/actions/notifications/send_test.rb | 2 +- lib/opensearch/api/actions/notifications/update_config.rb | 4 ++-- lib/opensearch/api/actions/observability/delete_object.rb | 2 +- lib/opensearch/api/actions/observability/get_object.rb | 2 +- lib/opensearch/api/actions/observability/update_object.rb | 2 +- lib/opensearch/api/actions/ppl/explain.rb | 2 +- lib/opensearch/api/actions/ppl/post_stats.rb | 2 +- lib/opensearch/api/actions/ppl/query.rb | 2 +- lib/opensearch/api/actions/put_script.rb | 6 +++--- lib/opensearch/api/actions/query/datasource_delete.rb | 2 +- lib/opensearch/api/actions/query/datasource_retrieve.rb | 2 +- lib/opensearch/api/actions/rank_eval.rb | 2 +- lib/opensearch/api/actions/reindex.rb | 2 +- lib/opensearch/api/actions/reindex_rethrottle.rb | 2 +- lib/opensearch/api/actions/remote_store/restore.rb | 2 +- .../api/actions/replication/create_replication_rule.rb | 2 +- .../api/actions/replication/delete_replication_rule.rb | 2 +- lib/opensearch/api/actions/replication/pause.rb | 4 ++-- lib/opensearch/api/actions/replication/resume.rb | 4 ++-- lib/opensearch/api/actions/replication/start.rb | 4 ++-- lib/opensearch/api/actions/replication/status.rb | 2 +- lib/opensearch/api/actions/replication/stop.rb | 4 ++-- lib/opensearch/api/actions/replication/update_settings.rb | 4 ++-- lib/opensearch/api/actions/rollups/delete.rb | 2 +- lib/opensearch/api/actions/rollups/explain.rb | 2 +- lib/opensearch/api/actions/rollups/get.rb | 2 +- lib/opensearch/api/actions/rollups/put.rb | 2 +- lib/opensearch/api/actions/rollups/start.rb | 2 +- lib/opensearch/api/actions/rollups/stop.rb | 2 +- lib/opensearch/api/actions/search_pipeline/delete.rb | 2 +- lib/opensearch/api/actions/search_pipeline/put.rb | 4 ++-- lib/opensearch/api/actions/search_template.rb | 2 +- lib/opensearch/api/actions/security/change_password.rb | 2 +- .../api/actions/security/create_action_group.rb | 4 ++-- lib/opensearch/api/actions/security/create_allowlist.rb | 2 +- lib/opensearch/api/actions/security/create_role.rb | 4 ++-- .../api/actions/security/create_role_mapping.rb | 4 ++-- lib/opensearch/api/actions/security/create_tenant.rb | 4 ++-- .../api/actions/security/create_update_tenancy_config.rb | 2 +- lib/opensearch/api/actions/security/create_user.rb | 4 ++-- lib/opensearch/api/actions/security/create_user_legacy.rb | 4 ++-- .../api/actions/security/delete_action_group.rb | 2 +- .../api/actions/security/delete_distinguished_name.rb | 2 +- lib/opensearch/api/actions/security/delete_role.rb | 2 +- .../api/actions/security/delete_role_mapping.rb | 2 +- lib/opensearch/api/actions/security/delete_tenant.rb | 2 +- lib/opensearch/api/actions/security/delete_user.rb | 2 +- lib/opensearch/api/actions/security/delete_user_legacy.rb | 2 +- lib/opensearch/api/actions/security/generate_obo_token.rb | 2 +- .../api/actions/security/generate_user_token.rb | 2 +- .../api/actions/security/generate_user_token_legacy.rb | 2 +- lib/opensearch/api/actions/security/get_action_group.rb | 2 +- .../api/actions/security/get_distinguished_name.rb | 2 +- .../api/actions/security/get_node_certificates.rb | 2 +- lib/opensearch/api/actions/security/get_role.rb | 2 +- lib/opensearch/api/actions/security/get_role_mapping.rb | 2 +- lib/opensearch/api/actions/security/get_tenant.rb | 2 +- lib/opensearch/api/actions/security/get_user.rb | 2 +- lib/opensearch/api/actions/security/get_user_legacy.rb | 2 +- lib/opensearch/api/actions/security/patch_action_group.rb | 4 ++-- .../api/actions/security/patch_action_groups.rb | 2 +- lib/opensearch/api/actions/security/patch_allowlist.rb | 2 +- .../api/actions/security/patch_audit_configuration.rb | 2 +- .../api/actions/security/patch_configuration.rb | 2 +- .../api/actions/security/patch_distinguished_name.rb | 2 +- .../api/actions/security/patch_distinguished_names.rb | 2 +- lib/opensearch/api/actions/security/patch_role.rb | 4 ++-- lib/opensearch/api/actions/security/patch_role_mapping.rb | 4 ++-- .../api/actions/security/patch_role_mappings.rb | 2 +- lib/opensearch/api/actions/security/patch_roles.rb | 2 +- lib/opensearch/api/actions/security/patch_tenant.rb | 4 ++-- lib/opensearch/api/actions/security/patch_tenants.rb | 2 +- lib/opensearch/api/actions/security/patch_user.rb | 4 ++-- lib/opensearch/api/actions/security/patch_users.rb | 2 +- .../api/actions/security/update_audit_configuration.rb | 2 +- .../api/actions/security/update_configuration.rb | 2 +- .../api/actions/security/update_distinguished_name.rb | 2 +- lib/opensearch/api/actions/sm/create_policy.rb | 2 +- lib/opensearch/api/actions/sm/delete_policy.rb | 2 +- lib/opensearch/api/actions/sm/explain_policy.rb | 2 +- lib/opensearch/api/actions/sm/get_policy.rb | 2 +- lib/opensearch/api/actions/sm/start_policy.rb | 2 +- lib/opensearch/api/actions/sm/stop_policy.rb | 2 +- lib/opensearch/api/actions/sm/update_policy.rb | 6 +++--- lib/opensearch/api/actions/snapshot/cleanup_repository.rb | 2 +- lib/opensearch/api/actions/snapshot/clone.rb | 8 ++++---- lib/opensearch/api/actions/snapshot/create.rb | 4 ++-- lib/opensearch/api/actions/snapshot/create_repository.rb | 4 ++-- lib/opensearch/api/actions/snapshot/delete.rb | 4 ++-- lib/opensearch/api/actions/snapshot/delete_repository.rb | 2 +- lib/opensearch/api/actions/snapshot/get.rb | 4 ++-- lib/opensearch/api/actions/snapshot/restore.rb | 4 ++-- lib/opensearch/api/actions/snapshot/verify_repository.rb | 2 +- lib/opensearch/api/actions/tasks/get.rb | 2 +- lib/opensearch/api/actions/termvectors.rb | 2 +- lib/opensearch/api/actions/transforms/delete.rb | 2 +- lib/opensearch/api/actions/transforms/explain.rb | 2 +- lib/opensearch/api/actions/transforms/get.rb | 2 +- lib/opensearch/api/actions/transforms/put.rb | 2 +- lib/opensearch/api/actions/transforms/start.rb | 2 +- lib/opensearch/api/actions/transforms/stop.rb | 2 +- lib/opensearch/api/actions/update.rb | 6 +++--- lib/opensearch/api/actions/update_by_query.rb | 2 +- lib/opensearch/api/actions/update_by_query_rethrottle.rb | 2 +- lib/opensearch/api/actions/wlm/create_query_group.rb | 2 +- lib/opensearch/api/actions/wlm/delete_query_group.rb | 2 +- lib/opensearch/api/actions/wlm/update_query_group.rb | 4 ++-- opensearch-ruby.gemspec | 1 - 210 files changed, 265 insertions(+), 269 deletions(-) diff --git a/Gemfile b/Gemfile index f25884b2f..1edfa3201 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,6 @@ source 'https://rubygems.org' gem 'opensearch-ruby', path: __dir__, require: false -gem 'activesupport' gem 'ansi' gem 'bundler' gem 'cane' diff --git a/api_generator/lib/generators/action_generator.rb b/api_generator/lib/generators/action_generator.rb index b3edb521d..ba424ed68 100644 --- a/api_generator/lib/generators/action_generator.rb +++ b/api_generator/lib/generators/action_generator.rb @@ -57,7 +57,7 @@ def http_verb when %w[POST PUT] optional = @action.path_params.find { |arg| arg.required == false } return "'POST'" unless optional - "_#{optional.name}.present? ? 'PUT' : 'POST'" + "_#{optional.name}.nil? ? 'POST' : 'PUT'" else "'#{@action.http_verbs.first}'" end diff --git a/api_generator/lib/templates/action.mustache b/api_generator/lib/templates/action.mustache index d590c7c42..7662c8e91 100644 --- a/api_generator/lib/templates/action.mustache +++ b/api_generator/lib/templates/action.mustache @@ -22,7 +22,7 @@ module OpenSearch def {{method_name}}(args = {}) args = Utils.normalize_arguments(args) {{#required_args}} - raise ArgumentError, "Required argument '{{arg}}' missing" unless args['{{arg}}'] + raise ArgumentError, "Required argument '{{arg}}' missing" if args['{{arg}}'].nil? {{#_blank_line}} {{/_blank_line}} diff --git a/api_generator/lib/templates/client.mustache b/api_generator/lib/templates/client.mustache index b3ba74aa4..2407fdf2b 100644 --- a/api_generator/lib/templates/client.mustache +++ b/api_generator/lib/templates/client.mustache @@ -1,7 +1,6 @@ {{{license_header}}} {{{generated_code_warning}}} -require 'active_support/all' require 'opensearch/transport' require 'opensearch/api' Dir[File.expand_path('opensearch/api/**/*.rb', __dir__)].each { |f| require f } diff --git a/lib/opensearch.rb b/lib/opensearch.rb index b499d4d52..eba56a89a 100644 --- a/lib/opensearch.rb +++ b/lib/opensearch.rb @@ -7,7 +7,6 @@ # This file is generated from the OpenSearch REST API spec. # Do not modify it by hand. Instead, modify the generator or the spec. -require 'active_support/all' require 'opensearch/transport' require 'opensearch/api' Dir[File.expand_path('opensearch/api/**/*.rb', __dir__)].each { |f| require f } diff --git a/lib/opensearch/api/actions/asynchronous_search/delete.rb b/lib/opensearch/api/actions/asynchronous_search/delete.rb index 2d27a0c80..f1fafaa47 100644 --- a/lib/opensearch/api/actions/asynchronous_search/delete.rb +++ b/lib/opensearch/api/actions/asynchronous_search/delete.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/asynchronous_search/get.rb b/lib/opensearch/api/actions/asynchronous_search/get.rb index 7a1fdbe6a..27fb9d667 100644 --- a/lib/opensearch/api/actions/asynchronous_search/get.rb +++ b/lib/opensearch/api/actions/asynchronous_search/get.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/bulk.rb b/lib/opensearch/api/actions/bulk.rb index 8b5844720..1d1c9dd31 100644 --- a/lib/opensearch/api/actions/bulk.rb +++ b/lib/opensearch/api/actions/bulk.rb @@ -29,13 +29,13 @@ module Actions # @option args [Enumerable] :body *Required* The operation definition and data (action-data pairs), separated by newlines def bulk(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - method = _index.present? ? 'PUT' : 'POST' + method = _index.nil? ? 'POST' : 'PUT' url = [_index, '_bulk'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, BULK_QUERY_PARAMS diff --git a/lib/opensearch/api/actions/bulk_stream.rb b/lib/opensearch/api/actions/bulk_stream.rb index 624c0e69c..a676c9052 100644 --- a/lib/opensearch/api/actions/bulk_stream.rb +++ b/lib/opensearch/api/actions/bulk_stream.rb @@ -31,13 +31,13 @@ module Actions # @option args [Enumerable] :body *Required* The operation definition and data (action-data pairs), separated by newlines def bulk_stream(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - method = _index.present? ? 'PUT' : 'POST' + method = _index.nil? ? 'POST' : 'PUT' url = [_index, '_bulk/stream'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, BULK_STREAM_QUERY_PARAMS diff --git a/lib/opensearch/api/actions/cat/snapshots.rb b/lib/opensearch/api/actions/cat/snapshots.rb index a8655d5ea..dbbb6fb51 100644 --- a/lib/opensearch/api/actions/cat/snapshots.rb +++ b/lib/opensearch/api/actions/cat/snapshots.rb @@ -27,7 +27,7 @@ module Actions # @option args [Boolean] :v Verbose mode. Display column headers. def snapshots(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? _repository = args.delete('repository') diff --git a/lib/opensearch/api/actions/cluster/delete_component_template.rb b/lib/opensearch/api/actions/cluster/delete_component_template.rb index 929b81f8c..4cf11bfcf 100644 --- a/lib/opensearch/api/actions/cluster/delete_component_template.rb +++ b/lib/opensearch/api/actions/cluster/delete_component_template.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_component_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/cluster/exists_component_template.rb b/lib/opensearch/api/actions/cluster/exists_component_template.rb index 4c4f15e3b..af11b375e 100644 --- a/lib/opensearch/api/actions/cluster/exists_component_template.rb +++ b/lib/opensearch/api/actions/cluster/exists_component_template.rb @@ -21,7 +21,7 @@ module Actions # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. def exists_component_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb index 72b10cc90..4bdc984a2 100644 --- a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :awareness_attribute_name *Required* Awareness attribute name. def get_decommission_awareness(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'awareness_attribute_name' missing" unless args['awareness_attribute_name'] + raise ArgumentError, "Required argument 'awareness_attribute_name' missing" if args['awareness_attribute_name'].nil? _awareness_attribute_name = args.delete('awareness_attribute_name') diff --git a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb index 8c77491e7..fa4896e7d 100644 --- a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :attribute *Required* Awareness attribute name. def get_weighted_routing(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'attribute' missing" unless args['attribute'] + raise ArgumentError, "Required argument 'attribute' missing" if args['attribute'].nil? _attribute = args.delete('attribute') diff --git a/lib/opensearch/api/actions/cluster/put_component_template.rb b/lib/opensearch/api/actions/cluster/put_component_template.rb index 081349e8b..96211166a 100644 --- a/lib/opensearch/api/actions/cluster/put_component_template.rb +++ b/lib/opensearch/api/actions/cluster/put_component_template.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body *Required* The template definition def put_component_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb index e131a93a3..7096f02bd 100644 --- a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb @@ -19,8 +19,8 @@ module Actions # @option args [String] :awareness_attribute_value *Required* Awareness attribute value. def put_decommission_awareness(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'awareness_attribute_name' missing" unless args['awareness_attribute_name'] - raise ArgumentError, "Required argument 'awareness_attribute_value' missing" unless args['awareness_attribute_value'] + raise ArgumentError, "Required argument 'awareness_attribute_name' missing" if args['awareness_attribute_name'].nil? + raise ArgumentError, "Required argument 'awareness_attribute_value' missing" if args['awareness_attribute_value'].nil? _awareness_attribute_name = args.delete('awareness_attribute_name') _awareness_attribute_value = args.delete('awareness_attribute_value') diff --git a/lib/opensearch/api/actions/cluster/put_settings.rb b/lib/opensearch/api/actions/cluster/put_settings.rb index 1df2d8680..790b165b0 100644 --- a/lib/opensearch/api/actions/cluster/put_settings.rb +++ b/lib/opensearch/api/actions/cluster/put_settings.rb @@ -22,7 +22,7 @@ module Actions # @option args [Hash] :body *Required* The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). def put_settings(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb index 6ea02abc0..525b498be 100644 --- a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def put_weighted_routing(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'attribute' missing" unless args['attribute'] + raise ArgumentError, "Required argument 'attribute' missing" if args['attribute'].nil? _attribute = args.delete('attribute') diff --git a/lib/opensearch/api/actions/create.rb b/lib/opensearch/api/actions/create.rb index 4fd3bd6f2..8e6c0cd5a 100644 --- a/lib/opensearch/api/actions/create.rb +++ b/lib/opensearch/api/actions/create.rb @@ -28,9 +28,9 @@ module Actions # @option args [Hash] :body *Required* The document def create(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/create_pit.rb b/lib/opensearch/api/actions/create_pit.rb index 96725ccf1..fccd00465 100644 --- a/lib/opensearch/api/actions/create_pit.rb +++ b/lib/opensearch/api/actions/create_pit.rb @@ -23,7 +23,7 @@ module Actions # @option args [Enumerable, String] :routing Comma-separated list of specific routing values. def create_pit(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb b/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb index c24721890..245d5b714 100644 --- a/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb +++ b/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb @@ -23,8 +23,8 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_dangling_index(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index_uuid' missing" unless args['index_uuid'] - raise ArgumentError, "Required argument 'accept_data_loss' missing" unless args['accept_data_loss'] + raise ArgumentError, "Required argument 'index_uuid' missing" if args['index_uuid'].nil? + raise ArgumentError, "Required argument 'accept_data_loss' missing" if args['accept_data_loss'].nil? _index_uuid = args.delete('index_uuid') diff --git a/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb b/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb index 7c0618c80..548dd4b02 100644 --- a/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb +++ b/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb @@ -22,8 +22,8 @@ module Actions # @option args [String] :timeout Explicit operation timeout. def import_dangling_index(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index_uuid' missing" unless args['index_uuid'] - raise ArgumentError, "Required argument 'accept_data_loss' missing" unless args['accept_data_loss'] + raise ArgumentError, "Required argument 'index_uuid' missing" if args['index_uuid'].nil? + raise ArgumentError, "Required argument 'accept_data_loss' missing" if args['accept_data_loss'].nil? _index_uuid = args.delete('index_uuid') diff --git a/lib/opensearch/api/actions/delete.rb b/lib/opensearch/api/actions/delete.rb index 2c06289bf..360fb1a6c 100644 --- a/lib/opensearch/api/actions/delete.rb +++ b/lib/opensearch/api/actions/delete.rb @@ -28,8 +28,8 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/delete_by_query.rb b/lib/opensearch/api/actions/delete_by_query.rb index b8d7a0087..fb0d2e1e6 100644 --- a/lib/opensearch/api/actions/delete_by_query.rb +++ b/lib/opensearch/api/actions/delete_by_query.rb @@ -52,8 +52,8 @@ module Actions # @option args [Hash] :body *Required* The search definition using the Query DSL def delete_by_query(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/delete_by_query_rethrottle.rb b/lib/opensearch/api/actions/delete_by_query_rethrottle.rb index f4a58f831..93470cc37 100644 --- a/lib/opensearch/api/actions/delete_by_query_rethrottle.rb +++ b/lib/opensearch/api/actions/delete_by_query_rethrottle.rb @@ -19,7 +19,7 @@ module Actions # @option args [Float] :requests_per_second The throttle for this request in sub-requests per second. def delete_by_query_rethrottle(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/delete_script.rb b/lib/opensearch/api/actions/delete_script.rb index 3e035a3b8..ea0736f3d 100644 --- a/lib/opensearch/api/actions/delete_script.rb +++ b/lib/opensearch/api/actions/delete_script.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_script(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/exists.rb b/lib/opensearch/api/actions/exists.rb index 983e452ed..77cb798ab 100644 --- a/lib/opensearch/api/actions/exists.rb +++ b/lib/opensearch/api/actions/exists.rb @@ -29,8 +29,8 @@ module Actions # @option args [String] :version_type Specific version type: `external`, `external_gte`. def exists(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/exists_source.rb b/lib/opensearch/api/actions/exists_source.rb index f194a68e8..7deccc21b 100644 --- a/lib/opensearch/api/actions/exists_source.rb +++ b/lib/opensearch/api/actions/exists_source.rb @@ -28,8 +28,8 @@ module Actions # @option args [String] :version_type Specific version type: `external`, `external_gte`. def exists_source(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/explain.rb b/lib/opensearch/api/actions/explain.rb index 13c8682e6..18dc1123a 100644 --- a/lib/opensearch/api/actions/explain.rb +++ b/lib/opensearch/api/actions/explain.rb @@ -32,8 +32,8 @@ module Actions # @option args [Hash] :body The query definition using the Query DSL def explain(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/flow_framework/delete.rb b/lib/opensearch/api/actions/flow_framework/delete.rb index 6bad19359..aa3da2e56 100644 --- a/lib/opensearch/api/actions/flow_framework/delete.rb +++ b/lib/opensearch/api/actions/flow_framework/delete.rb @@ -20,7 +20,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/flow_framework/deprovision.rb b/lib/opensearch/api/actions/flow_framework/deprovision.rb index 046e7c0fd..c12b8cc3f 100644 --- a/lib/opensearch/api/actions/flow_framework/deprovision.rb +++ b/lib/opensearch/api/actions/flow_framework/deprovision.rb @@ -19,7 +19,7 @@ module Actions # @option args [String] :allow_delete Required when deleting resources involves a high potential for data loss. def deprovision(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/flow_framework/get.rb b/lib/opensearch/api/actions/flow_framework/get.rb index 90de1bc38..9ee3e6ea6 100644 --- a/lib/opensearch/api/actions/flow_framework/get.rb +++ b/lib/opensearch/api/actions/flow_framework/get.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :workflow_id *Required* def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/flow_framework/get_status.rb b/lib/opensearch/api/actions/flow_framework/get_status.rb index df18f98be..c99f0b627 100644 --- a/lib/opensearch/api/actions/flow_framework/get_status.rb +++ b/lib/opensearch/api/actions/flow_framework/get_status.rb @@ -19,7 +19,7 @@ module Actions # @option args [Boolean] :all The all parameter specifies whether the response should return all fields. def get_status(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/flow_framework/provision.rb b/lib/opensearch/api/actions/flow_framework/provision.rb index 2a4776cab..414df4eeb 100644 --- a/lib/opensearch/api/actions/flow_framework/provision.rb +++ b/lib/opensearch/api/actions/flow_framework/provision.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body Pass dynamic substitution expressions as key-value pairs, either as query parameters or in the request body. For example, if you specified a credential field in the template as `openai_key: '$'`, you can pass `openai_key` as a query parameter or in the request body. def provision(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/flow_framework/search.rb b/lib/opensearch/api/actions/flow_framework/search.rb index 60083c868..9c63f8b6d 100644 --- a/lib/opensearch/api/actions/flow_framework/search.rb +++ b/lib/opensearch/api/actions/flow_framework/search.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def search(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/flow_framework/search_state.rb b/lib/opensearch/api/actions/flow_framework/search_state.rb index 9e666ad79..16e7a77b8 100644 --- a/lib/opensearch/api/actions/flow_framework/search_state.rb +++ b/lib/opensearch/api/actions/flow_framework/search_state.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def search_state(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/flow_framework/update.rb b/lib/opensearch/api/actions/flow_framework/update.rb index cd35c12dd..127b70336 100644 --- a/lib/opensearch/api/actions/flow_framework/update.rb +++ b/lib/opensearch/api/actions/flow_framework/update.rb @@ -24,7 +24,7 @@ module Actions # @option args [Hash] :body def update(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'workflow_id' missing" unless args['workflow_id'] + raise ArgumentError, "Required argument 'workflow_id' missing" if args['workflow_id'].nil? _workflow_id = args.delete('workflow_id') diff --git a/lib/opensearch/api/actions/get.rb b/lib/opensearch/api/actions/get.rb index e0381508b..c5279ecda 100644 --- a/lib/opensearch/api/actions/get.rb +++ b/lib/opensearch/api/actions/get.rb @@ -29,8 +29,8 @@ module Actions # @option args [String] :version_type Specific version type: `internal`, `external`, `external_gte`. def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/get_script.rb b/lib/opensearch/api/actions/get_script.rb index 1539499d8..7dca85f4c 100644 --- a/lib/opensearch/api/actions/get_script.rb +++ b/lib/opensearch/api/actions/get_script.rb @@ -20,7 +20,7 @@ module Actions # @option args [String] :master_timeout DEPRECATED Specify timeout for connection to master def get_script(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/get_source.rb b/lib/opensearch/api/actions/get_source.rb index 438e964de..f635eb66c 100644 --- a/lib/opensearch/api/actions/get_source.rb +++ b/lib/opensearch/api/actions/get_source.rb @@ -28,8 +28,8 @@ module Actions # @option args [String] :version_type Specific version type. One of `internal`, `external`, `external_gte`. def get_source(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/index.rb b/lib/opensearch/api/actions/index.rb index 630877858..228e396b1 100644 --- a/lib/opensearch/api/actions/index.rb +++ b/lib/opensearch/api/actions/index.rb @@ -31,15 +31,15 @@ module Actions # @option args [Hash] :body *Required* The document def index(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') _id = args.delete('id') headers = args.delete('headers') || {} body = args.delete('body') - method = _id.present? ? 'PUT' : 'POST' + method = _id.nil? ? 'POST' : 'PUT' url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, INDEX_QUERY_PARAMS diff --git a/lib/opensearch/api/actions/indices/add_block.rb b/lib/opensearch/api/actions/indices/add_block.rb index c90461be1..4d160ffbc 100644 --- a/lib/opensearch/api/actions/indices/add_block.rb +++ b/lib/opensearch/api/actions/indices/add_block.rb @@ -25,8 +25,8 @@ module Actions # @option args [String] :timeout Explicit operation timeout def add_block(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'block' missing" unless args['block'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'block' missing" if args['block'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _block = args.delete('block') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/clone.rb b/lib/opensearch/api/actions/indices/clone.rb index 6e0e67ef1..3a4396cf7 100644 --- a/lib/opensearch/api/actions/indices/clone.rb +++ b/lib/opensearch/api/actions/indices/clone.rb @@ -26,8 +26,8 @@ module Actions # @option args [Hash] :body The configuration for the target index (`settings` and `aliases`) def clone(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'target' missing" unless args['target'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'target' missing" if args['target'].nil? _index = args.delete('index') _target = args.delete('target') diff --git a/lib/opensearch/api/actions/indices/close.rb b/lib/opensearch/api/actions/indices/close.rb index 02634d786..eee0a69d7 100644 --- a/lib/opensearch/api/actions/indices/close.rb +++ b/lib/opensearch/api/actions/indices/close.rb @@ -25,7 +25,7 @@ module Actions # @option args [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). def close(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/create.rb b/lib/opensearch/api/actions/indices/create.rb index 87aad172f..e9927363c 100644 --- a/lib/opensearch/api/actions/indices/create.rb +++ b/lib/opensearch/api/actions/indices/create.rb @@ -23,7 +23,7 @@ module Actions # @option args [Hash] :body The configuration for the index (`settings` and `mappings`) def create(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/create_data_stream.rb b/lib/opensearch/api/actions/indices/create_data_stream.rb index 09165bcf9..5cabd7135 100644 --- a/lib/opensearch/api/actions/indices/create_data_stream.rb +++ b/lib/opensearch/api/actions/indices/create_data_stream.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body The data stream definition def create_data_stream(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/delete.rb b/lib/opensearch/api/actions/indices/delete.rb index a2414ae35..5cc86935c 100644 --- a/lib/opensearch/api/actions/indices/delete.rb +++ b/lib/opensearch/api/actions/indices/delete.rb @@ -25,7 +25,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/delete_alias.rb b/lib/opensearch/api/actions/indices/delete_alias.rb index f048088aa..4654d4f12 100644 --- a/lib/opensearch/api/actions/indices/delete_alias.rb +++ b/lib/opensearch/api/actions/indices/delete_alias.rb @@ -23,8 +23,8 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_alias(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _index = args.delete('index') _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/delete_data_stream.rb b/lib/opensearch/api/actions/indices/delete_data_stream.rb index 7e89fee37..60b9a3129 100644 --- a/lib/opensearch/api/actions/indices/delete_data_stream.rb +++ b/lib/opensearch/api/actions/indices/delete_data_stream.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_data_stream(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/delete_index_template.rb b/lib/opensearch/api/actions/indices/delete_index_template.rb index c0aac7063..00cf4cf08 100644 --- a/lib/opensearch/api/actions/indices/delete_index_template.rb +++ b/lib/opensearch/api/actions/indices/delete_index_template.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_index_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/delete_template.rb b/lib/opensearch/api/actions/indices/delete_template.rb index 699928eb4..880a51b88 100644 --- a/lib/opensearch/api/actions/indices/delete_template.rb +++ b/lib/opensearch/api/actions/indices/delete_template.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/exists.rb b/lib/opensearch/api/actions/indices/exists.rb index f7b9f3e7c..501b3ada5 100644 --- a/lib/opensearch/api/actions/indices/exists.rb +++ b/lib/opensearch/api/actions/indices/exists.rb @@ -25,7 +25,7 @@ module Actions # @option args [Boolean] :local If `true`, the request retrieves information from the local node only. def exists(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/exists_alias.rb b/lib/opensearch/api/actions/indices/exists_alias.rb index 4a3f344e8..2f8abf8fd 100644 --- a/lib/opensearch/api/actions/indices/exists_alias.rb +++ b/lib/opensearch/api/actions/indices/exists_alias.rb @@ -23,7 +23,7 @@ module Actions # @option args [Enumerable, String] :index Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def exists_alias(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/exists_index_template.rb b/lib/opensearch/api/actions/indices/exists_index_template.rb index 67231fc7b..0ba8a2690 100644 --- a/lib/opensearch/api/actions/indices/exists_index_template.rb +++ b/lib/opensearch/api/actions/indices/exists_index_template.rb @@ -22,7 +22,7 @@ module Actions # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. def exists_index_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/exists_template.rb b/lib/opensearch/api/actions/indices/exists_template.rb index 39afc7e37..6b424502a 100644 --- a/lib/opensearch/api/actions/indices/exists_template.rb +++ b/lib/opensearch/api/actions/indices/exists_template.rb @@ -22,7 +22,7 @@ module Actions # @option args [String] :master_timeout DEPRECATED Explicit operation timeout for connection to cluster-manager node def exists_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/get.rb b/lib/opensearch/api/actions/indices/get.rb index 93ea7d5fe..f138f3085 100644 --- a/lib/opensearch/api/actions/indices/get.rb +++ b/lib/opensearch/api/actions/indices/get.rb @@ -26,7 +26,7 @@ module Actions # @option args [String] :master_timeout DEPRECATED Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/get_field_mapping.rb b/lib/opensearch/api/actions/indices/get_field_mapping.rb index bac24c53b..2ece0a6a2 100644 --- a/lib/opensearch/api/actions/indices/get_field_mapping.rb +++ b/lib/opensearch/api/actions/indices/get_field_mapping.rb @@ -24,7 +24,7 @@ module Actions # @option args [Enumerable, String] :index Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. def get_field_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'fields' missing" unless args['fields'] + raise ArgumentError, "Required argument 'fields' missing" if args['fields'].nil? _fields = args.delete('fields') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/open.rb b/lib/opensearch/api/actions/indices/open.rb index ec287a7e3..0d5a065f6 100644 --- a/lib/opensearch/api/actions/indices/open.rb +++ b/lib/opensearch/api/actions/indices/open.rb @@ -27,7 +27,7 @@ module Actions # @option args [Boolean] :wait_for_completion (default: true) Should this request wait until the operation has completed before returning. def open(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/put_alias.rb b/lib/opensearch/api/actions/indices/put_alias.rb index c43fda118..6f522a03d 100644 --- a/lib/opensearch/api/actions/indices/put_alias.rb +++ b/lib/opensearch/api/actions/indices/put_alias.rb @@ -28,7 +28,7 @@ def put_alias(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - method = _name.present? ? 'PUT' : 'POST' + method = _name.nil? ? 'POST' : 'PUT' url = [_index, '_aliases', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_ALIAS_QUERY_PARAMS diff --git a/lib/opensearch/api/actions/indices/put_index_template.rb b/lib/opensearch/api/actions/indices/put_index_template.rb index 6d4bb34c8..65a3e9a38 100644 --- a/lib/opensearch/api/actions/indices/put_index_template.rb +++ b/lib/opensearch/api/actions/indices/put_index_template.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body *Required* The template definition def put_index_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/put_mapping.rb b/lib/opensearch/api/actions/indices/put_mapping.rb index d57b216a6..9fa7109cc 100644 --- a/lib/opensearch/api/actions/indices/put_mapping.rb +++ b/lib/opensearch/api/actions/indices/put_mapping.rb @@ -26,8 +26,8 @@ module Actions # @option args [Hash] :body *Required* The mapping definition def put_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/put_settings.rb b/lib/opensearch/api/actions/indices/put_settings.rb index b7e0a5db8..0c0b2ef8f 100644 --- a/lib/opensearch/api/actions/indices/put_settings.rb +++ b/lib/opensearch/api/actions/indices/put_settings.rb @@ -27,7 +27,7 @@ module Actions # @option args [Hash] :body *Required* The index settings to be updated. def put_settings(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/indices/put_template.rb b/lib/opensearch/api/actions/indices/put_template.rb index 8bc991e65..82e4f8395 100644 --- a/lib/opensearch/api/actions/indices/put_template.rb +++ b/lib/opensearch/api/actions/indices/put_template.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body *Required* The template definition def put_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/resolve_index.rb b/lib/opensearch/api/actions/indices/resolve_index.rb index aa3af3e91..fec0c3ae2 100644 --- a/lib/opensearch/api/actions/indices/resolve_index.rb +++ b/lib/opensearch/api/actions/indices/resolve_index.rb @@ -19,7 +19,7 @@ module Actions # @option args [Enumerable, String] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. def resolve_index(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/rollover.rb b/lib/opensearch/api/actions/indices/rollover.rb index 5479a3c5d..7d1500539 100644 --- a/lib/opensearch/api/actions/indices/rollover.rb +++ b/lib/opensearch/api/actions/indices/rollover.rb @@ -26,7 +26,7 @@ module Actions # @option args [Hash] :body The conditions that needs to be met for executing rollover def rollover(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'alias' missing" unless args['alias'] + raise ArgumentError, "Required argument 'alias' missing" if args['alias'].nil? _alias = args.delete('alias') _new_index = args.delete('new_index') diff --git a/lib/opensearch/api/actions/indices/shrink.rb b/lib/opensearch/api/actions/indices/shrink.rb index 6d9f85a57..49ae98ced 100644 --- a/lib/opensearch/api/actions/indices/shrink.rb +++ b/lib/opensearch/api/actions/indices/shrink.rb @@ -27,8 +27,8 @@ module Actions # @option args [Hash] :body The configuration for the target index (`settings` and `aliases`) def shrink(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'target' missing" unless args['target'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'target' missing" if args['target'].nil? _index = args.delete('index') _target = args.delete('target') diff --git a/lib/opensearch/api/actions/indices/simulate_index_template.rb b/lib/opensearch/api/actions/indices/simulate_index_template.rb index e5d334a1e..ab708e3f0 100644 --- a/lib/opensearch/api/actions/indices/simulate_index_template.rb +++ b/lib/opensearch/api/actions/indices/simulate_index_template.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body New index template definition, which will be included in the simulation, as if it already exists in the system def simulate_index_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/indices/split.rb b/lib/opensearch/api/actions/indices/split.rb index 6f2136884..118865693 100644 --- a/lib/opensearch/api/actions/indices/split.rb +++ b/lib/opensearch/api/actions/indices/split.rb @@ -27,8 +27,8 @@ module Actions # @option args [Hash] :body The configuration for the target index (`settings` and `aliases`) def split(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'target' missing" unless args['target'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'target' missing" if args['target'].nil? _index = args.delete('index') _target = args.delete('target') diff --git a/lib/opensearch/api/actions/indices/update_aliases.rb b/lib/opensearch/api/actions/indices/update_aliases.rb index 8213a9a92..a775c2f7e 100644 --- a/lib/opensearch/api/actions/indices/update_aliases.rb +++ b/lib/opensearch/api/actions/indices/update_aliases.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body *Required* The definition of `actions` to perform def update_aliases(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/ingest/delete_pipeline.rb b/lib/opensearch/api/actions/ingest/delete_pipeline.rb index 3f690eb25..017a952ed 100644 --- a/lib/opensearch/api/actions/ingest/delete_pipeline.rb +++ b/lib/opensearch/api/actions/ingest/delete_pipeline.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_pipeline(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/ingest/put_pipeline.rb b/lib/opensearch/api/actions/ingest/put_pipeline.rb index 5b9a85004..c40582e92 100644 --- a/lib/opensearch/api/actions/ingest/put_pipeline.rb +++ b/lib/opensearch/api/actions/ingest/put_pipeline.rb @@ -22,8 +22,8 @@ module Actions # @option args [Hash] :body *Required* The ingest definition def put_pipeline(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/ingest/simulate.rb b/lib/opensearch/api/actions/ingest/simulate.rb index 0cb4c4ae7..900434169 100644 --- a/lib/opensearch/api/actions/ingest/simulate.rb +++ b/lib/opensearch/api/actions/ingest/simulate.rb @@ -20,7 +20,7 @@ module Actions # @option args [Hash] :body *Required* The simulate definition def simulate(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/insights/top_queries.rb b/lib/opensearch/api/actions/insights/top_queries.rb index 887ea6c19..91ac64fc0 100644 --- a/lib/opensearch/api/actions/insights/top_queries.rb +++ b/lib/opensearch/api/actions/insights/top_queries.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :type *Required* Get top n queries by a specific metric. def top_queries(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'type' missing" unless args['type'] + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/ism/add_policy.rb b/lib/opensearch/api/actions/ism/add_policy.rb index b8140e85f..e23e8f292 100644 --- a/lib/opensearch/api/actions/ism/add_policy.rb +++ b/lib/opensearch/api/actions/ism/add_policy.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def add_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/ism/change_policy.rb b/lib/opensearch/api/actions/ism/change_policy.rb index 2780051c8..2447d08f5 100644 --- a/lib/opensearch/api/actions/ism/change_policy.rb +++ b/lib/opensearch/api/actions/ism/change_policy.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def change_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/ism/delete_policy.rb b/lib/opensearch/api/actions/ism/delete_policy.rb index f7d056ccb..c66f9767d 100644 --- a/lib/opensearch/api/actions/ism/delete_policy.rb +++ b/lib/opensearch/api/actions/ism/delete_policy.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_id' missing" unless args['policy_id'] + raise ArgumentError, "Required argument 'policy_id' missing" if args['policy_id'].nil? _policy_id = args.delete('policy_id') diff --git a/lib/opensearch/api/actions/ism/exists_policy.rb b/lib/opensearch/api/actions/ism/exists_policy.rb index 138a5ba72..039914980 100644 --- a/lib/opensearch/api/actions/ism/exists_policy.rb +++ b/lib/opensearch/api/actions/ism/exists_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_id *Required* def exists_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_id' missing" unless args['policy_id'] + raise ArgumentError, "Required argument 'policy_id' missing" if args['policy_id'].nil? _policy_id = args.delete('policy_id') diff --git a/lib/opensearch/api/actions/ism/get_policy.rb b/lib/opensearch/api/actions/ism/get_policy.rb index 6bf8c3a5a..1f8a66de3 100644 --- a/lib/opensearch/api/actions/ism/get_policy.rb +++ b/lib/opensearch/api/actions/ism/get_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_id *Required* def get_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_id' missing" unless args['policy_id'] + raise ArgumentError, "Required argument 'policy_id' missing" if args['policy_id'].nil? _policy_id = args.delete('policy_id') diff --git a/lib/opensearch/api/actions/ism/put_policies.rb b/lib/opensearch/api/actions/ism/put_policies.rb index f1a335461..05af87024 100644 --- a/lib/opensearch/api/actions/ism/put_policies.rb +++ b/lib/opensearch/api/actions/ism/put_policies.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body def put_policies(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policyID' missing" unless args['policyID'] + raise ArgumentError, "Required argument 'policyID' missing" if args['policyID'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/ism/put_policy.rb b/lib/opensearch/api/actions/ism/put_policy.rb index 15ba3066a..fcda1db2c 100644 --- a/lib/opensearch/api/actions/ism/put_policy.rb +++ b/lib/opensearch/api/actions/ism/put_policy.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body def put_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_id' missing" unless args['policy_id'] + raise ArgumentError, "Required argument 'policy_id' missing" if args['policy_id'].nil? _policy_id = args.delete('policy_id') diff --git a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb index 48ab5f669..fe51f6b31 100644 --- a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb +++ b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :index *Required* Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). def refresh_search_analyzers(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/ism/remove_policy.rb b/lib/opensearch/api/actions/ism/remove_policy.rb index 31ce05042..c80a5d39b 100644 --- a/lib/opensearch/api/actions/ism/remove_policy.rb +++ b/lib/opensearch/api/actions/ism/remove_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :index *Required* Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). def remove_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/ism/retry_index.rb b/lib/opensearch/api/actions/ism/retry_index.rb index 946744f56..9af024f50 100644 --- a/lib/opensearch/api/actions/ism/retry_index.rb +++ b/lib/opensearch/api/actions/ism/retry_index.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def retry_index(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/knn/delete_model.rb b/lib/opensearch/api/actions/knn/delete_model.rb index c5966be79..05dc526cb 100644 --- a/lib/opensearch/api/actions/knn/delete_model.rb +++ b/lib/opensearch/api/actions/knn/delete_model.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_model(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" unless args['model_id'] + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? _model_id = args.delete('model_id') diff --git a/lib/opensearch/api/actions/knn/get_model.rb b/lib/opensearch/api/actions/knn/get_model.rb index f67278bd4..d3dbbcdeb 100644 --- a/lib/opensearch/api/actions/knn/get_model.rb +++ b/lib/opensearch/api/actions/knn/get_model.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :model_id *Required* The id of the model. def get_model(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" unless args['model_id'] + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? _model_id = args.delete('model_id') diff --git a/lib/opensearch/api/actions/knn/warmup.rb b/lib/opensearch/api/actions/knn/warmup.rb index 47e807124..34aa3c117 100644 --- a/lib/opensearch/api/actions/knn/warmup.rb +++ b/lib/opensearch/api/actions/knn/warmup.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :index *Required* Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. def warmup(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/mget.rb b/lib/opensearch/api/actions/mget.rb index 41b15edba..cbf226e0a 100644 --- a/lib/opensearch/api/actions/mget.rb +++ b/lib/opensearch/api/actions/mget.rb @@ -27,7 +27,7 @@ module Actions # @option args [Hash] :body *Required* Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. def mget(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/ml/delete_agent.rb b/lib/opensearch/api/actions/ml/delete_agent.rb index a91b2e7ef..249493e32 100644 --- a/lib/opensearch/api/actions/ml/delete_agent.rb +++ b/lib/opensearch/api/actions/ml/delete_agent.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_agent(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'agent_id' missing" unless args['agent_id'] + raise ArgumentError, "Required argument 'agent_id' missing" if args['agent_id'].nil? _agent_id = args.delete('agent_id') diff --git a/lib/opensearch/api/actions/ml/delete_connector.rb b/lib/opensearch/api/actions/ml/delete_connector.rb index a53a96d08..a03f4f84b 100644 --- a/lib/opensearch/api/actions/ml/delete_connector.rb +++ b/lib/opensearch/api/actions/ml/delete_connector.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_connector(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'connector_id' missing" unless args['connector_id'] + raise ArgumentError, "Required argument 'connector_id' missing" if args['connector_id'].nil? _connector_id = args.delete('connector_id') diff --git a/lib/opensearch/api/actions/ml/delete_model.rb b/lib/opensearch/api/actions/ml/delete_model.rb index f0e9a4f5a..9d0ec0af7 100644 --- a/lib/opensearch/api/actions/ml/delete_model.rb +++ b/lib/opensearch/api/actions/ml/delete_model.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_model(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" unless args['model_id'] + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? _model_id = args.delete('model_id') diff --git a/lib/opensearch/api/actions/ml/delete_model_group.rb b/lib/opensearch/api/actions/ml/delete_model_group.rb index e2df59500..a3592fe90 100644 --- a/lib/opensearch/api/actions/ml/delete_model_group.rb +++ b/lib/opensearch/api/actions/ml/delete_model_group.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_model_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_group_id' missing" unless args['model_group_id'] + raise ArgumentError, "Required argument 'model_group_id' missing" if args['model_group_id'].nil? _model_group_id = args.delete('model_group_id') diff --git a/lib/opensearch/api/actions/ml/delete_task.rb b/lib/opensearch/api/actions/ml/delete_task.rb index 7f17fb5e6..8289a6332 100644 --- a/lib/opensearch/api/actions/ml/delete_task.rb +++ b/lib/opensearch/api/actions/ml/delete_task.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_task(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/ml/deploy_model.rb b/lib/opensearch/api/actions/ml/deploy_model.rb index 0eb6efa0b..482a86ad3 100644 --- a/lib/opensearch/api/actions/ml/deploy_model.rb +++ b/lib/opensearch/api/actions/ml/deploy_model.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :model_id *Required* def deploy_model(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" unless args['model_id'] + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? _model_id = args.delete('model_id') diff --git a/lib/opensearch/api/actions/ml/get_model_group.rb b/lib/opensearch/api/actions/ml/get_model_group.rb index 7790dd648..1de29e51d 100644 --- a/lib/opensearch/api/actions/ml/get_model_group.rb +++ b/lib/opensearch/api/actions/ml/get_model_group.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :model_group_id *Required* def get_model_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_group_id' missing" unless args['model_group_id'] + raise ArgumentError, "Required argument 'model_group_id' missing" if args['model_group_id'].nil? _model_group_id = args.delete('model_group_id') diff --git a/lib/opensearch/api/actions/ml/get_task.rb b/lib/opensearch/api/actions/ml/get_task.rb index 5b8a722a4..0a2de7ee3 100644 --- a/lib/opensearch/api/actions/ml/get_task.rb +++ b/lib/opensearch/api/actions/ml/get_task.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :task_id *Required* def get_task(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/ml/undeploy_model.rb b/lib/opensearch/api/actions/ml/undeploy_model.rb index 12f1fa17f..61d730ff8 100644 --- a/lib/opensearch/api/actions/ml/undeploy_model.rb +++ b/lib/opensearch/api/actions/ml/undeploy_model.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :model_id *Required* def undeploy_model(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'model_id' missing" unless args['model_id'] + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? _model_id = args.delete('model_id') diff --git a/lib/opensearch/api/actions/msearch.rb b/lib/opensearch/api/actions/msearch.rb index 987f5c53f..c9b2ae28d 100644 --- a/lib/opensearch/api/actions/msearch.rb +++ b/lib/opensearch/api/actions/msearch.rb @@ -26,7 +26,7 @@ module Actions # @option args [Enumerable] :body *Required* The request definitions (metadata-search request definition pairs), separated by newlines def msearch(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/msearch_template.rb b/lib/opensearch/api/actions/msearch_template.rb index 02ecabeb2..950d9c5a1 100644 --- a/lib/opensearch/api/actions/msearch_template.rb +++ b/lib/opensearch/api/actions/msearch_template.rb @@ -24,7 +24,7 @@ module Actions # @option args [Enumerable] :body *Required* The request definitions (metadata-search request definition pairs), separated by newlines def msearch_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/notifications/create_config.rb b/lib/opensearch/api/actions/notifications/create_config.rb index e24a1c8ae..baff56dac 100644 --- a/lib/opensearch/api/actions/notifications/create_config.rb +++ b/lib/opensearch/api/actions/notifications/create_config.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def create_config(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/notifications/delete_config.rb b/lib/opensearch/api/actions/notifications/delete_config.rb index d7190d229..5aa1276c6 100644 --- a/lib/opensearch/api/actions/notifications/delete_config.rb +++ b/lib/opensearch/api/actions/notifications/delete_config.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_config(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'config_id' missing" unless args['config_id'] + raise ArgumentError, "Required argument 'config_id' missing" if args['config_id'].nil? _config_id = args.delete('config_id') diff --git a/lib/opensearch/api/actions/notifications/delete_configs.rb b/lib/opensearch/api/actions/notifications/delete_configs.rb index 6cd7244b2..3c6143b38 100644 --- a/lib/opensearch/api/actions/notifications/delete_configs.rb +++ b/lib/opensearch/api/actions/notifications/delete_configs.rb @@ -20,7 +20,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_configs(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'config_id' missing" unless args['config_id'] + raise ArgumentError, "Required argument 'config_id' missing" if args['config_id'].nil? ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/notifications/get_config.rb b/lib/opensearch/api/actions/notifications/get_config.rb index 046cbf384..16718a19b 100644 --- a/lib/opensearch/api/actions/notifications/get_config.rb +++ b/lib/opensearch/api/actions/notifications/get_config.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :config_id *Required* def get_config(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'config_id' missing" unless args['config_id'] + raise ArgumentError, "Required argument 'config_id' missing" if args['config_id'].nil? _config_id = args.delete('config_id') diff --git a/lib/opensearch/api/actions/notifications/send_test.rb b/lib/opensearch/api/actions/notifications/send_test.rb index 686b39902..04e182ea5 100644 --- a/lib/opensearch/api/actions/notifications/send_test.rb +++ b/lib/opensearch/api/actions/notifications/send_test.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :config_id *Required* def send_test(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'config_id' missing" unless args['config_id'] + raise ArgumentError, "Required argument 'config_id' missing" if args['config_id'].nil? _config_id = args.delete('config_id') diff --git a/lib/opensearch/api/actions/notifications/update_config.rb b/lib/opensearch/api/actions/notifications/update_config.rb index 0ed1b027e..32e63144c 100644 --- a/lib/opensearch/api/actions/notifications/update_config.rb +++ b/lib/opensearch/api/actions/notifications/update_config.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def update_config(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'config_id' missing" unless args['config_id'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'config_id' missing" if args['config_id'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _config_id = args.delete('config_id') diff --git a/lib/opensearch/api/actions/observability/delete_object.rb b/lib/opensearch/api/actions/observability/delete_object.rb index 6b82d0dc8..c1934aa8a 100644 --- a/lib/opensearch/api/actions/observability/delete_object.rb +++ b/lib/opensearch/api/actions/observability/delete_object.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_object(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'object_id' missing" unless args['object_id'] + raise ArgumentError, "Required argument 'object_id' missing" if args['object_id'].nil? _object_id = args.delete('object_id') diff --git a/lib/opensearch/api/actions/observability/get_object.rb b/lib/opensearch/api/actions/observability/get_object.rb index 32c80fe29..3c1c121e8 100644 --- a/lib/opensearch/api/actions/observability/get_object.rb +++ b/lib/opensearch/api/actions/observability/get_object.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :object_id *Required* The ID of the Observability Object. def get_object(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'object_id' missing" unless args['object_id'] + raise ArgumentError, "Required argument 'object_id' missing" if args['object_id'].nil? _object_id = args.delete('object_id') diff --git a/lib/opensearch/api/actions/observability/update_object.rb b/lib/opensearch/api/actions/observability/update_object.rb index 86dc04fe2..23c68a918 100644 --- a/lib/opensearch/api/actions/observability/update_object.rb +++ b/lib/opensearch/api/actions/observability/update_object.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def update_object(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'object_id' missing" unless args['object_id'] + raise ArgumentError, "Required argument 'object_id' missing" if args['object_id'].nil? _object_id = args.delete('object_id') diff --git a/lib/opensearch/api/actions/ppl/explain.rb b/lib/opensearch/api/actions/ppl/explain.rb index ba52f1a09..99b1ff5a7 100644 --- a/lib/opensearch/api/actions/ppl/explain.rb +++ b/lib/opensearch/api/actions/ppl/explain.rb @@ -20,7 +20,7 @@ module Actions # @option args [Hash] :body *Required* def explain(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/ppl/post_stats.rb b/lib/opensearch/api/actions/ppl/post_stats.rb index d33fe8197..3ec284d7b 100644 --- a/lib/opensearch/api/actions/ppl/post_stats.rb +++ b/lib/opensearch/api/actions/ppl/post_stats.rb @@ -20,7 +20,7 @@ module Actions # @option args [Hash] :body *Required* def post_stats(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/ppl/query.rb b/lib/opensearch/api/actions/ppl/query.rb index 6a2d49032..b36bb7669 100644 --- a/lib/opensearch/api/actions/ppl/query.rb +++ b/lib/opensearch/api/actions/ppl/query.rb @@ -20,7 +20,7 @@ module Actions # @option args [Hash] :body *Required* def query(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/put_script.rb b/lib/opensearch/api/actions/put_script.rb index 328c199c4..4bbee1c09 100644 --- a/lib/opensearch/api/actions/put_script.rb +++ b/lib/opensearch/api/actions/put_script.rb @@ -23,15 +23,15 @@ module Actions # @option args [Hash] :body *Required* The document def put_script(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') _context = args.delete('context') headers = args.delete('headers') || {} body = args.delete('body') - method = _context.present? ? 'PUT' : 'POST' + method = _context.nil? ? 'POST' : 'PUT' url = ['_scripts', _id, _context].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_SCRIPT_QUERY_PARAMS diff --git a/lib/opensearch/api/actions/query/datasource_delete.rb b/lib/opensearch/api/actions/query/datasource_delete.rb index 74582a1a2..71b5f38c3 100644 --- a/lib/opensearch/api/actions/query/datasource_delete.rb +++ b/lib/opensearch/api/actions/query/datasource_delete.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def datasource_delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'datasource_name' missing" unless args['datasource_name'] + raise ArgumentError, "Required argument 'datasource_name' missing" if args['datasource_name'].nil? _datasource_name = args.delete('datasource_name') diff --git a/lib/opensearch/api/actions/query/datasource_retrieve.rb b/lib/opensearch/api/actions/query/datasource_retrieve.rb index 232225e8d..b838b4c83 100644 --- a/lib/opensearch/api/actions/query/datasource_retrieve.rb +++ b/lib/opensearch/api/actions/query/datasource_retrieve.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :datasource_name *Required* The Name of the DataSource to retrieve. def datasource_retrieve(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'datasource_name' missing" unless args['datasource_name'] + raise ArgumentError, "Required argument 'datasource_name' missing" if args['datasource_name'].nil? _datasource_name = args.delete('datasource_name') diff --git a/lib/opensearch/api/actions/rank_eval.rb b/lib/opensearch/api/actions/rank_eval.rb index 4560f681d..b377081f2 100644 --- a/lib/opensearch/api/actions/rank_eval.rb +++ b/lib/opensearch/api/actions/rank_eval.rb @@ -23,7 +23,7 @@ module Actions # @option args [Hash] :body *Required* The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. def rank_eval(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/reindex.rb b/lib/opensearch/api/actions/reindex.rb index 01757b330..e492a9faa 100644 --- a/lib/opensearch/api/actions/reindex.rb +++ b/lib/opensearch/api/actions/reindex.rb @@ -28,7 +28,7 @@ module Actions # @option args [Hash] :body *Required* The search definition using the Query DSL and the prototype for the index request. def reindex(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/reindex_rethrottle.rb b/lib/opensearch/api/actions/reindex_rethrottle.rb index bda97d349..00ab34309 100644 --- a/lib/opensearch/api/actions/reindex_rethrottle.rb +++ b/lib/opensearch/api/actions/reindex_rethrottle.rb @@ -19,7 +19,7 @@ module Actions # @option args [Float] :requests_per_second The throttle for this request in sub-requests per second. def reindex_rethrottle(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/remote_store/restore.rb b/lib/opensearch/api/actions/remote_store/restore.rb index e7cc4f9fd..993895cc4 100644 --- a/lib/opensearch/api/actions/remote_store/restore.rb +++ b/lib/opensearch/api/actions/remote_store/restore.rb @@ -20,7 +20,7 @@ module Actions # @option args [Hash] :body *Required* Comma-separated list of index IDs def restore(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/replication/create_replication_rule.rb b/lib/opensearch/api/actions/replication/create_replication_rule.rb index 744fd54cc..7d8b2066c 100644 --- a/lib/opensearch/api/actions/replication/create_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/create_replication_rule.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def create_replication_rule(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/replication/delete_replication_rule.rb b/lib/opensearch/api/actions/replication/delete_replication_rule.rb index 507990da0..6bc11ea21 100644 --- a/lib/opensearch/api/actions/replication/delete_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/delete_replication_rule.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_replication_rule(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/replication/pause.rb b/lib/opensearch/api/actions/replication/pause.rb index 18fd6e997..8c3e25ea5 100644 --- a/lib/opensearch/api/actions/replication/pause.rb +++ b/lib/opensearch/api/actions/replication/pause.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def pause(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/replication/resume.rb b/lib/opensearch/api/actions/replication/resume.rb index 3c9bdccf5..d2ba10fde 100644 --- a/lib/opensearch/api/actions/replication/resume.rb +++ b/lib/opensearch/api/actions/replication/resume.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def resume(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/replication/start.rb b/lib/opensearch/api/actions/replication/start.rb index 38b672b9c..6f65f0d7e 100644 --- a/lib/opensearch/api/actions/replication/start.rb +++ b/lib/opensearch/api/actions/replication/start.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def start(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/replication/status.rb b/lib/opensearch/api/actions/replication/status.rb index 2bc1acdf2..16df6d1a8 100644 --- a/lib/opensearch/api/actions/replication/status.rb +++ b/lib/opensearch/api/actions/replication/status.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :index *Required* Name of the data stream, index, or index alias to perform bulk actions on. def status(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/replication/stop.rb b/lib/opensearch/api/actions/replication/stop.rb index 689eef165..d727935df 100644 --- a/lib/opensearch/api/actions/replication/stop.rb +++ b/lib/opensearch/api/actions/replication/stop.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def stop(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/replication/update_settings.rb b/lib/opensearch/api/actions/replication/update_settings.rb index 92825d098..a251337d9 100644 --- a/lib/opensearch/api/actions/replication/update_settings.rb +++ b/lib/opensearch/api/actions/replication/update_settings.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def update_settings(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/rollups/delete.rb b/lib/opensearch/api/actions/rollups/delete.rb index a42973082..34b2c1f0c 100644 --- a/lib/opensearch/api/actions/rollups/delete.rb +++ b/lib/opensearch/api/actions/rollups/delete.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/rollups/explain.rb b/lib/opensearch/api/actions/rollups/explain.rb index ef5711049..19d4f04cb 100644 --- a/lib/opensearch/api/actions/rollups/explain.rb +++ b/lib/opensearch/api/actions/rollups/explain.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Rollup to access def explain(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/rollups/get.rb b/lib/opensearch/api/actions/rollups/get.rb index 76db91e22..e6334a54d 100644 --- a/lib/opensearch/api/actions/rollups/get.rb +++ b/lib/opensearch/api/actions/rollups/get.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Rollup to access def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/rollups/put.rb b/lib/opensearch/api/actions/rollups/put.rb index df9e47764..dbfbc3371 100644 --- a/lib/opensearch/api/actions/rollups/put.rb +++ b/lib/opensearch/api/actions/rollups/put.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body def put(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/rollups/start.rb b/lib/opensearch/api/actions/rollups/start.rb index 4bae7cdf4..1beb73918 100644 --- a/lib/opensearch/api/actions/rollups/start.rb +++ b/lib/opensearch/api/actions/rollups/start.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Rollup to access def start(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/rollups/stop.rb b/lib/opensearch/api/actions/rollups/stop.rb index a00b67771..ef1cdf372 100644 --- a/lib/opensearch/api/actions/rollups/stop.rb +++ b/lib/opensearch/api/actions/rollups/stop.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Rollup to access def stop(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/search_pipeline/delete.rb b/lib/opensearch/api/actions/search_pipeline/delete.rb index d97f522db..713dc1dde 100644 --- a/lib/opensearch/api/actions/search_pipeline/delete.rb +++ b/lib/opensearch/api/actions/search_pipeline/delete.rb @@ -21,7 +21,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/search_pipeline/put.rb b/lib/opensearch/api/actions/search_pipeline/put.rb index 00d687040..36a0ff34d 100644 --- a/lib/opensearch/api/actions/search_pipeline/put.rb +++ b/lib/opensearch/api/actions/search_pipeline/put.rb @@ -21,8 +21,8 @@ module Actions # @option args [Hash] :body *Required* def put(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/search_template.rb b/lib/opensearch/api/actions/search_template.rb index c6b713168..e7e324330 100644 --- a/lib/opensearch/api/actions/search_template.rb +++ b/lib/opensearch/api/actions/search_template.rb @@ -32,7 +32,7 @@ module Actions # @option args [Hash] :body *Required* The search definition template and its parameters. def search_template(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/security/change_password.rb b/lib/opensearch/api/actions/security/change_password.rb index 5f4e47910..bdbbbfd1a 100644 --- a/lib/opensearch/api/actions/security/change_password.rb +++ b/lib/opensearch/api/actions/security/change_password.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def change_password(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/create_action_group.rb b/lib/opensearch/api/actions/security/create_action_group.rb index f04a892d1..50b2b52f2 100644 --- a/lib/opensearch/api/actions/security/create_action_group.rb +++ b/lib/opensearch/api/actions/security/create_action_group.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_action_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'action_group' missing" unless args['action_group'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'action_group' missing" if args['action_group'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _action_group = args.delete('action_group') diff --git a/lib/opensearch/api/actions/security/create_allowlist.rb b/lib/opensearch/api/actions/security/create_allowlist.rb index a439124d3..22e263899 100644 --- a/lib/opensearch/api/actions/security/create_allowlist.rb +++ b/lib/opensearch/api/actions/security/create_allowlist.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def create_allowlist(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/create_role.rb b/lib/opensearch/api/actions/security/create_role.rb index 7b2db875e..783f7fc44 100644 --- a/lib/opensearch/api/actions/security/create_role.rb +++ b/lib/opensearch/api/actions/security/create_role.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_role(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/create_role_mapping.rb b/lib/opensearch/api/actions/security/create_role_mapping.rb index 298f1e677..c30acdea2 100644 --- a/lib/opensearch/api/actions/security/create_role_mapping.rb +++ b/lib/opensearch/api/actions/security/create_role_mapping.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_role_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/create_tenant.rb b/lib/opensearch/api/actions/security/create_tenant.rb index 41610e047..a205fc3d7 100644 --- a/lib/opensearch/api/actions/security/create_tenant.rb +++ b/lib/opensearch/api/actions/security/create_tenant.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_tenant(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'tenant' missing" unless args['tenant'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'tenant' missing" if args['tenant'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _tenant = args.delete('tenant') 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 66b1dffc3..16bed226d 100644 --- a/lib/opensearch/api/actions/security/create_update_tenancy_config.rb +++ b/lib/opensearch/api/actions/security/create_update_tenancy_config.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def create_update_tenancy_config(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/create_user.rb b/lib/opensearch/api/actions/security/create_user.rb index 994c5b57a..d0b66478a 100644 --- a/lib/opensearch/api/actions/security/create_user.rb +++ b/lib/opensearch/api/actions/security/create_user.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_user(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/create_user_legacy.rb b/lib/opensearch/api/actions/security/create_user_legacy.rb index 472265894..a5dfff390 100644 --- a/lib/opensearch/api/actions/security/create_user_legacy.rb +++ b/lib/opensearch/api/actions/security/create_user_legacy.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def create_user_legacy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/delete_action_group.rb b/lib/opensearch/api/actions/security/delete_action_group.rb index ed7b6d828..2aed771e0 100644 --- a/lib/opensearch/api/actions/security/delete_action_group.rb +++ b/lib/opensearch/api/actions/security/delete_action_group.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_action_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'action_group' missing" unless args['action_group'] + raise ArgumentError, "Required argument 'action_group' missing" if args['action_group'].nil? _action_group = args.delete('action_group') diff --git a/lib/opensearch/api/actions/security/delete_distinguished_name.rb b/lib/opensearch/api/actions/security/delete_distinguished_name.rb index 4816423c5..19a975faf 100644 --- a/lib/opensearch/api/actions/security/delete_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/delete_distinguished_name.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_distinguished_name(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'cluster_name' missing" unless args['cluster_name'] + raise ArgumentError, "Required argument 'cluster_name' missing" if args['cluster_name'].nil? _cluster_name = args.delete('cluster_name') diff --git a/lib/opensearch/api/actions/security/delete_role.rb b/lib/opensearch/api/actions/security/delete_role.rb index 04433b3ca..33cdb3acf 100644 --- a/lib/opensearch/api/actions/security/delete_role.rb +++ b/lib/opensearch/api/actions/security/delete_role.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_role(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/delete_role_mapping.rb b/lib/opensearch/api/actions/security/delete_role_mapping.rb index 5389c79b2..13c86a7a2 100644 --- a/lib/opensearch/api/actions/security/delete_role_mapping.rb +++ b/lib/opensearch/api/actions/security/delete_role_mapping.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_role_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/delete_tenant.rb b/lib/opensearch/api/actions/security/delete_tenant.rb index fb433f3de..d403c89d6 100644 --- a/lib/opensearch/api/actions/security/delete_tenant.rb +++ b/lib/opensearch/api/actions/security/delete_tenant.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_tenant(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'tenant' missing" unless args['tenant'] + raise ArgumentError, "Required argument 'tenant' missing" if args['tenant'].nil? _tenant = args.delete('tenant') diff --git a/lib/opensearch/api/actions/security/delete_user.rb b/lib/opensearch/api/actions/security/delete_user.rb index a09e6d901..992d47e0b 100644 --- a/lib/opensearch/api/actions/security/delete_user.rb +++ b/lib/opensearch/api/actions/security/delete_user.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_user(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/delete_user_legacy.rb b/lib/opensearch/api/actions/security/delete_user_legacy.rb index e5a810107..8858fb066 100644 --- a/lib/opensearch/api/actions/security/delete_user_legacy.rb +++ b/lib/opensearch/api/actions/security/delete_user_legacy.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_user_legacy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/generate_obo_token.rb b/lib/opensearch/api/actions/security/generate_obo_token.rb index 965e81a25..dc933f77c 100644 --- a/lib/opensearch/api/actions/security/generate_obo_token.rb +++ b/lib/opensearch/api/actions/security/generate_obo_token.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def generate_obo_token(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/generate_user_token.rb b/lib/opensearch/api/actions/security/generate_user_token.rb index 3adb4bc98..94cd7c170 100644 --- a/lib/opensearch/api/actions/security/generate_user_token.rb +++ b/lib/opensearch/api/actions/security/generate_user_token.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :username *Required* The name of the user for whom an auth token is to be vended. def generate_user_token(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') 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 dc0513a40..5883725e1 100644 --- a/lib/opensearch/api/actions/security/generate_user_token_legacy.rb +++ b/lib/opensearch/api/actions/security/generate_user_token_legacy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :username *Required* The name of the user for whom an auth token is to be vended. def generate_user_token_legacy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/get_action_group.rb b/lib/opensearch/api/actions/security/get_action_group.rb index 0b820a977..43067a24a 100644 --- a/lib/opensearch/api/actions/security/get_action_group.rb +++ b/lib/opensearch/api/actions/security/get_action_group.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :action_group *Required* The name of the action group to retrieve. def get_action_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'action_group' missing" unless args['action_group'] + raise ArgumentError, "Required argument 'action_group' missing" if args['action_group'].nil? _action_group = args.delete('action_group') diff --git a/lib/opensearch/api/actions/security/get_distinguished_name.rb b/lib/opensearch/api/actions/security/get_distinguished_name.rb index 50b17bb8a..88cf879a2 100644 --- a/lib/opensearch/api/actions/security/get_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/get_distinguished_name.rb @@ -19,7 +19,7 @@ module Actions # @option args [Boolean] :show_all A Boolean flag to include/exclude static nodes DN from final result. def get_distinguished_name(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'cluster_name' missing" unless args['cluster_name'] + raise ArgumentError, "Required argument 'cluster_name' missing" if args['cluster_name'].nil? _cluster_name = args.delete('cluster_name') diff --git a/lib/opensearch/api/actions/security/get_node_certificates.rb b/lib/opensearch/api/actions/security/get_node_certificates.rb index 6d3be1f72..6c78c963b 100644 --- a/lib/opensearch/api/actions/security/get_node_certificates.rb +++ b/lib/opensearch/api/actions/security/get_node_certificates.rb @@ -20,7 +20,7 @@ module Actions # @option args [String] :timeout The maximum duration, in seconds, to be spent to retrieve a node's certificates. def get_node_certificates(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'node_id' missing" unless args['node_id'] + raise ArgumentError, "Required argument 'node_id' missing" if args['node_id'].nil? _node_id = args.delete('node_id') diff --git a/lib/opensearch/api/actions/security/get_role.rb b/lib/opensearch/api/actions/security/get_role.rb index 906c46dba..8c08a5e95 100644 --- a/lib/opensearch/api/actions/security/get_role.rb +++ b/lib/opensearch/api/actions/security/get_role.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :role *Required* def get_role(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/get_role_mapping.rb b/lib/opensearch/api/actions/security/get_role_mapping.rb index 438b9d9a9..0f5552345 100644 --- a/lib/opensearch/api/actions/security/get_role_mapping.rb +++ b/lib/opensearch/api/actions/security/get_role_mapping.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :role *Required* def get_role_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/get_tenant.rb b/lib/opensearch/api/actions/security/get_tenant.rb index ac38b76e3..f8725a050 100644 --- a/lib/opensearch/api/actions/security/get_tenant.rb +++ b/lib/opensearch/api/actions/security/get_tenant.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :tenant *Required* The name of the tenant to retrieve. def get_tenant(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'tenant' missing" unless args['tenant'] + raise ArgumentError, "Required argument 'tenant' missing" if args['tenant'].nil? _tenant = args.delete('tenant') diff --git a/lib/opensearch/api/actions/security/get_user.rb b/lib/opensearch/api/actions/security/get_user.rb index 29cc4f46a..67ee9c2f8 100644 --- a/lib/opensearch/api/actions/security/get_user.rb +++ b/lib/opensearch/api/actions/security/get_user.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :username *Required* The name of the user to retrieve. def get_user(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/get_user_legacy.rb b/lib/opensearch/api/actions/security/get_user_legacy.rb index 008bd5487..a050a53bb 100644 --- a/lib/opensearch/api/actions/security/get_user_legacy.rb +++ b/lib/opensearch/api/actions/security/get_user_legacy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :username *Required* The name of the user to retrieve. def get_user_legacy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/patch_action_group.rb b/lib/opensearch/api/actions/security/patch_action_group.rb index fc408fcae..1d3dbb753 100644 --- a/lib/opensearch/api/actions/security/patch_action_group.rb +++ b/lib/opensearch/api/actions/security/patch_action_group.rb @@ -19,8 +19,8 @@ module Actions # @option args [Enumerable] :body *Required* def patch_action_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'action_group' missing" unless args['action_group'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'action_group' missing" if args['action_group'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _action_group = args.delete('action_group') diff --git a/lib/opensearch/api/actions/security/patch_action_groups.rb b/lib/opensearch/api/actions/security/patch_action_groups.rb index bdd2d6ec3..0ca7f091e 100644 --- a/lib/opensearch/api/actions/security/patch_action_groups.rb +++ b/lib/opensearch/api/actions/security/patch_action_groups.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_action_groups(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_allowlist.rb b/lib/opensearch/api/actions/security/patch_allowlist.rb index 2447a2357..b29aa7c9a 100644 --- a/lib/opensearch/api/actions/security/patch_allowlist.rb +++ b/lib/opensearch/api/actions/security/patch_allowlist.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_allowlist(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_audit_configuration.rb b/lib/opensearch/api/actions/security/patch_audit_configuration.rb index d22ab1b19..57b244b31 100644 --- a/lib/opensearch/api/actions/security/patch_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_audit_configuration.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_audit_configuration(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_configuration.rb b/lib/opensearch/api/actions/security/patch_configuration.rb index 1f5467efc..5f3c253b6 100644 --- a/lib/opensearch/api/actions/security/patch_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_configuration.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_configuration(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_distinguished_name.rb b/lib/opensearch/api/actions/security/patch_distinguished_name.rb index 3fd9cafc5..ba4dad644 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_name.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def patch_distinguished_name(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'cluster_name' missing" unless args['cluster_name'] + raise ArgumentError, "Required argument 'cluster_name' missing" if args['cluster_name'].nil? _cluster_name = args.delete('cluster_name') diff --git a/lib/opensearch/api/actions/security/patch_distinguished_names.rb b/lib/opensearch/api/actions/security/patch_distinguished_names.rb index 070b5fc16..f28b2a1bc 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_names.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_names.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_distinguished_names(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_role.rb b/lib/opensearch/api/actions/security/patch_role.rb index f5e007e42..1dd9b0432 100644 --- a/lib/opensearch/api/actions/security/patch_role.rb +++ b/lib/opensearch/api/actions/security/patch_role.rb @@ -19,8 +19,8 @@ module Actions # @option args [Enumerable] :body *Required* def patch_role(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/patch_role_mapping.rb b/lib/opensearch/api/actions/security/patch_role_mapping.rb index 7758ed581..45e33109a 100644 --- a/lib/opensearch/api/actions/security/patch_role_mapping.rb +++ b/lib/opensearch/api/actions/security/patch_role_mapping.rb @@ -19,8 +19,8 @@ module Actions # @option args [Enumerable] :body *Required* def patch_role_mapping(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'role' missing" unless args['role'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'role' missing" if args['role'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _role = args.delete('role') diff --git a/lib/opensearch/api/actions/security/patch_role_mappings.rb b/lib/opensearch/api/actions/security/patch_role_mappings.rb index dd8336718..bb2f7bc57 100644 --- a/lib/opensearch/api/actions/security/patch_role_mappings.rb +++ b/lib/opensearch/api/actions/security/patch_role_mappings.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_role_mappings(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_roles.rb b/lib/opensearch/api/actions/security/patch_roles.rb index 2d3c40a50..447ee74df 100644 --- a/lib/opensearch/api/actions/security/patch_roles.rb +++ b/lib/opensearch/api/actions/security/patch_roles.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_roles(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_tenant.rb b/lib/opensearch/api/actions/security/patch_tenant.rb index 8aa56a414..18a282939 100644 --- a/lib/opensearch/api/actions/security/patch_tenant.rb +++ b/lib/opensearch/api/actions/security/patch_tenant.rb @@ -19,8 +19,8 @@ module Actions # @option args [Enumerable] :body *Required* def patch_tenant(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'tenant' missing" unless args['tenant'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'tenant' missing" if args['tenant'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _tenant = args.delete('tenant') diff --git a/lib/opensearch/api/actions/security/patch_tenants.rb b/lib/opensearch/api/actions/security/patch_tenants.rb index a80f08ac5..556b2b467 100644 --- a/lib/opensearch/api/actions/security/patch_tenants.rb +++ b/lib/opensearch/api/actions/security/patch_tenants.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_tenants(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/patch_user.rb b/lib/opensearch/api/actions/security/patch_user.rb index c90c9bc85..c4fe803b8 100644 --- a/lib/opensearch/api/actions/security/patch_user.rb +++ b/lib/opensearch/api/actions/security/patch_user.rb @@ -19,8 +19,8 @@ module Actions # @option args [Enumerable] :body *Required* def patch_user(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'username' missing" unless args['username'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'username' missing" if args['username'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _username = args.delete('username') diff --git a/lib/opensearch/api/actions/security/patch_users.rb b/lib/opensearch/api/actions/security/patch_users.rb index 6f9c1d3b9..19edfd778 100644 --- a/lib/opensearch/api/actions/security/patch_users.rb +++ b/lib/opensearch/api/actions/security/patch_users.rb @@ -18,7 +18,7 @@ module Actions # @option args [Enumerable] :body *Required* def patch_users(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) diff --git a/lib/opensearch/api/actions/security/update_audit_configuration.rb b/lib/opensearch/api/actions/security/update_audit_configuration.rb index 7f660c8e6..640720fed 100644 --- a/lib/opensearch/api/actions/security/update_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/update_audit_configuration.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def update_audit_configuration(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/update_configuration.rb b/lib/opensearch/api/actions/security/update_configuration.rb index d4740cba8..f80e89b7e 100644 --- a/lib/opensearch/api/actions/security/update_configuration.rb +++ b/lib/opensearch/api/actions/security/update_configuration.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def update_configuration(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/security/update_distinguished_name.rb b/lib/opensearch/api/actions/security/update_distinguished_name.rb index eabeee53a..4915f33dc 100644 --- a/lib/opensearch/api/actions/security/update_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/update_distinguished_name.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def update_distinguished_name(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'cluster_name' missing" unless args['cluster_name'] + raise ArgumentError, "Required argument 'cluster_name' missing" if args['cluster_name'].nil? _cluster_name = args.delete('cluster_name') diff --git a/lib/opensearch/api/actions/sm/create_policy.rb b/lib/opensearch/api/actions/sm/create_policy.rb index 5cf81b90a..e47244d6e 100644 --- a/lib/opensearch/api/actions/sm/create_policy.rb +++ b/lib/opensearch/api/actions/sm/create_policy.rb @@ -19,7 +19,7 @@ module Actions # @option args [Hash] :body def create_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/delete_policy.rb b/lib/opensearch/api/actions/sm/delete_policy.rb index b5fc3b945..7a41bfe42 100644 --- a/lib/opensearch/api/actions/sm/delete_policy.rb +++ b/lib/opensearch/api/actions/sm/delete_policy.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/explain_policy.rb b/lib/opensearch/api/actions/sm/explain_policy.rb index e0ccf9185..559041b38 100644 --- a/lib/opensearch/api/actions/sm/explain_policy.rb +++ b/lib/opensearch/api/actions/sm/explain_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_name *Required* The name of the snapshot management policy. def explain_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/get_policy.rb b/lib/opensearch/api/actions/sm/get_policy.rb index 8ed9598f2..bd53ff2a1 100644 --- a/lib/opensearch/api/actions/sm/get_policy.rb +++ b/lib/opensearch/api/actions/sm/get_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_name *Required* The name of the snapshot management policy. def get_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/start_policy.rb b/lib/opensearch/api/actions/sm/start_policy.rb index 987162b7a..2ae7cb554 100644 --- a/lib/opensearch/api/actions/sm/start_policy.rb +++ b/lib/opensearch/api/actions/sm/start_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_name *Required* The name of the snapshot management policy. def start_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/stop_policy.rb b/lib/opensearch/api/actions/sm/stop_policy.rb index 8707ff768..33ea19e17 100644 --- a/lib/opensearch/api/actions/sm/stop_policy.rb +++ b/lib/opensearch/api/actions/sm/stop_policy.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :policy_name *Required* The name of the snapshot management policy. def stop_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/sm/update_policy.rb b/lib/opensearch/api/actions/sm/update_policy.rb index 0831ab41b..798023923 100644 --- a/lib/opensearch/api/actions/sm/update_policy.rb +++ b/lib/opensearch/api/actions/sm/update_policy.rb @@ -21,9 +21,9 @@ module Actions # @option args [Hash] :body def update_policy(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'policy_name' missing" unless args['policy_name'] - raise ArgumentError, "Required argument 'if_primary_term' missing" unless args['if_primary_term'] - raise ArgumentError, "Required argument 'if_seq_no' missing" unless args['if_seq_no'] + raise ArgumentError, "Required argument 'policy_name' missing" if args['policy_name'].nil? + raise ArgumentError, "Required argument 'if_primary_term' missing" if args['if_primary_term'].nil? + raise ArgumentError, "Required argument 'if_seq_no' missing" if args['if_seq_no'].nil? _policy_name = args.delete('policy_name') diff --git a/lib/opensearch/api/actions/snapshot/cleanup_repository.rb b/lib/opensearch/api/actions/snapshot/cleanup_repository.rb index 937e5a9e9..007901859 100644 --- a/lib/opensearch/api/actions/snapshot/cleanup_repository.rb +++ b/lib/opensearch/api/actions/snapshot/cleanup_repository.rb @@ -21,7 +21,7 @@ module Actions # @option args [String] :timeout Period to wait for a response. def cleanup_repository(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? _repository = args.delete('repository') diff --git a/lib/opensearch/api/actions/snapshot/clone.rb b/lib/opensearch/api/actions/snapshot/clone.rb index ed5751535..67f19e9ae 100644 --- a/lib/opensearch/api/actions/snapshot/clone.rb +++ b/lib/opensearch/api/actions/snapshot/clone.rb @@ -23,10 +23,10 @@ module Actions # @option args [Hash] :body *Required* The snapshot clone definition def clone(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'snapshot' missing" unless args['snapshot'] - raise ArgumentError, "Required argument 'target_snapshot' missing" unless args['target_snapshot'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'snapshot' missing" if args['snapshot'].nil? + raise ArgumentError, "Required argument 'target_snapshot' missing" if args['target_snapshot'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _repository = args.delete('repository') _snapshot = args.delete('snapshot') diff --git a/lib/opensearch/api/actions/snapshot/create.rb b/lib/opensearch/api/actions/snapshot/create.rb index f0ddce5b4..807bf2074 100644 --- a/lib/opensearch/api/actions/snapshot/create.rb +++ b/lib/opensearch/api/actions/snapshot/create.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body The snapshot definition def create(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'snapshot' missing" unless args['snapshot'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'snapshot' missing" if args['snapshot'].nil? _repository = args.delete('repository') _snapshot = args.delete('snapshot') diff --git a/lib/opensearch/api/actions/snapshot/create_repository.rb b/lib/opensearch/api/actions/snapshot/create_repository.rb index 6087de927..99d687a19 100644 --- a/lib/opensearch/api/actions/snapshot/create_repository.rb +++ b/lib/opensearch/api/actions/snapshot/create_repository.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body *Required* The repository definition def create_repository(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _repository = args.delete('repository') diff --git a/lib/opensearch/api/actions/snapshot/delete.rb b/lib/opensearch/api/actions/snapshot/delete.rb index b205f3670..03bc26428 100644 --- a/lib/opensearch/api/actions/snapshot/delete.rb +++ b/lib/opensearch/api/actions/snapshot/delete.rb @@ -22,8 +22,8 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'snapshot' missing" unless args['snapshot'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'snapshot' missing" if args['snapshot'].nil? _repository = args.delete('repository') _snapshot = args.delete('snapshot') diff --git a/lib/opensearch/api/actions/snapshot/delete_repository.rb b/lib/opensearch/api/actions/snapshot/delete_repository.rb index 728191146..a169f5ece 100644 --- a/lib/opensearch/api/actions/snapshot/delete_repository.rb +++ b/lib/opensearch/api/actions/snapshot/delete_repository.rb @@ -22,7 +22,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_repository(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? _repository = args.delete('repository') diff --git a/lib/opensearch/api/actions/snapshot/get.rb b/lib/opensearch/api/actions/snapshot/get.rb index 98a683ebf..3932ecc88 100644 --- a/lib/opensearch/api/actions/snapshot/get.rb +++ b/lib/opensearch/api/actions/snapshot/get.rb @@ -23,8 +23,8 @@ module Actions # @option args [Boolean] :verbose If `true`, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted. def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'snapshot' missing" unless args['snapshot'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'snapshot' missing" if args['snapshot'].nil? _repository = args.delete('repository') _snapshot = args.delete('snapshot') diff --git a/lib/opensearch/api/actions/snapshot/restore.rb b/lib/opensearch/api/actions/snapshot/restore.rb index ec00accb4..127940d6e 100644 --- a/lib/opensearch/api/actions/snapshot/restore.rb +++ b/lib/opensearch/api/actions/snapshot/restore.rb @@ -23,8 +23,8 @@ module Actions # @option args [Hash] :body Details of what to restore def restore(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] - raise ArgumentError, "Required argument 'snapshot' missing" unless args['snapshot'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? + raise ArgumentError, "Required argument 'snapshot' missing" if args['snapshot'].nil? _repository = args.delete('repository') _snapshot = args.delete('snapshot') diff --git a/lib/opensearch/api/actions/snapshot/verify_repository.rb b/lib/opensearch/api/actions/snapshot/verify_repository.rb index f480c73ef..cefdac026 100644 --- a/lib/opensearch/api/actions/snapshot/verify_repository.rb +++ b/lib/opensearch/api/actions/snapshot/verify_repository.rb @@ -21,7 +21,7 @@ module Actions # @option args [String] :timeout Explicit operation timeout def verify_repository(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'repository' missing" unless args['repository'] + raise ArgumentError, "Required argument 'repository' missing" if args['repository'].nil? _repository = args.delete('repository') diff --git a/lib/opensearch/api/actions/tasks/get.rb b/lib/opensearch/api/actions/tasks/get.rb index c6ace3d08..e6be54da4 100644 --- a/lib/opensearch/api/actions/tasks/get.rb +++ b/lib/opensearch/api/actions/tasks/get.rb @@ -20,7 +20,7 @@ module Actions # @option args [Boolean] :wait_for_completion If `true`, the request blocks until the task has completed. def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/termvectors.rb b/lib/opensearch/api/actions/termvectors.rb index 42739ade2..3ad96b145 100644 --- a/lib/opensearch/api/actions/termvectors.rb +++ b/lib/opensearch/api/actions/termvectors.rb @@ -31,7 +31,7 @@ module Actions # @option args [Hash] :body Define parameters and or supply a document to get termvectors for. See documentation. def termvectors(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/delete.rb b/lib/opensearch/api/actions/transforms/delete.rb index af6c774e9..fe857bb0c 100644 --- a/lib/opensearch/api/actions/transforms/delete.rb +++ b/lib/opensearch/api/actions/transforms/delete.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/explain.rb b/lib/opensearch/api/actions/transforms/explain.rb index 11dfbc8ec..bd058d639 100644 --- a/lib/opensearch/api/actions/transforms/explain.rb +++ b/lib/opensearch/api/actions/transforms/explain.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Transform to explain def explain(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/get.rb b/lib/opensearch/api/actions/transforms/get.rb index 7003beca6..abe4148d9 100644 --- a/lib/opensearch/api/actions/transforms/get.rb +++ b/lib/opensearch/api/actions/transforms/get.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Transform to access def get(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/put.rb b/lib/opensearch/api/actions/transforms/put.rb index 946a9a9d8..75925b934 100644 --- a/lib/opensearch/api/actions/transforms/put.rb +++ b/lib/opensearch/api/actions/transforms/put.rb @@ -21,7 +21,7 @@ module Actions # @option args [Hash] :body def put(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/start.rb b/lib/opensearch/api/actions/transforms/start.rb index 8185d2d1f..d95e7ccd3 100644 --- a/lib/opensearch/api/actions/transforms/start.rb +++ b/lib/opensearch/api/actions/transforms/start.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Transform to start def start(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/transforms/stop.rb b/lib/opensearch/api/actions/transforms/stop.rb index 27a3d05ca..95d151a41 100644 --- a/lib/opensearch/api/actions/transforms/stop.rb +++ b/lib/opensearch/api/actions/transforms/stop.rb @@ -18,7 +18,7 @@ module Actions # @option args [String] :id *Required* Transform to stop def stop(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? _id = args.delete('id') diff --git a/lib/opensearch/api/actions/update.rb b/lib/opensearch/api/actions/update.rb index 8baba7b38..244584581 100644 --- a/lib/opensearch/api/actions/update.rb +++ b/lib/opensearch/api/actions/update.rb @@ -32,9 +32,9 @@ module Actions # @option args [Hash] :body *Required* The request definition requires either `script` or partial `doc` def update(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'id' missing" unless args['id'] - raise ArgumentError, "Required argument 'index' missing" unless args['index'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _id = args.delete('id') _index = args.delete('index') diff --git a/lib/opensearch/api/actions/update_by_query.rb b/lib/opensearch/api/actions/update_by_query.rb index b8e755385..c8bb2d607 100644 --- a/lib/opensearch/api/actions/update_by_query.rb +++ b/lib/opensearch/api/actions/update_by_query.rb @@ -54,7 +54,7 @@ module Actions # @option args [Hash] :body The search definition using the Query DSL def update_by_query(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'index' missing" unless args['index'] + raise ArgumentError, "Required argument 'index' missing" if args['index'].nil? _index = args.delete('index') diff --git a/lib/opensearch/api/actions/update_by_query_rethrottle.rb b/lib/opensearch/api/actions/update_by_query_rethrottle.rb index 040ae8af0..09557a43c 100644 --- a/lib/opensearch/api/actions/update_by_query_rethrottle.rb +++ b/lib/opensearch/api/actions/update_by_query_rethrottle.rb @@ -19,7 +19,7 @@ module Actions # @option args [Float] :requests_per_second The throttle for this request in sub-requests per second. def update_by_query_rethrottle(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'task_id' missing" unless args['task_id'] + raise ArgumentError, "Required argument 'task_id' missing" if args['task_id'].nil? _task_id = args.delete('task_id') diff --git a/lib/opensearch/api/actions/wlm/create_query_group.rb b/lib/opensearch/api/actions/wlm/create_query_group.rb index 3191ac84f..c1856efc8 100644 --- a/lib/opensearch/api/actions/wlm/create_query_group.rb +++ b/lib/opensearch/api/actions/wlm/create_query_group.rb @@ -18,7 +18,7 @@ module Actions # @option args [Hash] :body *Required* def create_query_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? headers = args.delete('headers') || {} body = args.delete('body') diff --git a/lib/opensearch/api/actions/wlm/delete_query_group.rb b/lib/opensearch/api/actions/wlm/delete_query_group.rb index 32b1ae362..9a375c86c 100644 --- a/lib/opensearch/api/actions/wlm/delete_query_group.rb +++ b/lib/opensearch/api/actions/wlm/delete_query_group.rb @@ -19,7 +19,7 @@ module Actions # @option args [List] :ignore set to [404] to ignore server's NOT FOUND error for this request def delete_query_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? _name = args.delete('name') diff --git a/lib/opensearch/api/actions/wlm/update_query_group.rb b/lib/opensearch/api/actions/wlm/update_query_group.rb index 8f305995a..9f2aaa82b 100644 --- a/lib/opensearch/api/actions/wlm/update_query_group.rb +++ b/lib/opensearch/api/actions/wlm/update_query_group.rb @@ -19,8 +19,8 @@ module Actions # @option args [Hash] :body *Required* def update_query_group(args = {}) args = Utils.normalize_arguments(args) - raise ArgumentError, "Required argument 'name' missing" unless args['name'] - raise ArgumentError, "Required argument 'body' missing" unless args['body'] + raise ArgumentError, "Required argument 'name' missing" if args['name'].nil? + raise ArgumentError, "Required argument 'body' missing" if args['body'].nil? _name = args.delete('name') diff --git a/opensearch-ruby.gemspec b/opensearch-ruby.gemspec index 0849ee1da..4d9517ec0 100644 --- a/opensearch-ruby.gemspec +++ b/opensearch-ruby.gemspec @@ -64,7 +64,6 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 3.0' - s.add_dependency 'activesupport' s.add_dependency 'faraday', '>= 1.0', '< 3' s.add_dependency 'multi_json', '>= 1.0' end