elasticsearch-serverless 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch-serverless/api/async_search/delete.rb +9 -1
  3. data/lib/elasticsearch-serverless/api/async_search/get.rb +17 -3
  4. data/lib/elasticsearch-serverless/api/async_search/status.rb +9 -1
  5. data/lib/elasticsearch-serverless/api/async_search/submit.rb +15 -4
  6. data/lib/elasticsearch-serverless/api/bulk.rb +17 -4
  7. data/lib/elasticsearch-serverless/api/cat/aliases.rb +22 -6
  8. data/lib/elasticsearch-serverless/api/cat/component_templates.rb +22 -6
  9. data/lib/elasticsearch-serverless/api/cat/count.rb +25 -8
  10. data/lib/elasticsearch-serverless/api/cat/help.rb +16 -6
  11. data/lib/elasticsearch-serverless/api/cat/indices.rb +31 -9
  12. data/lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb +24 -8
  13. data/lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb +29 -8
  14. data/lib/elasticsearch-serverless/api/cat/ml_jobs.rb +29 -8
  15. data/lib/elasticsearch-serverless/api/cat/ml_trained_models.rb +25 -8
  16. data/lib/elasticsearch-serverless/api/cat/transforms.rb +27 -9
  17. data/lib/elasticsearch-serverless/api/clear_scroll.rb +12 -3
  18. data/lib/elasticsearch-serverless/api/close_point_in_time.rb +3 -1
  19. data/lib/elasticsearch-serverless/api/cluster/delete_component_template.rb +14 -3
  20. data/lib/elasticsearch-serverless/api/cluster/exists_component_template.rb +18 -5
  21. data/lib/elasticsearch-serverless/api/cluster/get_component_template.rb +16 -4
  22. data/lib/elasticsearch-serverless/api/cluster/info.rb +11 -2
  23. data/lib/elasticsearch-serverless/api/cluster/put_component_template.rb +17 -7
  24. data/lib/elasticsearch-serverless/api/connector/check_in.rb +9 -1
  25. data/lib/elasticsearch-serverless/api/connector/delete.rb +14 -6
  26. data/lib/elasticsearch-serverless/api/connector/get.rb +13 -5
  27. data/lib/elasticsearch-serverless/api/connector/list.rb +7 -5
  28. data/lib/elasticsearch-serverless/api/connector/post.rb +7 -5
  29. data/lib/elasticsearch-serverless/api/connector/put.rb +14 -6
  30. data/lib/elasticsearch-serverless/api/connector/sync_job_cancel.rb +13 -5
  31. data/lib/elasticsearch-serverless/api/connector/sync_job_delete.rb +13 -5
  32. data/lib/elasticsearch-serverless/api/connector/sync_job_get.rb +13 -5
  33. data/lib/elasticsearch-serverless/api/connector/sync_job_list.rb +8 -6
  34. data/lib/elasticsearch-serverless/api/connector/sync_job_post.rb +7 -5
  35. data/lib/elasticsearch-serverless/api/connector/update_active_filtering.rb +9 -1
  36. data/lib/elasticsearch-serverless/api/connector/update_api_key_id.rb +13 -5
  37. data/lib/elasticsearch-serverless/api/connector/update_configuration.rb +13 -5
  38. data/lib/elasticsearch-serverless/api/connector/update_error.rb +9 -1
  39. data/lib/elasticsearch-serverless/api/connector/update_filtering.rb +13 -5
  40. data/lib/elasticsearch-serverless/api/connector/update_filtering_validation.rb +9 -1
  41. data/lib/elasticsearch-serverless/api/connector/update_index_name.rb +13 -5
  42. data/lib/elasticsearch-serverless/api/connector/update_name.rb +13 -5
  43. data/lib/elasticsearch-serverless/api/connector/update_native.rb +13 -5
  44. data/lib/elasticsearch-serverless/api/connector/update_pipeline.rb +13 -5
  45. data/lib/elasticsearch-serverless/api/connector/update_scheduling.rb +13 -5
  46. data/lib/elasticsearch-serverless/api/connector/update_service_type.rb +13 -5
  47. data/lib/elasticsearch-serverless/api/connector/update_status.rb +9 -1
  48. data/lib/elasticsearch-serverless/api/count.rb +30 -10
  49. data/lib/elasticsearch-serverless/api/create.rb +21 -5
  50. data/lib/elasticsearch-serverless/api/delete.rb +17 -5
  51. data/lib/elasticsearch-serverless/api/delete_by_query.rb +38 -11
  52. data/lib/elasticsearch-serverless/api/delete_script.rb +14 -3
  53. data/lib/elasticsearch-serverless/api/enrich/delete_policy.rb +10 -1
  54. data/lib/elasticsearch-serverless/api/enrich/execute_policy.rb +9 -1
  55. data/lib/elasticsearch-serverless/api/enrich/get_policy.rb +12 -2
  56. data/lib/elasticsearch-serverless/api/enrich/put_policy.rb +10 -1
  57. data/lib/elasticsearch-serverless/api/enrich/stats.rb +4 -1
  58. data/lib/elasticsearch-serverless/api/eql/delete.rb +12 -2
  59. data/lib/elasticsearch-serverless/api/eql/get.rb +13 -3
  60. data/lib/elasticsearch-serverless/api/eql/get_status.rb +9 -1
  61. data/lib/elasticsearch-serverless/api/eql/search.rb +9 -1
  62. data/lib/elasticsearch-serverless/api/exists.rb +20 -6
  63. data/lib/elasticsearch-serverless/api/exists_source.rb +16 -4
  64. data/lib/elasticsearch-serverless/api/explain.rb +17 -5
  65. data/lib/elasticsearch-serverless/api/field_caps.rb +12 -2
  66. data/lib/elasticsearch-serverless/api/get.rb +18 -5
  67. data/lib/elasticsearch-serverless/api/get_script.rb +10 -1
  68. data/lib/elasticsearch-serverless/api/get_source.rb +10 -1
  69. data/lib/elasticsearch-serverless/api/graph/explore.rb +12 -2
  70. data/lib/elasticsearch-serverless/api/index.rb +25 -6
  71. data/lib/elasticsearch-serverless/api/indices/add_block.rb +11 -2
  72. data/lib/elasticsearch-serverless/api/indices/analyze.rb +12 -2
  73. data/lib/elasticsearch-serverless/api/indices/create.rb +16 -4
  74. data/lib/elasticsearch-serverless/api/indices/create_data_stream.rb +16 -2
  75. data/lib/elasticsearch-serverless/api/indices/data_streams_stats.rb +15 -3
  76. data/lib/elasticsearch-serverless/api/indices/delete.rb +25 -7
  77. data/lib/elasticsearch-serverless/api/indices/delete_alias.rb +18 -5
  78. data/lib/elasticsearch-serverless/api/indices/delete_data_lifecycle.rb +11 -2
  79. data/lib/elasticsearch-serverless/api/indices/delete_data_stream.rb +10 -1
  80. data/lib/elasticsearch-serverless/api/indices/delete_index_template.rb +9 -1
  81. data/lib/elasticsearch-serverless/api/indices/exists.rb +17 -4
  82. data/lib/elasticsearch-serverless/api/indices/exists_alias.rb +19 -5
  83. data/lib/elasticsearch-serverless/api/indices/exists_index_template.rb +9 -1
  84. data/lib/elasticsearch-serverless/api/indices/explain_data_lifecycle.rb +11 -2
  85. data/lib/elasticsearch-serverless/api/indices/get.rb +18 -4
  86. data/lib/elasticsearch-serverless/api/indices/get_alias.rb +23 -6
  87. data/lib/elasticsearch-serverless/api/indices/get_data_lifecycle.rb +16 -3
  88. data/lib/elasticsearch-serverless/api/indices/get_data_stream.rb +14 -3
  89. data/lib/elasticsearch-serverless/api/indices/get_index_template.rb +9 -1
  90. data/lib/elasticsearch-serverless/api/indices/get_mapping.rb +21 -5
  91. data/lib/elasticsearch-serverless/api/indices/get_settings.rb +26 -6
  92. data/lib/elasticsearch-serverless/api/indices/migrate_to_data_stream.rb +10 -1
  93. data/lib/elasticsearch-serverless/api/indices/modify_data_stream.rb +4 -1
  94. data/lib/elasticsearch-serverless/api/indices/put_alias.rb +20 -5
  95. data/lib/elasticsearch-serverless/api/indices/put_data_lifecycle.rb +22 -6
  96. data/lib/elasticsearch-serverless/api/indices/put_index_template.rb +11 -2
  97. data/lib/elasticsearch-serverless/api/indices/put_mapping.rb +20 -5
  98. data/lib/elasticsearch-serverless/api/indices/put_settings.rb +28 -7
  99. data/lib/elasticsearch-serverless/api/indices/put_template.rb +14 -3
  100. data/lib/elasticsearch-serverless/api/indices/refresh.rb +19 -4
  101. data/lib/elasticsearch-serverless/api/indices/resolve_index.rb +15 -3
  102. data/lib/elasticsearch-serverless/api/indices/rollover.rb +19 -5
  103. data/lib/elasticsearch-serverless/api/indices/simulate_index_template.rb +9 -1
  104. data/lib/elasticsearch-serverless/api/indices/simulate_template.rb +11 -2
  105. data/lib/elasticsearch-serverless/api/indices/update_aliases.rb +8 -3
  106. data/lib/elasticsearch-serverless/api/indices/validate_query.rb +24 -7
  107. data/lib/elasticsearch-serverless/api/inference/delete.rb +9 -1
  108. data/lib/elasticsearch-serverless/api/inference/get.rb +9 -1
  109. data/lib/elasticsearch-serverless/api/inference/inference.rb +9 -1
  110. data/lib/elasticsearch-serverless/api/inference/put.rb +9 -1
  111. data/lib/elasticsearch-serverless/api/info.rb +4 -1
  112. data/lib/elasticsearch-serverless/api/ingest/delete_pipeline.rb +15 -4
  113. data/lib/elasticsearch-serverless/api/ingest/get_pipeline.rb +14 -3
  114. data/lib/elasticsearch-serverless/api/ingest/processor_grok.rb +3 -1
  115. data/lib/elasticsearch-serverless/api/ingest/put_pipeline.rb +9 -1
  116. data/lib/elasticsearch-serverless/api/ingest/simulate.rb +11 -2
  117. data/lib/elasticsearch-serverless/api/license/get.rb +8 -4
  118. data/lib/elasticsearch-serverless/api/logstash/delete_pipeline.rb +9 -1
  119. data/lib/elasticsearch-serverless/api/logstash/get_pipeline.rb +9 -1
  120. data/lib/elasticsearch-serverless/api/logstash/put_pipeline.rb +9 -1
  121. data/lib/elasticsearch-serverless/api/machine_learning/close_job.rb +14 -4
  122. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar.rb +10 -1
  123. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_event.rb +12 -3
  124. data/lib/elasticsearch-serverless/api/machine_learning/delete_calendar_job.rb +12 -3
  125. data/lib/elasticsearch-serverless/api/machine_learning/delete_data_frame_analytics.rb +10 -2
  126. data/lib/elasticsearch-serverless/api/machine_learning/delete_datafeed.rb +16 -4
  127. data/lib/elasticsearch-serverless/api/machine_learning/delete_filter.rb +10 -2
  128. data/lib/elasticsearch-serverless/api/machine_learning/delete_job.rb +17 -6
  129. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model.rb +11 -3
  130. data/lib/elasticsearch-serverless/api/machine_learning/delete_trained_model_alias.rb +10 -2
  131. data/lib/elasticsearch-serverless/api/machine_learning/estimate_model_memory.rb +4 -1
  132. data/lib/elasticsearch-serverless/api/machine_learning/evaluate_data_frame.rb +4 -2
  133. data/lib/elasticsearch-serverless/api/machine_learning/flush_job.rb +19 -6
  134. data/lib/elasticsearch-serverless/api/machine_learning/get_calendar_events.rb +9 -1
  135. data/lib/elasticsearch-serverless/api/machine_learning/get_calendars.rb +9 -1
  136. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics.rb +24 -4
  137. data/lib/elasticsearch-serverless/api/machine_learning/get_data_frame_analytics_stats.rb +21 -3
  138. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeed_stats.rb +20 -3
  139. data/lib/elasticsearch-serverless/api/machine_learning/get_datafeeds.rb +23 -4
  140. data/lib/elasticsearch-serverless/api/machine_learning/get_filters.rb +9 -1
  141. data/lib/elasticsearch-serverless/api/machine_learning/get_job_stats.rb +21 -3
  142. data/lib/elasticsearch-serverless/api/machine_learning/get_jobs.rb +23 -4
  143. data/lib/elasticsearch-serverless/api/machine_learning/get_overall_buckets.rb +30 -7
  144. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models.rb +28 -7
  145. data/lib/elasticsearch-serverless/api/machine_learning/get_trained_models_stats.rb +17 -3
  146. data/lib/elasticsearch-serverless/api/machine_learning/infer_trained_model.rb +9 -1
  147. data/lib/elasticsearch-serverless/api/machine_learning/open_job.rb +10 -2
  148. data/lib/elasticsearch-serverless/api/machine_learning/post_calendar_events.rb +9 -1
  149. data/lib/elasticsearch-serverless/api/machine_learning/preview_data_frame_analytics.rb +9 -1
  150. data/lib/elasticsearch-serverless/api/machine_learning/preview_datafeed.rb +13 -2
  151. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar.rb +9 -1
  152. data/lib/elasticsearch-serverless/api/machine_learning/put_calendar_job.rb +9 -1
  153. data/lib/elasticsearch-serverless/api/machine_learning/put_data_frame_analytics.rb +12 -2
  154. data/lib/elasticsearch-serverless/api/machine_learning/put_datafeed.rb +17 -5
  155. data/lib/elasticsearch-serverless/api/machine_learning/put_filter.rb +9 -1
  156. data/lib/elasticsearch-serverless/api/machine_learning/put_job.rb +11 -2
  157. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model.rb +14 -3
  158. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_alias.rb +12 -2
  159. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_definition_part.rb +11 -2
  160. data/lib/elasticsearch-serverless/api/machine_learning/put_trained_model_vocabulary.rb +9 -1
  161. data/lib/elasticsearch-serverless/api/machine_learning/reset_job.rb +14 -3
  162. data/lib/elasticsearch-serverless/api/machine_learning/start_data_frame_analytics.rb +14 -3
  163. data/lib/elasticsearch-serverless/api/machine_learning/start_datafeed.rb +27 -8
  164. data/lib/elasticsearch-serverless/api/machine_learning/start_trained_model_deployment.rb +25 -5
  165. data/lib/elasticsearch-serverless/api/machine_learning/stop_data_frame_analytics.rb +23 -4
  166. data/lib/elasticsearch-serverless/api/machine_learning/stop_datafeed.rb +19 -3
  167. data/lib/elasticsearch-serverless/api/machine_learning/stop_trained_model_deployment.rb +15 -3
  168. data/lib/elasticsearch-serverless/api/machine_learning/update_data_frame_analytics.rb +12 -2
  169. data/lib/elasticsearch-serverless/api/machine_learning/update_datafeed.rb +21 -4
  170. data/lib/elasticsearch-serverless/api/machine_learning/update_filter.rb +9 -1
  171. data/lib/elasticsearch-serverless/api/machine_learning/update_job.rb +9 -1
  172. data/lib/elasticsearch-serverless/api/machine_learning/update_trained_model_deployment.rb +15 -2
  173. data/lib/elasticsearch-serverless/api/mget.rb +17 -4
  174. data/lib/elasticsearch-serverless/api/msearch.rb +15 -1
  175. data/lib/elasticsearch-serverless/api/msearch_template.rb +16 -4
  176. data/lib/elasticsearch-serverless/api/mtermvectors.rb +14 -8
  177. data/lib/elasticsearch-serverless/api/open_point_in_time.rb +14 -3
  178. data/lib/elasticsearch-serverless/api/ping.rb +4 -1
  179. data/lib/elasticsearch-serverless/api/put_script.rb +18 -5
  180. data/lib/elasticsearch-serverless/api/query_rules/delete_rule.rb +9 -1
  181. data/lib/elasticsearch-serverless/api/query_rules/delete_ruleset.rb +9 -1
  182. data/lib/elasticsearch-serverless/api/query_rules/get_rule.rb +9 -1
  183. data/lib/elasticsearch-serverless/api/query_rules/get_ruleset.rb +9 -1
  184. data/lib/elasticsearch-serverless/api/query_rules/list_rulesets.rb +3 -1
  185. data/lib/elasticsearch-serverless/api/query_rules/put_rule.rb +9 -1
  186. data/lib/elasticsearch-serverless/api/query_rules/put_ruleset.rb +9 -1
  187. data/lib/elasticsearch-serverless/api/rank_eval.rb +11 -2
  188. data/lib/elasticsearch-serverless/api/reindex.rb +11 -7
  189. data/lib/elasticsearch-serverless/api/render_search_template.rb +11 -2
  190. data/lib/elasticsearch-serverless/api/scripts_painless_execute.rb +4 -1
  191. data/lib/elasticsearch-serverless/api/scroll.rb +9 -1
  192. data/lib/elasticsearch-serverless/api/search.rb +107 -30
  193. data/lib/elasticsearch-serverless/api/search_application/delete.rb +9 -1
  194. data/lib/elasticsearch-serverless/api/search_application/delete_behavioral_analytics.rb +9 -1
  195. data/lib/elasticsearch-serverless/api/search_application/get.rb +9 -1
  196. data/lib/elasticsearch-serverless/api/search_application/get_behavioral_analytics.rb +9 -1
  197. data/lib/elasticsearch-serverless/api/search_application/list.rb +3 -1
  198. data/lib/elasticsearch-serverless/api/search_application/put.rb +9 -1
  199. data/lib/elasticsearch-serverless/api/search_application/put_behavioral_analytics.rb +9 -1
  200. data/lib/elasticsearch-serverless/api/search_application/search.rb +9 -1
  201. data/lib/elasticsearch-serverless/api/search_mvt.rb +27 -7
  202. data/lib/elasticsearch-serverless/api/search_template.rb +22 -6
  203. data/lib/elasticsearch-serverless/api/security/authenticate.rb +6 -2
  204. data/lib/elasticsearch-serverless/api/security/create_api_key.rb +4 -1
  205. data/lib/elasticsearch-serverless/api/security/get_api_key.rb +19 -7
  206. data/lib/elasticsearch-serverless/api/security/has_privileges.rb +10 -1
  207. data/lib/elasticsearch-serverless/api/security/invalidate_api_key.rb +4 -1
  208. data/lib/elasticsearch-serverless/api/security/query_api_keys.rb +7 -3
  209. data/lib/elasticsearch-serverless/api/security/update_api_key.rb +10 -1
  210. data/lib/elasticsearch-serverless/api/sql/clear_cursor.rb +3 -1
  211. data/lib/elasticsearch-serverless/api/sql/delete_async.rb +9 -1
  212. data/lib/elasticsearch-serverless/api/sql/get_async.rb +15 -4
  213. data/lib/elasticsearch-serverless/api/sql/get_async_status.rb +9 -1
  214. data/lib/elasticsearch-serverless/api/sql/query.rb +3 -1
  215. data/lib/elasticsearch-serverless/api/sql/translate.rb +3 -1
  216. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym.rb +9 -1
  217. data/lib/elasticsearch-serverless/api/synonyms/delete_synonym_rule.rb +9 -1
  218. data/lib/elasticsearch-serverless/api/synonyms/get_synonym.rb +9 -1
  219. data/lib/elasticsearch-serverless/api/synonyms/get_synonym_rule.rb +9 -1
  220. data/lib/elasticsearch-serverless/api/synonyms/get_synonyms_sets.rb +3 -1
  221. data/lib/elasticsearch-serverless/api/synonyms/put_synonym.rb +9 -1
  222. data/lib/elasticsearch-serverless/api/synonyms/put_synonym_rule.rb +9 -1
  223. data/lib/elasticsearch-serverless/api/tasks/get.rb +13 -3
  224. data/lib/elasticsearch-serverless/api/terms_enum.rb +9 -1
  225. data/lib/elasticsearch-serverless/api/termvectors.rb +21 -9
  226. data/lib/elasticsearch-serverless/api/transform/delete_transform.rb +14 -3
  227. data/lib/elasticsearch-serverless/api/transform/get_transform.rb +23 -4
  228. data/lib/elasticsearch-serverless/api/transform/get_transform_stats.rb +20 -3
  229. data/lib/elasticsearch-serverless/api/transform/preview_transform.rb +15 -5
  230. data/lib/elasticsearch-serverless/api/transform/put_transform.rb +17 -7
  231. data/lib/elasticsearch-serverless/api/transform/reset_transform.rb +14 -3
  232. data/lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb +11 -3
  233. data/lib/elasticsearch-serverless/api/transform/start_transform.rb +10 -3
  234. data/lib/elasticsearch-serverless/api/transform/stop_transform.rb +23 -6
  235. data/lib/elasticsearch-serverless/api/transform/update_transform.rb +15 -4
  236. data/lib/elasticsearch-serverless/api/update.rb +23 -7
  237. data/lib/elasticsearch-serverless/api/update_by_query.rb +36 -9
  238. data/lib/elasticsearch-serverless/api.rb +3 -2
  239. data/lib/elasticsearch-serverless/version.rb +1 -1
  240. data/lib/elasticsearch-serverless.rb +4 -3
  241. metadata +5 -76
  242. data/lib/elasticsearch-serverless/api/connector/last_sync.rb +0 -59
@@ -22,16 +22,26 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
+ # Get API key information.
25
26
  # Retrieves information for one or more API keys.
26
27
  # NOTE: If you have only the +manage_own_api_key+ privilege, this API returns only the API keys that you own.
27
28
  # If you have +read_security+, +manage_api_key+ or greater privileges (including +manage_security+), this API returns all API keys regardless of ownership.
28
29
  #
29
- # @option arguments [String] :id An API key id. This parameter cannot be used with any of +name+, +realm_name+ or +username+.
30
- # @option arguments [String] :name An API key name. This parameter cannot be used with any of +id+, +realm_name+ or +username+. It supports prefix search with wildcard.
31
- # @option arguments [Boolean] :owner A boolean flag that can be used to query API keys owned by the currently authenticated user. The +realm_name+ or +username+ parameters cannot be specified when this parameter is set to +true+ as they are assumed to be the currently authenticated ones.
32
- # @option arguments [String] :realm_name The name of an authentication realm. This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+.
33
- # @option arguments [String] :username The username of a user. This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+.
34
- # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors.
30
+ # @option arguments [String] :id An API key id.
31
+ # This parameter cannot be used with any of +name+, +realm_name+ or +username+.
32
+ # @option arguments [String] :name An API key name.
33
+ # This parameter cannot be used with any of +id+, +realm_name+ or +username+.
34
+ # It supports prefix search with wildcard.
35
+ # @option arguments [Boolean] :owner A boolean flag that can be used to query API keys owned by the currently authenticated user.
36
+ # The +realm_name+ or +username+ parameters cannot be specified when this parameter is set to +true+ as they are assumed to be the currently authenticated ones.
37
+ # @option arguments [String] :realm_name The name of an authentication realm.
38
+ # This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+.
39
+ # @option arguments [String] :username The username of a user.
40
+ # This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+.
41
+ # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors
42
+ # associated with the API key. An API key's actual
43
+ # permission is the intersection of its assigned role
44
+ # descriptors and the owner user's role descriptors.
35
45
  # @option arguments [Boolean] :active_only A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as +owner+ or +name+. If +active_only+ is false, the response will include both active and inactive (expired or invalidated) keys.
36
46
  # @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.
37
47
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -39,6 +49,8 @@ module ElasticsearchServerless
39
49
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html
40
50
  #
41
51
  def get_api_key(arguments = {})
52
+ request_opts = { endpoint: arguments[:endpoint] || "security.get_api_key" }
53
+
42
54
  arguments = arguments.clone
43
55
  headers = arguments.delete(:headers) || {}
44
56
 
@@ -49,7 +61,7 @@ module ElasticsearchServerless
49
61
  params = Utils.process_params(arguments)
50
62
 
51
63
  ElasticsearchServerless::API::Response.new(
52
- perform_request(method, path, params, body, headers)
64
+ perform_request(method, path, params, body, headers, request_opts)
53
65
  )
54
66
  end
55
67
  end
@@ -22,6 +22,7 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
+ # Check user privileges.
25
26
  # Determines whether the specified user has a specified list of privileges.
26
27
  #
27
28
  # @option arguments [String] :user Username
@@ -31,6 +32,14 @@ module ElasticsearchServerless
31
32
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html
32
33
  #
33
34
  def has_privileges(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || "security.has_privileges" }
36
+
37
+ defined_params = [:user].inject({}) do |set_variables, variable|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ set_variables
40
+ end
41
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
42
+
34
43
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
44
 
36
45
  arguments = arguments.clone
@@ -49,7 +58,7 @@ module ElasticsearchServerless
49
58
  params = {}
50
59
 
51
60
  ElasticsearchServerless::API::Response.new(
52
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
53
62
  )
54
63
  end
55
64
  end
@@ -22,6 +22,7 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
+ # Invalidate API keys.
25
26
  # Invalidates one or more API keys.
26
27
  # The +manage_api_key+ privilege allows deleting any API keys.
27
28
  # The +manage_own_api_key+ only allows deleting API keys that are owned by the user.
@@ -36,6 +37,8 @@ module ElasticsearchServerless
36
37
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html
37
38
  #
38
39
  def invalidate_api_key(arguments = {})
40
+ request_opts = { endpoint: arguments[:endpoint] || "security.invalidate_api_key" }
41
+
39
42
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
40
43
 
41
44
  arguments = arguments.clone
@@ -48,7 +51,7 @@ module ElasticsearchServerless
48
51
  params = {}
49
52
 
50
53
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
54
+ perform_request(method, path, params, body, headers, request_opts)
52
55
  )
53
56
  end
54
57
  end
@@ -22,9 +22,11 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
- # Retrieves information for API keys in a paginated manner. You can optionally filter the results with a query.
25
+ # Query API keys.
26
+ # Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
26
27
  #
27
- # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors.
28
+ # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors associated with the API key.
29
+ # An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors.
28
30
  # @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists.
29
31
  # @option arguments [Boolean] :typed_keys Determines whether aggregation names are prefixed by their respective types in the response.
30
32
  # @option arguments [Hash] :headers Custom HTTP headers
@@ -33,6 +35,8 @@ module ElasticsearchServerless
33
35
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html
34
36
  #
35
37
  def query_api_keys(arguments = {})
38
+ request_opts = { endpoint: arguments[:endpoint] || "security.query_api_keys" }
39
+
36
40
  arguments = arguments.clone
37
41
  headers = arguments.delete(:headers) || {}
38
42
 
@@ -48,7 +52,7 @@ module ElasticsearchServerless
48
52
  params = Utils.process_params(arguments)
49
53
 
50
54
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
55
+ perform_request(method, path, params, body, headers, request_opts)
52
56
  )
53
57
  end
54
58
  end
@@ -22,6 +22,7 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Security
24
24
  module Actions
25
+ # Update an API key.
25
26
  # Updates attributes of an existing API key.
26
27
  # Users can only update API keys that they created or that were granted to them.
27
28
  # Use this API to update API keys created by the create API Key or grant API Key APIs.
@@ -43,6 +44,14 @@ module ElasticsearchServerless
43
44
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html
44
45
  #
45
46
  def update_api_key(arguments = {})
47
+ request_opts = { endpoint: arguments[:endpoint] || "security.update_api_key" }
48
+
49
+ defined_params = [:id].inject({}) do |set_variables, variable|
50
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
51
+ set_variables
52
+ end
53
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
54
+
46
55
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
47
56
 
48
57
  arguments = arguments.clone
@@ -57,7 +66,7 @@ module ElasticsearchServerless
57
66
  params = {}
58
67
 
59
68
  ElasticsearchServerless::API::Response.new(
60
- perform_request(method, path, params, body, headers)
69
+ perform_request(method, path, params, body, headers, request_opts)
61
70
  )
62
71
  end
63
72
  end
@@ -30,6 +30,8 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html
31
31
  #
32
32
  def clear_cursor(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "sql.clear_cursor" }
34
+
33
35
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
34
36
 
35
37
  arguments = arguments.clone
@@ -42,7 +44,7 @@ module ElasticsearchServerless
42
44
  params = {}
43
45
 
44
46
  ElasticsearchServerless::API::Response.new(
45
- perform_request(method, path, params, body, headers)
47
+ perform_request(method, path, params, body, headers, request_opts)
46
48
  )
47
49
  end
48
50
  end
@@ -30,6 +30,14 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-async-sql-search-api.html
31
31
  #
32
32
  def delete_async(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "sql.delete_async" }
34
+
35
+ defined_params = [:id].inject({}) do |set_variables, variable|
36
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
+ set_variables
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
33
41
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
42
 
35
43
  arguments = arguments.clone
@@ -44,7 +52,7 @@ module ElasticsearchServerless
44
52
  params = {}
45
53
 
46
54
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
55
+ perform_request(method, path, params, body, headers, request_opts)
48
56
  )
49
57
  end
50
58
  end
@@ -26,14 +26,25 @@ module ElasticsearchServerless
26
26
  #
27
27
  # @option arguments [String] :id Identifier for the search. (*Required*)
28
28
  # @option arguments [String] :delimiter Separator for CSV results. The API only supports this parameter for CSV responses. Server default: ,.
29
- # @option arguments [String] :format Format for the response. You must specify a format using this parameter or the Accept HTTP header. If you specify both, the API uses this parameter.
30
- # @option arguments [Time] :keep_alive Retention period for the search and its results. Defaults to the +keep_alive+ period for the original SQL search.
31
- # @option arguments [Time] :wait_for_completion_timeout Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results.
29
+ # @option arguments [String] :format Format for the response. You must specify a format using this parameter or the
30
+ # Accept HTTP header. If you specify both, the API uses this parameter.
31
+ # @option arguments [Time] :keep_alive Retention period for the search and its results. Defaults
32
+ # to the +keep_alive+ period for the original SQL search.
33
+ # @option arguments [Time] :wait_for_completion_timeout Period to wait for complete results. Defaults to no timeout,
34
+ # meaning the request waits for complete search results.
32
35
  # @option arguments [Hash] :headers Custom HTTP headers
33
36
  #
34
37
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-api.html
35
38
  #
36
39
  def get_async(arguments = {})
40
+ request_opts = { endpoint: arguments[:endpoint] || "sql.get_async" }
41
+
42
+ defined_params = [:id].inject({}) do |set_variables, variable|
43
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
44
+ set_variables
45
+ end
46
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
47
+
37
48
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
38
49
 
39
50
  arguments = arguments.clone
@@ -48,7 +59,7 @@ module ElasticsearchServerless
48
59
  params = Utils.process_params(arguments)
49
60
 
50
61
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
62
+ perform_request(method, path, params, body, headers, request_opts)
52
63
  )
53
64
  end
54
65
  end
@@ -30,6 +30,14 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-async-sql-search-status-api.html
31
31
  #
32
32
  def get_async_status(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "sql.get_async_status" }
34
+
35
+ defined_params = [:id].inject({}) do |set_variables, variable|
36
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
+ set_variables
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
33
41
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
42
 
35
43
  arguments = arguments.clone
@@ -44,7 +52,7 @@ module ElasticsearchServerless
44
52
  params = {}
45
53
 
46
54
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
55
+ perform_request(method, path, params, body, headers, request_opts)
48
56
  )
49
57
  end
50
58
  end
@@ -31,6 +31,8 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html
32
32
  #
33
33
  def query(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "sql.query" }
35
+
34
36
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
37
 
36
38
  arguments = arguments.clone
@@ -43,7 +45,7 @@ module ElasticsearchServerless
43
45
  params = Utils.process_params(arguments)
44
46
 
45
47
  ElasticsearchServerless::API::Response.new(
46
- perform_request(method, path, params, body, headers)
48
+ perform_request(method, path, params, body, headers, request_opts)
47
49
  )
48
50
  end
49
51
  end
@@ -30,6 +30,8 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html
31
31
  #
32
32
  def translate(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "sql.translate" }
34
+
33
35
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
34
36
 
35
37
  arguments = arguments.clone
@@ -42,7 +44,7 @@ module ElasticsearchServerless
42
44
  params = {}
43
45
 
44
46
  ElasticsearchServerless::API::Response.new(
45
- perform_request(method, path, params, body, headers)
47
+ perform_request(method, path, params, body, headers, request_opts)
46
48
  )
47
49
  end
48
50
  end
@@ -30,6 +30,14 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonyms-set.html
31
31
  #
32
32
  def delete_synonym(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.delete_synonym" }
34
+
35
+ defined_params = [:id].inject({}) do |set_variables, variable|
36
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
+ set_variables
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
33
41
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
34
42
 
35
43
  arguments = arguments.clone
@@ -44,7 +52,7 @@ module ElasticsearchServerless
44
52
  params = {}
45
53
 
46
54
  ElasticsearchServerless::API::Response.new(
47
- perform_request(method, path, params, body, headers)
55
+ perform_request(method, path, params, body, headers, request_opts)
48
56
  )
49
57
  end
50
58
  end
@@ -31,6 +31,14 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-synonym-rule.html
32
32
  #
33
33
  def delete_synonym_rule(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.delete_synonym_rule" }
35
+
36
+ defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ set_variables
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
34
42
  raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id]
35
43
  raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id]
36
44
 
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -32,6 +32,14 @@ module ElasticsearchServerless
32
32
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonyms-set.html
33
33
  #
34
34
  def get_synonym(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonym" }
36
+
37
+ defined_params = [:id].inject({}) do |set_variables, variable|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ set_variables
40
+ end
41
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
42
+
35
43
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
36
44
 
37
45
  arguments = arguments.clone
@@ -46,7 +54,7 @@ module ElasticsearchServerless
46
54
  params = Utils.process_params(arguments)
47
55
 
48
56
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
57
+ perform_request(method, path, params, body, headers, request_opts)
50
58
  )
51
59
  end
52
60
  end
@@ -31,6 +31,14 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-synonym-rule.html
32
32
  #
33
33
  def get_synonym_rule(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonym_rule" }
35
+
36
+ defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ set_variables
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
34
42
  raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id]
35
43
  raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id]
36
44
 
@@ -48,7 +56,7 @@ module ElasticsearchServerless
48
56
  params = {}
49
57
 
50
58
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
59
+ perform_request(method, path, params, body, headers, request_opts)
52
60
  )
53
61
  end
54
62
  end
@@ -31,6 +31,8 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/list-synonyms-sets.html
32
32
  #
33
33
  def get_synonyms_sets(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.get_synonyms_sets" }
35
+
34
36
  arguments = arguments.clone
35
37
  headers = arguments.delete(:headers) || {}
36
38
 
@@ -41,7 +43,7 @@ module ElasticsearchServerless
41
43
  params = Utils.process_params(arguments)
42
44
 
43
45
  ElasticsearchServerless::API::Response.new(
44
- perform_request(method, path, params, body, headers)
46
+ perform_request(method, path, params, body, headers, request_opts)
45
47
  )
46
48
  end
47
49
  end
@@ -31,6 +31,14 @@ module ElasticsearchServerless
31
31
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonyms-set.html
32
32
  #
33
33
  def put_synonym(arguments = {})
34
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.put_synonym" }
35
+
36
+ defined_params = [:id].inject({}) do |set_variables, variable|
37
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
38
+ set_variables
39
+ end
40
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
41
+
34
42
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
43
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
36
44
 
@@ -46,7 +54,7 @@ module ElasticsearchServerless
46
54
  params = {}
47
55
 
48
56
  ElasticsearchServerless::API::Response.new(
49
- perform_request(method, path, params, body, headers)
57
+ perform_request(method, path, params, body, headers, request_opts)
50
58
  )
51
59
  end
52
60
  end
@@ -32,6 +32,14 @@ module ElasticsearchServerless
32
32
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-synonym-rule.html
33
33
  #
34
34
  def put_synonym_rule(arguments = {})
35
+ request_opts = { endpoint: arguments[:endpoint] || "synonyms.put_synonym_rule" }
36
+
37
+ defined_params = [:set_id, :rule_id].inject({}) do |set_variables, variable|
38
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
39
+ set_variables
40
+ end
41
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
42
+
35
43
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
36
44
  raise ArgumentError, "Required argument 'set_id' missing" unless arguments[:set_id]
37
45
  raise ArgumentError, "Required argument 'rule_id' missing" unless arguments[:rule_id]
@@ -50,7 +58,7 @@ module ElasticsearchServerless
50
58
  params = {}
51
59
 
52
60
  ElasticsearchServerless::API::Response.new(
53
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
54
62
  )
55
63
  end
56
64
  end
@@ -22,20 +22,30 @@ module ElasticsearchServerless
22
22
  module API
23
23
  module Tasks
24
24
  module Actions
25
- # Returns information about a task.
25
+ # Get task information.
26
+ # Returns information about the tasks currently executing in the cluster.
26
27
  # This functionality is Experimental and may be changed or removed
27
28
  # completely in a future release. Elastic will take a best effort approach
28
29
  # to fix any issues, but experimental features are not subject to the
29
30
  # support SLA of official GA features.
30
31
  #
31
32
  # @option arguments [String] :task_id ID of the task. (*Required*)
32
- # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
33
+ # @option arguments [Time] :timeout Period to wait for a response.
34
+ # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.
33
35
  # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the task has completed.
34
36
  # @option arguments [Hash] :headers Custom HTTP headers
35
37
  #
36
38
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html
37
39
  #
38
40
  def get(arguments = {})
41
+ request_opts = { endpoint: arguments[:endpoint] || "tasks.get" }
42
+
43
+ defined_params = [:task_id].inject({}) do |set_variables, variable|
44
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
45
+ set_variables
46
+ end
47
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
48
+
39
49
  arguments = arguments.clone
40
50
  headers = arguments.delete(:headers) || {}
41
51
 
@@ -48,7 +58,7 @@ module ElasticsearchServerless
48
58
  params = Utils.process_params(arguments)
49
59
 
50
60
  ElasticsearchServerless::API::Response.new(
51
- perform_request(method, path, params, body, headers)
61
+ perform_request(method, path, params, body, headers, request_opts)
52
62
  )
53
63
  end
54
64
  end
@@ -30,6 +30,14 @@ module ElasticsearchServerless
30
30
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html
31
31
  #
32
32
  def terms_enum(arguments = {})
33
+ request_opts = { endpoint: arguments[:endpoint] || "terms_enum" }
34
+
35
+ defined_params = [:index].inject({}) do |set_variables, variable|
36
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
37
+ set_variables
38
+ end
39
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
40
+
33
41
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
34
42
 
35
43
  arguments = arguments.clone
@@ -49,7 +57,7 @@ module ElasticsearchServerless
49
57
  params = {}
50
58
 
51
59
  ElasticsearchServerless::API::Response.new(
52
- perform_request(method, path, params, body, headers)
60
+ perform_request(method, path, params, body, headers, request_opts)
53
61
  )
54
62
  end
55
63
  end
@@ -21,16 +21,19 @@
21
21
  module ElasticsearchServerless
22
22
  module API
23
23
  module Actions
24
+ # Get term vector information.
24
25
  # Returns information and statistics about terms in the fields of a particular document.
25
26
  #
26
27
  # @option arguments [String] :index Name of the index that contains the document. (*Required*)
27
28
  # @option arguments [String] :id Unique identifier of the document.
28
- # @option arguments [String, Array<String>] :fields Comma-separated list or wildcard expressions of fields to include in the statistics. Used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
29
+ # @option arguments [String, Array<String>] :fields Comma-separated list or wildcard expressions of fields to include in the statistics.
30
+ # Used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters.
29
31
  # @option arguments [Boolean] :field_statistics If +true+, the response includes the document count, sum of document frequencies, and sum of total term frequencies. Server default: true.
30
32
  # @option arguments [Boolean] :offsets If +true+, the response includes term offsets. Server default: true.
31
33
  # @option arguments [Boolean] :payloads If +true+, the response includes term payloads. Server default: true.
32
34
  # @option arguments [Boolean] :positions If +true+, the response includes term positions. Server default: true.
33
- # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default.
35
+ # @option arguments [String] :preference Specifies the node or shard the operation should be performed on.
36
+ # Random by default.
34
37
  # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true.
35
38
  # @option arguments [String] :routing Custom value used to route operations to a specific shard.
36
39
  # @option arguments [Boolean] :term_statistics If +true+, the response includes term frequency and document frequency.
@@ -42,6 +45,14 @@ module ElasticsearchServerless
42
45
  # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-termvectors.html
43
46
  #
44
47
  def termvectors(arguments = {})
48
+ request_opts = { endpoint: arguments[:endpoint] || "termvectors" }
49
+
50
+ defined_params = [:index, :id].inject({}) do |set_variables, variable|
51
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
52
+ set_variables
53
+ end
54
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
55
+
45
56
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
46
57
 
47
58
  arguments = arguments.clone
@@ -59,22 +70,23 @@ module ElasticsearchServerless
59
70
  ElasticsearchServerless::API::HTTP_GET
60
71
  end
61
72
 
62
- endpoint = arguments.delete(:endpoint) || '_termvectors'
63
- path = if _index && _id
64
- "#{Utils.listify(_index)}/_termvectors/#{Utils.listify(_id)}"
65
- else
66
- "#{Utils.listify(_index)}/_termvectors"
67
- end
73
+ arguments.delete(:endpoint)
74
+ path = if _index && _id
75
+ "#{Utils.listify(_index)}/_termvectors/#{Utils.listify(_id)}"
76
+ else
77
+ "#{Utils.listify(_index)}/_termvectors"
78
+ end
68
79
  params = Utils.process_params(arguments)
69
80
 
70
81
  ElasticsearchServerless::API::Response.new(
71
- perform_request(method, path, params, body, headers)
82
+ perform_request(method, path, params, body, headers, request_opts)
72
83
  )
73
84
  end
74
85
 
75
86
  # Deprecated: Use the plural version, {#termvectors}
76
87
  #
77
88
  def termvector(arguments = {})
89
+ warn "[DEPRECATION] `termvector` is deprecated. Please use the plural version, `termvectors` instead."
78
90
  termvectors(arguments.merge endpoint: '_termvector')
79
91
  end
80
92
  end