Module: ElasticsearchServerless::API::Synonyms::Actions
- Defined in:
- lib/elasticsearch-serverless/api/synonyms/get_synonym.rb,
lib/elasticsearch-serverless/api/synonyms/put_synonym.rb,
lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb,
lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb,
lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb,
lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb,
lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb
Instance Method Summary collapse
-
#delete_synonym(arguments = {}) ⇒ Object
Deletes a synonym set.
-
#delete_synonym_rule(arguments = {}) ⇒ Object
Deletes a synonym rule in a synonym set.
-
#get_synonym(arguments = {}) ⇒ Object
Retrieves a synonym set.
-
#get_synonym_rule(arguments = {}) ⇒ Object
Retrieves a synonym rule from a synonym set.
-
#get_synonyms_sets(arguments = {}) ⇒ Object
Retrieves a summary of all defined synonym sets.
-
#put_synonym(arguments = {}) ⇒ Object
Creates or updates a synonym set.
-
#put_synonym_rule(arguments = {}) ⇒ Object
Creates or updates a synonym rule in a synonym set.
Instance Method Details
#delete_synonym(arguments = {}) ⇒ Object
Deletes a synonym set
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb', line 32 def delete_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.delete_synonym" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_DELETE path = "_synonyms/#{Utils.listify(_id)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#delete_synonym_rule(arguments = {}) ⇒ Object
Deletes a synonym rule in a synonym set
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb', line 33 def delete_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.delete_synonym_rule" } defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id] raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _set_id = arguments.delete(:set_id) _rule_id = arguments.delete(:rule_id) method = ElasticsearchServerless::API::HTTP_DELETE path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_synonym(arguments = {}) ⇒ Object
Retrieves a synonym set
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch-serverless/api/synonyms/get_synonym.rb', line 34 def get_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonym" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_GET path = "_synonyms/#{Utils.listify(_id)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_synonym_rule(arguments = {}) ⇒ Object
Retrieves a synonym rule from a synonym set
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb', line 33 def get_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonym_rule" } defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id] raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _set_id = arguments.delete(:set_id) _rule_id = arguments.delete(:rule_id) method = ElasticsearchServerless::API::HTTP_GET path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_synonyms_sets(arguments = {}) ⇒ Object
Retrieves a summary of all defined synonym sets
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb', line 33 def get_synonyms_sets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonyms_sets" } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = ElasticsearchServerless::API::HTTP_GET path = "_synonyms" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_synonym(arguments = {}) ⇒ Object
Creates or updates a synonym set.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch-serverless/api/synonyms/put_synonym.rb', line 33 def put_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.put_synonym" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _id = arguments.delete(:id) method = ElasticsearchServerless::API::HTTP_PUT path = "_synonyms/#{Utils.listify(_id)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_synonym_rule(arguments = {}) ⇒ Object
Creates or updates a synonym rule in a synonym set
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb', line 34 def put_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "synonyms.put_synonym_rule" } defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id] raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _set_id = arguments.delete(:set_id) _rule_id = arguments.delete(:rule_id) method = ElasticsearchServerless::API::HTTP_PUT path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |