@elastic/elasticsearch 8.17.1 → 9.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/lib/api/api/async_search.d.ts +16 -17
  2. package/lib/api/api/async_search.js +50 -20
  3. package/lib/api/api/async_search.js.map +1 -1
  4. package/lib/api/api/autoscaling.d.ts +16 -17
  5. package/lib/api/api/autoscaling.js +42 -12
  6. package/lib/api/api/autoscaling.js.map +1 -1
  7. package/lib/api/api/bulk.d.ts +4 -5
  8. package/lib/api/api/bulk.js +3 -3
  9. package/lib/api/api/bulk.js.map +1 -1
  10. package/lib/api/api/capabilities.d.ts +3 -4
  11. package/lib/api/api/capabilities.js +13 -3
  12. package/lib/api/api/capabilities.js.map +1 -1
  13. package/lib/api/api/cat.d.ts +104 -105
  14. package/lib/api/api/cat.js +338 -78
  15. package/lib/api/api/cat.js.map +1 -1
  16. package/lib/api/api/ccr.d.ts +52 -53
  17. package/lib/api/api/ccr.js +162 -64
  18. package/lib/api/api/ccr.js.map +1 -1
  19. package/lib/api/api/clear_scroll.d.ts +4 -5
  20. package/lib/api/api/clear_scroll.js +11 -9
  21. package/lib/api/api/clear_scroll.js.map +1 -1
  22. package/lib/api/api/close_point_in_time.d.ts +4 -5
  23. package/lib/api/api/close_point_in_time.js +11 -9
  24. package/lib/api/api/close_point_in_time.js.map +1 -1
  25. package/lib/api/api/cluster.d.ts +64 -65
  26. package/lib/api/api/cluster.js +200 -72
  27. package/lib/api/api/cluster.js.map +1 -1
  28. package/lib/api/api/connector.d.ts +132 -133
  29. package/lib/api/api/connector.js +402 -222
  30. package/lib/api/api/connector.js.map +1 -1
  31. package/lib/api/api/count.d.ts +5 -6
  32. package/lib/api/api/count.js +11 -9
  33. package/lib/api/api/count.js.map +1 -1
  34. package/lib/api/api/create.d.ts +5 -6
  35. package/lib/api/api/create.js +3 -3
  36. package/lib/api/api/create.js.map +1 -1
  37. package/lib/api/api/dangling_indices.d.ts +12 -13
  38. package/lib/api/api/dangling_indices.js +39 -9
  39. package/lib/api/api/dangling_indices.js.map +1 -1
  40. package/lib/api/api/delete.d.ts +4 -5
  41. package/lib/api/api/delete.js +13 -3
  42. package/lib/api/api/delete.js.map +1 -1
  43. package/lib/api/api/delete_by_query.d.ts +4 -5
  44. package/lib/api/api/delete_by_query.js +11 -9
  45. package/lib/api/api/delete_by_query.js.map +1 -1
  46. package/lib/api/api/delete_by_query_rethrottle.d.ts +4 -5
  47. package/lib/api/api/delete_by_query_rethrottle.js +13 -3
  48. package/lib/api/api/delete_by_query_rethrottle.js.map +1 -1
  49. package/lib/api/api/delete_script.d.ts +4 -5
  50. package/lib/api/api/delete_script.js +13 -3
  51. package/lib/api/api/delete_script.js.map +1 -1
  52. package/lib/api/api/enrich.d.ts +20 -21
  53. package/lib/api/api/enrich.js +63 -21
  54. package/lib/api/api/enrich.js.map +1 -1
  55. package/lib/api/api/eql.d.ts +16 -17
  56. package/lib/api/api/eql.js +51 -19
  57. package/lib/api/api/eql.js.map +1 -1
  58. package/lib/api/api/esql.d.ts +16 -17
  59. package/lib/api/api/esql.js +50 -26
  60. package/lib/api/api/esql.js.map +1 -1
  61. package/lib/api/api/exists.d.ts +4 -5
  62. package/lib/api/api/exists.js +13 -3
  63. package/lib/api/api/exists.js.map +1 -1
  64. package/lib/api/api/exists_source.d.ts +4 -5
  65. package/lib/api/api/exists_source.js +13 -3
  66. package/lib/api/api/exists_source.js.map +1 -1
  67. package/lib/api/api/explain.d.ts +5 -6
  68. package/lib/api/api/explain.js +11 -9
  69. package/lib/api/api/explain.js.map +1 -1
  70. package/lib/api/api/features.d.ts +8 -9
  71. package/lib/api/api/features.js +26 -6
  72. package/lib/api/api/features.js.map +1 -1
  73. package/lib/api/api/field_caps.d.ts +4 -5
  74. package/lib/api/api/field_caps.js +11 -9
  75. package/lib/api/api/field_caps.js.map +1 -1
  76. package/lib/api/api/fleet.d.ts +22 -23
  77. package/lib/api/api/fleet.js +66 -24
  78. package/lib/api/api/fleet.js.map +1 -1
  79. package/lib/api/api/get.d.ts +4 -5
  80. package/lib/api/api/get.js +13 -3
  81. package/lib/api/api/get.js.map +1 -1
  82. package/lib/api/api/get_script.d.ts +4 -5
  83. package/lib/api/api/get_script.js +13 -3
  84. package/lib/api/api/get_script.js.map +1 -1
  85. package/lib/api/api/get_script_context.d.ts +4 -5
  86. package/lib/api/api/get_script_context.js +13 -3
  87. package/lib/api/api/get_script_context.js.map +1 -1
  88. package/lib/api/api/get_script_languages.d.ts +4 -5
  89. package/lib/api/api/get_script_languages.js +13 -3
  90. package/lib/api/api/get_script_languages.js.map +1 -1
  91. package/lib/api/api/get_source.d.ts +4 -5
  92. package/lib/api/api/get_source.js +13 -3
  93. package/lib/api/api/get_source.js.map +1 -1
  94. package/lib/api/api/graph.d.ts +4 -5
  95. package/lib/api/api/graph.js +11 -9
  96. package/lib/api/api/graph.js.map +1 -1
  97. package/lib/api/api/health_report.d.ts +4 -5
  98. package/lib/api/api/health_report.js +13 -3
  99. package/lib/api/api/health_report.js.map +1 -1
  100. package/lib/api/api/ilm.d.ts +44 -45
  101. package/lib/api/api/ilm.js +137 -51
  102. package/lib/api/api/ilm.js.map +1 -1
  103. package/lib/api/api/index.d.ts +5 -6
  104. package/lib/api/api/index.js +3 -3
  105. package/lib/api/api/index.js.map +1 -1
  106. package/lib/api/api/indices.d.ts +264 -244
  107. package/lib/api/api/indices.js +837 -295
  108. package/lib/api/api/indices.js.map +1 -1
  109. package/lib/api/api/inference.d.ts +31 -25
  110. package/lib/api/api/inference.js +102 -30
  111. package/lib/api/api/inference.js.map +1 -1
  112. package/lib/api/api/info.d.ts +4 -5
  113. package/lib/api/api/info.js +13 -3
  114. package/lib/api/api/info.js.map +1 -1
  115. package/lib/api/api/ingest.d.ts +48 -49
  116. package/lib/api/api/ingest.js +140 -54
  117. package/lib/api/api/ingest.js.map +1 -1
  118. package/lib/api/api/knn_search.d.ts +5 -6
  119. package/lib/api/api/knn_search.js +11 -9
  120. package/lib/api/api/knn_search.js.map +1 -1
  121. package/lib/api/api/license.d.ts +28 -29
  122. package/lib/api/api/license.js +89 -27
  123. package/lib/api/api/license.js.map +1 -1
  124. package/lib/api/api/logstash.d.ts +12 -13
  125. package/lib/api/api/logstash.js +29 -9
  126. package/lib/api/api/logstash.js.map +1 -1
  127. package/lib/api/api/mget.d.ts +5 -6
  128. package/lib/api/api/mget.js +11 -9
  129. package/lib/api/api/mget.js.map +1 -1
  130. package/lib/api/api/migration.d.ts +12 -13
  131. package/lib/api/api/migration.js +39 -9
  132. package/lib/api/api/migration.js.map +1 -1
  133. package/lib/api/api/ml.d.ts +292 -293
  134. package/lib/api/api/ml.js +855 -441
  135. package/lib/api/api/ml.js.map +1 -1
  136. package/lib/api/api/monitoring.d.ts +4 -5
  137. package/lib/api/api/monitoring.js +3 -3
  138. package/lib/api/api/monitoring.js.map +1 -1
  139. package/lib/api/api/msearch.d.ts +4 -5
  140. package/lib/api/api/msearch.js +3 -3
  141. package/lib/api/api/msearch.js.map +1 -1
  142. package/lib/api/api/msearch_template.d.ts +5 -6
  143. package/lib/api/api/msearch_template.js +3 -3
  144. package/lib/api/api/msearch_template.js.map +1 -1
  145. package/lib/api/api/mtermvectors.d.ts +5 -6
  146. package/lib/api/api/mtermvectors.js +11 -9
  147. package/lib/api/api/mtermvectors.js.map +1 -1
  148. package/lib/api/api/nodes.d.ts +28 -29
  149. package/lib/api/api/nodes.js +89 -27
  150. package/lib/api/api/nodes.js.map +1 -1
  151. package/lib/api/api/open_point_in_time.d.ts +4 -5
  152. package/lib/api/api/open_point_in_time.js +11 -9
  153. package/lib/api/api/open_point_in_time.js.map +1 -1
  154. package/lib/api/api/ping.d.ts +4 -5
  155. package/lib/api/api/ping.js +13 -3
  156. package/lib/api/api/ping.js.map +1 -1
  157. package/lib/api/api/profiling.d.ts +16 -17
  158. package/lib/api/api/profiling.js +52 -12
  159. package/lib/api/api/profiling.js.map +1 -1
  160. package/lib/api/api/put_script.d.ts +4 -5
  161. package/lib/api/api/put_script.js +11 -9
  162. package/lib/api/api/put_script.js.map +1 -1
  163. package/lib/api/api/query_rules.d.ts +32 -33
  164. package/lib/api/api/query_rules.js +98 -42
  165. package/lib/api/api/query_rules.js.map +1 -1
  166. package/lib/api/api/rank_eval.d.ts +4 -5
  167. package/lib/api/api/rank_eval.js +11 -9
  168. package/lib/api/api/rank_eval.js.map +1 -1
  169. package/lib/api/api/reindex.d.ts +5 -6
  170. package/lib/api/api/reindex.js +11 -9
  171. package/lib/api/api/reindex.js.map +1 -1
  172. package/lib/api/api/reindex_rethrottle.d.ts +4 -5
  173. package/lib/api/api/reindex_rethrottle.js +13 -3
  174. package/lib/api/api/reindex_rethrottle.js.map +1 -1
  175. package/lib/api/api/render_search_template.d.ts +4 -5
  176. package/lib/api/api/render_search_template.js +13 -11
  177. package/lib/api/api/render_search_template.js.map +1 -1
  178. package/lib/api/api/rollup.d.ts +32 -33
  179. package/lib/api/api/rollup.js +100 -36
  180. package/lib/api/api/rollup.js.map +1 -1
  181. package/lib/api/api/scripts_painless_execute.d.ts +5 -6
  182. package/lib/api/api/scripts_painless_execute.js +11 -9
  183. package/lib/api/api/scripts_painless_execute.js.map +1 -1
  184. package/lib/api/api/scroll.d.ts +4 -5
  185. package/lib/api/api/scroll.js +11 -9
  186. package/lib/api/api/scroll.js.map +1 -1
  187. package/lib/api/api/search.d.ts +4 -5
  188. package/lib/api/api/search.js +11 -11
  189. package/lib/api/api/search.js.map +1 -1
  190. package/lib/api/api/search_application.d.ts +40 -41
  191. package/lib/api/api/search_application.js +106 -42
  192. package/lib/api/api/search_application.js.map +1 -1
  193. package/lib/api/api/search_mvt.d.ts +5 -6
  194. package/lib/api/api/search_mvt.js +11 -9
  195. package/lib/api/api/search_mvt.js.map +1 -1
  196. package/lib/api/api/search_shards.d.ts +5 -6
  197. package/lib/api/api/search_shards.js +13 -3
  198. package/lib/api/api/search_shards.js.map +1 -1
  199. package/lib/api/api/search_template.d.ts +4 -5
  200. package/lib/api/api/search_template.js +11 -9
  201. package/lib/api/api/search_template.js.map +1 -1
  202. package/lib/api/api/searchable_snapshots.d.ts +16 -17
  203. package/lib/api/api/searchable_snapshots.js +50 -18
  204. package/lib/api/api/searchable_snapshots.js.map +1 -1
  205. package/lib/api/api/security.d.ts +256 -257
  206. package/lib/api/api/security.js +756 -390
  207. package/lib/api/api/security.js.map +1 -1
  208. package/lib/api/api/shutdown.d.ts +12 -13
  209. package/lib/api/api/shutdown.js +37 -15
  210. package/lib/api/api/shutdown.js.map +1 -1
  211. package/lib/api/api/simulate.d.ts +4 -5
  212. package/lib/api/api/simulate.js +11 -9
  213. package/lib/api/api/simulate.js.map +1 -1
  214. package/lib/api/api/slm.d.ts +36 -37
  215. package/lib/api/api/slm.js +115 -33
  216. package/lib/api/api/slm.js.map +1 -1
  217. package/lib/api/api/snapshot.d.ts +56 -57
  218. package/lib/api/api/snapshot.js +154 -58
  219. package/lib/api/api/snapshot.js.map +1 -1
  220. package/lib/api/api/sql.d.ts +24 -25
  221. package/lib/api/api/sql.js +72 -36
  222. package/lib/api/api/sql.js.map +1 -1
  223. package/lib/api/api/ssl.d.ts +4 -5
  224. package/lib/api/api/ssl.js +13 -3
  225. package/lib/api/api/ssl.js.map +1 -1
  226. package/lib/api/api/synonyms.d.ts +28 -29
  227. package/lib/api/api/synonyms.js +87 -33
  228. package/lib/api/api/synonyms.js.map +1 -1
  229. package/lib/api/api/tasks.d.ts +12 -13
  230. package/lib/api/api/tasks.js +39 -9
  231. package/lib/api/api/tasks.js.map +1 -1
  232. package/lib/api/api/terms_enum.d.ts +5 -6
  233. package/lib/api/api/terms_enum.js +11 -9
  234. package/lib/api/api/terms_enum.js.map +1 -1
  235. package/lib/api/api/termvectors.d.ts +5 -6
  236. package/lib/api/api/termvectors.js +11 -9
  237. package/lib/api/api/termvectors.js.map +1 -1
  238. package/lib/api/api/text_structure.d.ts +16 -17
  239. package/lib/api/api/text_structure.js +38 -24
  240. package/lib/api/api/text_structure.js.map +1 -1
  241. package/lib/api/api/transform.d.ts +48 -49
  242. package/lib/api/api/transform.js +150 -54
  243. package/lib/api/api/transform.js.map +1 -1
  244. package/lib/api/api/update.d.ts +4 -5
  245. package/lib/api/api/update.js +11 -9
  246. package/lib/api/api/update.js.map +1 -1
  247. package/lib/api/api/update_by_query.d.ts +4 -5
  248. package/lib/api/api/update_by_query.js +11 -9
  249. package/lib/api/api/update_by_query.js.map +1 -1
  250. package/lib/api/api/update_by_query_rethrottle.d.ts +4 -5
  251. package/lib/api/api/update_by_query_rethrottle.js +13 -3
  252. package/lib/api/api/update_by_query_rethrottle.js.map +1 -1
  253. package/lib/api/api/watcher.d.ts +52 -53
  254. package/lib/api/api/watcher.js +161 -63
  255. package/lib/api/api/watcher.js.map +1 -1
  256. package/lib/api/api/xpack.d.ts +8 -9
  257. package/lib/api/api/xpack.js +26 -6
  258. package/lib/api/api/xpack.js.map +1 -1
  259. package/lib/api/types.d.ts +12987 -170
  260. package/lib/client.js +4 -12
  261. package/lib/client.js.map +1 -1
  262. package/lib/helpers.js +1 -1
  263. package/lib/helpers.js.map +1 -1
  264. package/package.json +6 -7
  265. package/renovate.json +26 -0
  266. package/lib/api/typesWithBodyKey.d.ts +0 -18871
  267. package/lib/api/typesWithBodyKey.js +0 -21
  268. package/lib/api/typesWithBodyKey.js.map +0 -1
package/lib/api/api/ml.js CHANGED
@@ -30,13 +30,23 @@ class Ml {
30
30
  }
31
31
  async clearTrainedModelDeploymentCache(params, options) {
32
32
  const acceptedPath = ['model_id'];
33
- const querystring = {};
34
- const body = undefined;
33
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
34
+ const querystring = userQuery != null ? { ...userQuery } : {};
35
+ let body;
36
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
37
+ if (userBody != null) {
38
+ if (typeof userBody === 'string') {
39
+ body = userBody;
40
+ }
41
+ else {
42
+ body = { ...userBody };
43
+ }
44
+ }
35
45
  for (const key in params) {
36
46
  if (acceptedPath.includes(key)) {
37
47
  continue;
38
48
  }
39
- else if (key !== 'body') {
49
+ else if (key !== 'body' && key !== 'querystring') {
40
50
  // @ts-expect-error
41
51
  querystring[key] = params[key];
42
52
  }
@@ -54,15 +64,17 @@ class Ml {
54
64
  async closeJob(params, options) {
55
65
  const acceptedPath = ['job_id'];
56
66
  const acceptedBody = ['allow_no_match', 'force', 'timeout'];
57
- const querystring = {};
58
- // @ts-expect-error
59
- const userBody = params === null || params === void 0 ? void 0 : params.body;
67
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
68
+ const querystring = userQuery != null ? { ...userQuery } : {};
60
69
  let body;
61
- if (typeof userBody === 'string') {
62
- body = userBody;
63
- }
64
- else {
65
- body = userBody != null ? { ...userBody } : undefined;
70
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
71
+ if (userBody != null) {
72
+ if (typeof userBody === 'string') {
73
+ body = userBody;
74
+ }
75
+ else {
76
+ body = { ...userBody };
77
+ }
66
78
  }
67
79
  for (const key in params) {
68
80
  if (acceptedBody.includes(key)) {
@@ -73,7 +85,7 @@ class Ml {
73
85
  else if (acceptedPath.includes(key)) {
74
86
  continue;
75
87
  }
76
- else if (key !== 'body') {
88
+ else if (key !== 'body' && key !== 'querystring') {
77
89
  // @ts-expect-error
78
90
  querystring[key] = params[key];
79
91
  }
@@ -90,13 +102,23 @@ class Ml {
90
102
  }
91
103
  async deleteCalendar(params, options) {
92
104
  const acceptedPath = ['calendar_id'];
93
- const querystring = {};
94
- const body = undefined;
105
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
106
+ const querystring = userQuery != null ? { ...userQuery } : {};
107
+ let body;
108
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
109
+ if (userBody != null) {
110
+ if (typeof userBody === 'string') {
111
+ body = userBody;
112
+ }
113
+ else {
114
+ body = { ...userBody };
115
+ }
116
+ }
95
117
  for (const key in params) {
96
118
  if (acceptedPath.includes(key)) {
97
119
  continue;
98
120
  }
99
- else if (key !== 'body') {
121
+ else if (key !== 'body' && key !== 'querystring') {
100
122
  // @ts-expect-error
101
123
  querystring[key] = params[key];
102
124
  }
@@ -113,13 +135,23 @@ class Ml {
113
135
  }
114
136
  async deleteCalendarEvent(params, options) {
115
137
  const acceptedPath = ['calendar_id', 'event_id'];
116
- const querystring = {};
117
- const body = undefined;
138
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
139
+ const querystring = userQuery != null ? { ...userQuery } : {};
140
+ let body;
141
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
142
+ if (userBody != null) {
143
+ if (typeof userBody === 'string') {
144
+ body = userBody;
145
+ }
146
+ else {
147
+ body = { ...userBody };
148
+ }
149
+ }
118
150
  for (const key in params) {
119
151
  if (acceptedPath.includes(key)) {
120
152
  continue;
121
153
  }
122
- else if (key !== 'body') {
154
+ else if (key !== 'body' && key !== 'querystring') {
123
155
  // @ts-expect-error
124
156
  querystring[key] = params[key];
125
157
  }
@@ -137,13 +169,23 @@ class Ml {
137
169
  }
138
170
  async deleteCalendarJob(params, options) {
139
171
  const acceptedPath = ['calendar_id', 'job_id'];
140
- const querystring = {};
141
- const body = undefined;
172
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
173
+ const querystring = userQuery != null ? { ...userQuery } : {};
174
+ let body;
175
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
176
+ if (userBody != null) {
177
+ if (typeof userBody === 'string') {
178
+ body = userBody;
179
+ }
180
+ else {
181
+ body = { ...userBody };
182
+ }
183
+ }
142
184
  for (const key in params) {
143
185
  if (acceptedPath.includes(key)) {
144
186
  continue;
145
187
  }
146
- else if (key !== 'body') {
188
+ else if (key !== 'body' && key !== 'querystring') {
147
189
  // @ts-expect-error
148
190
  querystring[key] = params[key];
149
191
  }
@@ -161,13 +203,23 @@ class Ml {
161
203
  }
162
204
  async deleteDataFrameAnalytics(params, options) {
163
205
  const acceptedPath = ['id'];
164
- const querystring = {};
165
- const body = undefined;
206
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
207
+ const querystring = userQuery != null ? { ...userQuery } : {};
208
+ let body;
209
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
210
+ if (userBody != null) {
211
+ if (typeof userBody === 'string') {
212
+ body = userBody;
213
+ }
214
+ else {
215
+ body = { ...userBody };
216
+ }
217
+ }
166
218
  for (const key in params) {
167
219
  if (acceptedPath.includes(key)) {
168
220
  continue;
169
221
  }
170
- else if (key !== 'body') {
222
+ else if (key !== 'body' && key !== 'querystring') {
171
223
  // @ts-expect-error
172
224
  querystring[key] = params[key];
173
225
  }
@@ -184,13 +236,23 @@ class Ml {
184
236
  }
185
237
  async deleteDatafeed(params, options) {
186
238
  const acceptedPath = ['datafeed_id'];
187
- const querystring = {};
188
- const body = undefined;
239
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
240
+ const querystring = userQuery != null ? { ...userQuery } : {};
241
+ let body;
242
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
243
+ if (userBody != null) {
244
+ if (typeof userBody === 'string') {
245
+ body = userBody;
246
+ }
247
+ else {
248
+ body = { ...userBody };
249
+ }
250
+ }
189
251
  for (const key in params) {
190
252
  if (acceptedPath.includes(key)) {
191
253
  continue;
192
254
  }
193
- else if (key !== 'body') {
255
+ else if (key !== 'body' && key !== 'querystring') {
194
256
  // @ts-expect-error
195
257
  querystring[key] = params[key];
196
258
  }
@@ -208,15 +270,17 @@ class Ml {
208
270
  async deleteExpiredData(params, options) {
209
271
  const acceptedPath = ['job_id'];
210
272
  const acceptedBody = ['requests_per_second', 'timeout'];
211
- const querystring = {};
212
- // @ts-expect-error
213
- const userBody = params === null || params === void 0 ? void 0 : params.body;
273
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
274
+ const querystring = userQuery != null ? { ...userQuery } : {};
214
275
  let body;
215
- if (typeof userBody === 'string') {
216
- body = userBody;
217
- }
218
- else {
219
- body = userBody != null ? { ...userBody } : undefined;
276
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
277
+ if (userBody != null) {
278
+ if (typeof userBody === 'string') {
279
+ body = userBody;
280
+ }
281
+ else {
282
+ body = { ...userBody };
283
+ }
220
284
  }
221
285
  params = params !== null && params !== void 0 ? params : {};
222
286
  for (const key in params) {
@@ -228,7 +292,7 @@ class Ml {
228
292
  else if (acceptedPath.includes(key)) {
229
293
  continue;
230
294
  }
231
- else if (key !== 'body') {
295
+ else if (key !== 'body' && key !== 'querystring') {
232
296
  // @ts-expect-error
233
297
  querystring[key] = params[key];
234
298
  }
@@ -253,13 +317,23 @@ class Ml {
253
317
  }
254
318
  async deleteFilter(params, options) {
255
319
  const acceptedPath = ['filter_id'];
256
- const querystring = {};
257
- const body = undefined;
320
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
321
+ const querystring = userQuery != null ? { ...userQuery } : {};
322
+ let body;
323
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
324
+ if (userBody != null) {
325
+ if (typeof userBody === 'string') {
326
+ body = userBody;
327
+ }
328
+ else {
329
+ body = { ...userBody };
330
+ }
331
+ }
258
332
  for (const key in params) {
259
333
  if (acceptedPath.includes(key)) {
260
334
  continue;
261
335
  }
262
- else if (key !== 'body') {
336
+ else if (key !== 'body' && key !== 'querystring') {
263
337
  // @ts-expect-error
264
338
  querystring[key] = params[key];
265
339
  }
@@ -276,13 +350,23 @@ class Ml {
276
350
  }
277
351
  async deleteForecast(params, options) {
278
352
  const acceptedPath = ['job_id', 'forecast_id'];
279
- const querystring = {};
280
- const body = undefined;
353
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
354
+ const querystring = userQuery != null ? { ...userQuery } : {};
355
+ let body;
356
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
357
+ if (userBody != null) {
358
+ if (typeof userBody === 'string') {
359
+ body = userBody;
360
+ }
361
+ else {
362
+ body = { ...userBody };
363
+ }
364
+ }
281
365
  for (const key in params) {
282
366
  if (acceptedPath.includes(key)) {
283
367
  continue;
284
368
  }
285
- else if (key !== 'body') {
369
+ else if (key !== 'body' && key !== 'querystring') {
286
370
  // @ts-expect-error
287
371
  querystring[key] = params[key];
288
372
  }
@@ -308,13 +392,23 @@ class Ml {
308
392
  }
309
393
  async deleteJob(params, options) {
310
394
  const acceptedPath = ['job_id'];
311
- const querystring = {};
312
- const body = undefined;
395
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
396
+ const querystring = userQuery != null ? { ...userQuery } : {};
397
+ let body;
398
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
399
+ if (userBody != null) {
400
+ if (typeof userBody === 'string') {
401
+ body = userBody;
402
+ }
403
+ else {
404
+ body = { ...userBody };
405
+ }
406
+ }
313
407
  for (const key in params) {
314
408
  if (acceptedPath.includes(key)) {
315
409
  continue;
316
410
  }
317
- else if (key !== 'body') {
411
+ else if (key !== 'body' && key !== 'querystring') {
318
412
  // @ts-expect-error
319
413
  querystring[key] = params[key];
320
414
  }
@@ -331,13 +425,23 @@ class Ml {
331
425
  }
332
426
  async deleteModelSnapshot(params, options) {
333
427
  const acceptedPath = ['job_id', 'snapshot_id'];
334
- const querystring = {};
335
- const body = undefined;
428
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
429
+ const querystring = userQuery != null ? { ...userQuery } : {};
430
+ let body;
431
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
432
+ if (userBody != null) {
433
+ if (typeof userBody === 'string') {
434
+ body = userBody;
435
+ }
436
+ else {
437
+ body = { ...userBody };
438
+ }
439
+ }
336
440
  for (const key in params) {
337
441
  if (acceptedPath.includes(key)) {
338
442
  continue;
339
443
  }
340
- else if (key !== 'body') {
444
+ else if (key !== 'body' && key !== 'querystring') {
341
445
  // @ts-expect-error
342
446
  querystring[key] = params[key];
343
447
  }
@@ -355,13 +459,23 @@ class Ml {
355
459
  }
356
460
  async deleteTrainedModel(params, options) {
357
461
  const acceptedPath = ['model_id'];
358
- const querystring = {};
359
- const body = undefined;
462
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
463
+ const querystring = userQuery != null ? { ...userQuery } : {};
464
+ let body;
465
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
466
+ if (userBody != null) {
467
+ if (typeof userBody === 'string') {
468
+ body = userBody;
469
+ }
470
+ else {
471
+ body = { ...userBody };
472
+ }
473
+ }
360
474
  for (const key in params) {
361
475
  if (acceptedPath.includes(key)) {
362
476
  continue;
363
477
  }
364
- else if (key !== 'body') {
478
+ else if (key !== 'body' && key !== 'querystring') {
365
479
  // @ts-expect-error
366
480
  querystring[key] = params[key];
367
481
  }
@@ -378,13 +492,23 @@ class Ml {
378
492
  }
379
493
  async deleteTrainedModelAlias(params, options) {
380
494
  const acceptedPath = ['model_alias', 'model_id'];
381
- const querystring = {};
382
- const body = undefined;
495
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
496
+ const querystring = userQuery != null ? { ...userQuery } : {};
497
+ let body;
498
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
499
+ if (userBody != null) {
500
+ if (typeof userBody === 'string') {
501
+ body = userBody;
502
+ }
503
+ else {
504
+ body = { ...userBody };
505
+ }
506
+ }
383
507
  for (const key in params) {
384
508
  if (acceptedPath.includes(key)) {
385
509
  continue;
386
510
  }
387
- else if (key !== 'body') {
511
+ else if (key !== 'body' && key !== 'querystring') {
388
512
  // @ts-expect-error
389
513
  querystring[key] = params[key];
390
514
  }
@@ -403,15 +527,17 @@ class Ml {
403
527
  async estimateModelMemory(params, options) {
404
528
  const acceptedPath = [];
405
529
  const acceptedBody = ['analysis_config', 'max_bucket_cardinality', 'overall_cardinality'];
406
- const querystring = {};
407
- // @ts-expect-error
408
- const userBody = params === null || params === void 0 ? void 0 : params.body;
530
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
531
+ const querystring = userQuery != null ? { ...userQuery } : {};
409
532
  let body;
410
- if (typeof userBody === 'string') {
411
- body = userBody;
412
- }
413
- else {
414
- body = userBody != null ? { ...userBody } : undefined;
533
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
534
+ if (userBody != null) {
535
+ if (typeof userBody === 'string') {
536
+ body = userBody;
537
+ }
538
+ else {
539
+ body = { ...userBody };
540
+ }
415
541
  }
416
542
  params = params !== null && params !== void 0 ? params : {};
417
543
  for (const key in params) {
@@ -423,7 +549,7 @@ class Ml {
423
549
  else if (acceptedPath.includes(key)) {
424
550
  continue;
425
551
  }
426
- else if (key !== 'body') {
552
+ else if (key !== 'body' && key !== 'querystring') {
427
553
  // @ts-expect-error
428
554
  querystring[key] = params[key];
429
555
  }
@@ -438,15 +564,17 @@ class Ml {
438
564
  async evaluateDataFrame(params, options) {
439
565
  const acceptedPath = [];
440
566
  const acceptedBody = ['evaluation', 'index', 'query'];
441
- const querystring = {};
442
- // @ts-expect-error
443
- const userBody = params === null || params === void 0 ? void 0 : params.body;
567
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
568
+ const querystring = userQuery != null ? { ...userQuery } : {};
444
569
  let body;
445
- if (typeof userBody === 'string') {
446
- body = userBody;
447
- }
448
- else {
449
- body = userBody != null ? { ...userBody } : undefined;
570
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
571
+ if (userBody != null) {
572
+ if (typeof userBody === 'string') {
573
+ body = userBody;
574
+ }
575
+ else {
576
+ body = { ...userBody };
577
+ }
450
578
  }
451
579
  for (const key in params) {
452
580
  if (acceptedBody.includes(key)) {
@@ -457,7 +585,7 @@ class Ml {
457
585
  else if (acceptedPath.includes(key)) {
458
586
  continue;
459
587
  }
460
- else if (key !== 'body') {
588
+ else if (key !== 'body' && key !== 'querystring') {
461
589
  // @ts-expect-error
462
590
  querystring[key] = params[key];
463
591
  }
@@ -472,15 +600,17 @@ class Ml {
472
600
  async explainDataFrameAnalytics(params, options) {
473
601
  const acceptedPath = ['id'];
474
602
  const acceptedBody = ['source', 'dest', 'analysis', 'description', 'model_memory_limit', 'max_num_threads', 'analyzed_fields', 'allow_lazy_start'];
475
- const querystring = {};
476
- // @ts-expect-error
477
- const userBody = params === null || params === void 0 ? void 0 : params.body;
603
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
604
+ const querystring = userQuery != null ? { ...userQuery } : {};
478
605
  let body;
479
- if (typeof userBody === 'string') {
480
- body = userBody;
481
- }
482
- else {
483
- body = userBody != null ? { ...userBody } : undefined;
606
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
607
+ if (userBody != null) {
608
+ if (typeof userBody === 'string') {
609
+ body = userBody;
610
+ }
611
+ else {
612
+ body = { ...userBody };
613
+ }
484
614
  }
485
615
  params = params !== null && params !== void 0 ? params : {};
486
616
  for (const key in params) {
@@ -492,7 +622,7 @@ class Ml {
492
622
  else if (acceptedPath.includes(key)) {
493
623
  continue;
494
624
  }
495
- else if (key !== 'body') {
625
+ else if (key !== 'body' && key !== 'querystring') {
496
626
  // @ts-expect-error
497
627
  querystring[key] = params[key];
498
628
  }
@@ -518,15 +648,17 @@ class Ml {
518
648
  async flushJob(params, options) {
519
649
  const acceptedPath = ['job_id'];
520
650
  const acceptedBody = ['advance_time', 'calc_interim', 'end', 'skip_time', 'start'];
521
- const querystring = {};
522
- // @ts-expect-error
523
- const userBody = params === null || params === void 0 ? void 0 : params.body;
651
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
652
+ const querystring = userQuery != null ? { ...userQuery } : {};
524
653
  let body;
525
- if (typeof userBody === 'string') {
526
- body = userBody;
527
- }
528
- else {
529
- body = userBody != null ? { ...userBody } : undefined;
654
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
655
+ if (userBody != null) {
656
+ if (typeof userBody === 'string') {
657
+ body = userBody;
658
+ }
659
+ else {
660
+ body = { ...userBody };
661
+ }
530
662
  }
531
663
  for (const key in params) {
532
664
  if (acceptedBody.includes(key)) {
@@ -537,7 +669,7 @@ class Ml {
537
669
  else if (acceptedPath.includes(key)) {
538
670
  continue;
539
671
  }
540
- else if (key !== 'body') {
672
+ else if (key !== 'body' && key !== 'querystring') {
541
673
  // @ts-expect-error
542
674
  querystring[key] = params[key];
543
675
  }
@@ -555,15 +687,17 @@ class Ml {
555
687
  async forecast(params, options) {
556
688
  const acceptedPath = ['job_id'];
557
689
  const acceptedBody = ['duration', 'expires_in', 'max_model_memory'];
558
- const querystring = {};
559
- // @ts-expect-error
560
- const userBody = params === null || params === void 0 ? void 0 : params.body;
690
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
691
+ const querystring = userQuery != null ? { ...userQuery } : {};
561
692
  let body;
562
- if (typeof userBody === 'string') {
563
- body = userBody;
564
- }
565
- else {
566
- body = userBody != null ? { ...userBody } : undefined;
693
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
694
+ if (userBody != null) {
695
+ if (typeof userBody === 'string') {
696
+ body = userBody;
697
+ }
698
+ else {
699
+ body = { ...userBody };
700
+ }
567
701
  }
568
702
  for (const key in params) {
569
703
  if (acceptedBody.includes(key)) {
@@ -574,7 +708,7 @@ class Ml {
574
708
  else if (acceptedPath.includes(key)) {
575
709
  continue;
576
710
  }
577
- else if (key !== 'body') {
711
+ else if (key !== 'body' && key !== 'querystring') {
578
712
  // @ts-expect-error
579
713
  querystring[key] = params[key];
580
714
  }
@@ -592,15 +726,17 @@ class Ml {
592
726
  async getBuckets(params, options) {
593
727
  const acceptedPath = ['job_id', 'timestamp'];
594
728
  const acceptedBody = ['anomaly_score', 'desc', 'end', 'exclude_interim', 'expand', 'page', 'sort', 'start'];
595
- const querystring = {};
596
- // @ts-expect-error
597
- const userBody = params === null || params === void 0 ? void 0 : params.body;
729
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
730
+ const querystring = userQuery != null ? { ...userQuery } : {};
598
731
  let body;
599
- if (typeof userBody === 'string') {
600
- body = userBody;
601
- }
602
- else {
603
- body = userBody != null ? { ...userBody } : undefined;
732
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
733
+ if (userBody != null) {
734
+ if (typeof userBody === 'string') {
735
+ body = userBody;
736
+ }
737
+ else {
738
+ body = { ...userBody };
739
+ }
604
740
  }
605
741
  for (const key in params) {
606
742
  if (acceptedBody.includes(key)) {
@@ -611,7 +747,7 @@ class Ml {
611
747
  else if (acceptedPath.includes(key)) {
612
748
  continue;
613
749
  }
614
- else if (key !== 'body') {
750
+ else if (key !== 'body' && key !== 'querystring') {
615
751
  // @ts-expect-error
616
752
  querystring[key] = params[key];
617
753
  }
@@ -637,13 +773,23 @@ class Ml {
637
773
  }
638
774
  async getCalendarEvents(params, options) {
639
775
  const acceptedPath = ['calendar_id'];
640
- const querystring = {};
641
- const body = undefined;
776
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
777
+ const querystring = userQuery != null ? { ...userQuery } : {};
778
+ let body;
779
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
780
+ if (userBody != null) {
781
+ if (typeof userBody === 'string') {
782
+ body = userBody;
783
+ }
784
+ else {
785
+ body = { ...userBody };
786
+ }
787
+ }
642
788
  for (const key in params) {
643
789
  if (acceptedPath.includes(key)) {
644
790
  continue;
645
791
  }
646
- else if (key !== 'body') {
792
+ else if (key !== 'body' && key !== 'querystring') {
647
793
  // @ts-expect-error
648
794
  querystring[key] = params[key];
649
795
  }
@@ -661,15 +807,17 @@ class Ml {
661
807
  async getCalendars(params, options) {
662
808
  const acceptedPath = ['calendar_id'];
663
809
  const acceptedBody = ['page'];
664
- const querystring = {};
665
- // @ts-expect-error
666
- const userBody = params === null || params === void 0 ? void 0 : params.body;
810
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
811
+ const querystring = userQuery != null ? { ...userQuery } : {};
667
812
  let body;
668
- if (typeof userBody === 'string') {
669
- body = userBody;
670
- }
671
- else {
672
- body = userBody != null ? { ...userBody } : undefined;
813
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
814
+ if (userBody != null) {
815
+ if (typeof userBody === 'string') {
816
+ body = userBody;
817
+ }
818
+ else {
819
+ body = { ...userBody };
820
+ }
673
821
  }
674
822
  params = params !== null && params !== void 0 ? params : {};
675
823
  for (const key in params) {
@@ -681,7 +829,7 @@ class Ml {
681
829
  else if (acceptedPath.includes(key)) {
682
830
  continue;
683
831
  }
684
- else if (key !== 'body') {
832
+ else if (key !== 'body' && key !== 'querystring') {
685
833
  // @ts-expect-error
686
834
  querystring[key] = params[key];
687
835
  }
@@ -707,15 +855,17 @@ class Ml {
707
855
  async getCategories(params, options) {
708
856
  const acceptedPath = ['job_id', 'category_id'];
709
857
  const acceptedBody = ['page'];
710
- const querystring = {};
711
- // @ts-expect-error
712
- const userBody = params === null || params === void 0 ? void 0 : params.body;
858
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
859
+ const querystring = userQuery != null ? { ...userQuery } : {};
713
860
  let body;
714
- if (typeof userBody === 'string') {
715
- body = userBody;
716
- }
717
- else {
718
- body = userBody != null ? { ...userBody } : undefined;
861
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
862
+ if (userBody != null) {
863
+ if (typeof userBody === 'string') {
864
+ body = userBody;
865
+ }
866
+ else {
867
+ body = { ...userBody };
868
+ }
719
869
  }
720
870
  for (const key in params) {
721
871
  if (acceptedBody.includes(key)) {
@@ -726,7 +876,7 @@ class Ml {
726
876
  else if (acceptedPath.includes(key)) {
727
877
  continue;
728
878
  }
729
- else if (key !== 'body') {
879
+ else if (key !== 'body' && key !== 'querystring') {
730
880
  // @ts-expect-error
731
881
  querystring[key] = params[key];
732
882
  }
@@ -752,14 +902,24 @@ class Ml {
752
902
  }
753
903
  async getDataFrameAnalytics(params, options) {
754
904
  const acceptedPath = ['id'];
755
- const querystring = {};
756
- const body = undefined;
905
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
906
+ const querystring = userQuery != null ? { ...userQuery } : {};
907
+ let body;
908
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
909
+ if (userBody != null) {
910
+ if (typeof userBody === 'string') {
911
+ body = userBody;
912
+ }
913
+ else {
914
+ body = { ...userBody };
915
+ }
916
+ }
757
917
  params = params !== null && params !== void 0 ? params : {};
758
918
  for (const key in params) {
759
919
  if (acceptedPath.includes(key)) {
760
920
  continue;
761
921
  }
762
- else if (key !== 'body') {
922
+ else if (key !== 'body' && key !== 'querystring') {
763
923
  // @ts-expect-error
764
924
  querystring[key] = params[key];
765
925
  }
@@ -784,14 +944,24 @@ class Ml {
784
944
  }
785
945
  async getDataFrameAnalyticsStats(params, options) {
786
946
  const acceptedPath = ['id'];
787
- const querystring = {};
788
- const body = undefined;
947
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
948
+ const querystring = userQuery != null ? { ...userQuery } : {};
949
+ let body;
950
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
951
+ if (userBody != null) {
952
+ if (typeof userBody === 'string') {
953
+ body = userBody;
954
+ }
955
+ else {
956
+ body = { ...userBody };
957
+ }
958
+ }
789
959
  params = params !== null && params !== void 0 ? params : {};
790
960
  for (const key in params) {
791
961
  if (acceptedPath.includes(key)) {
792
962
  continue;
793
963
  }
794
- else if (key !== 'body') {
964
+ else if (key !== 'body' && key !== 'querystring') {
795
965
  // @ts-expect-error
796
966
  querystring[key] = params[key];
797
967
  }
@@ -816,14 +986,24 @@ class Ml {
816
986
  }
817
987
  async getDatafeedStats(params, options) {
818
988
  const acceptedPath = ['datafeed_id'];
819
- const querystring = {};
820
- const body = undefined;
989
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
990
+ const querystring = userQuery != null ? { ...userQuery } : {};
991
+ let body;
992
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
993
+ if (userBody != null) {
994
+ if (typeof userBody === 'string') {
995
+ body = userBody;
996
+ }
997
+ else {
998
+ body = { ...userBody };
999
+ }
1000
+ }
821
1001
  params = params !== null && params !== void 0 ? params : {};
822
1002
  for (const key in params) {
823
1003
  if (acceptedPath.includes(key)) {
824
1004
  continue;
825
1005
  }
826
- else if (key !== 'body') {
1006
+ else if (key !== 'body' && key !== 'querystring') {
827
1007
  // @ts-expect-error
828
1008
  querystring[key] = params[key];
829
1009
  }
@@ -848,14 +1028,24 @@ class Ml {
848
1028
  }
849
1029
  async getDatafeeds(params, options) {
850
1030
  const acceptedPath = ['datafeed_id'];
851
- const querystring = {};
852
- const body = undefined;
1031
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1032
+ const querystring = userQuery != null ? { ...userQuery } : {};
1033
+ let body;
1034
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1035
+ if (userBody != null) {
1036
+ if (typeof userBody === 'string') {
1037
+ body = userBody;
1038
+ }
1039
+ else {
1040
+ body = { ...userBody };
1041
+ }
1042
+ }
853
1043
  params = params !== null && params !== void 0 ? params : {};
854
1044
  for (const key in params) {
855
1045
  if (acceptedPath.includes(key)) {
856
1046
  continue;
857
1047
  }
858
- else if (key !== 'body') {
1048
+ else if (key !== 'body' && key !== 'querystring') {
859
1049
  // @ts-expect-error
860
1050
  querystring[key] = params[key];
861
1051
  }
@@ -880,14 +1070,24 @@ class Ml {
880
1070
  }
881
1071
  async getFilters(params, options) {
882
1072
  const acceptedPath = ['filter_id'];
883
- const querystring = {};
884
- const body = undefined;
1073
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1074
+ const querystring = userQuery != null ? { ...userQuery } : {};
1075
+ let body;
1076
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1077
+ if (userBody != null) {
1078
+ if (typeof userBody === 'string') {
1079
+ body = userBody;
1080
+ }
1081
+ else {
1082
+ body = { ...userBody };
1083
+ }
1084
+ }
885
1085
  params = params !== null && params !== void 0 ? params : {};
886
1086
  for (const key in params) {
887
1087
  if (acceptedPath.includes(key)) {
888
1088
  continue;
889
1089
  }
890
- else if (key !== 'body') {
1090
+ else if (key !== 'body' && key !== 'querystring') {
891
1091
  // @ts-expect-error
892
1092
  querystring[key] = params[key];
893
1093
  }
@@ -913,15 +1113,17 @@ class Ml {
913
1113
  async getInfluencers(params, options) {
914
1114
  const acceptedPath = ['job_id'];
915
1115
  const acceptedBody = ['page'];
916
- const querystring = {};
917
- // @ts-expect-error
918
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1116
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1117
+ const querystring = userQuery != null ? { ...userQuery } : {};
919
1118
  let body;
920
- if (typeof userBody === 'string') {
921
- body = userBody;
922
- }
923
- else {
924
- body = userBody != null ? { ...userBody } : undefined;
1119
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1120
+ if (userBody != null) {
1121
+ if (typeof userBody === 'string') {
1122
+ body = userBody;
1123
+ }
1124
+ else {
1125
+ body = { ...userBody };
1126
+ }
925
1127
  }
926
1128
  for (const key in params) {
927
1129
  if (acceptedBody.includes(key)) {
@@ -932,7 +1134,7 @@ class Ml {
932
1134
  else if (acceptedPath.includes(key)) {
933
1135
  continue;
934
1136
  }
935
- else if (key !== 'body') {
1137
+ else if (key !== 'body' && key !== 'querystring') {
936
1138
  // @ts-expect-error
937
1139
  querystring[key] = params[key];
938
1140
  }
@@ -949,14 +1151,24 @@ class Ml {
949
1151
  }
950
1152
  async getJobStats(params, options) {
951
1153
  const acceptedPath = ['job_id'];
952
- const querystring = {};
953
- const body = undefined;
1154
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1155
+ const querystring = userQuery != null ? { ...userQuery } : {};
1156
+ let body;
1157
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1158
+ if (userBody != null) {
1159
+ if (typeof userBody === 'string') {
1160
+ body = userBody;
1161
+ }
1162
+ else {
1163
+ body = { ...userBody };
1164
+ }
1165
+ }
954
1166
  params = params !== null && params !== void 0 ? params : {};
955
1167
  for (const key in params) {
956
1168
  if (acceptedPath.includes(key)) {
957
1169
  continue;
958
1170
  }
959
- else if (key !== 'body') {
1171
+ else if (key !== 'body' && key !== 'querystring') {
960
1172
  // @ts-expect-error
961
1173
  querystring[key] = params[key];
962
1174
  }
@@ -981,14 +1193,24 @@ class Ml {
981
1193
  }
982
1194
  async getJobs(params, options) {
983
1195
  const acceptedPath = ['job_id'];
984
- const querystring = {};
985
- const body = undefined;
1196
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1197
+ const querystring = userQuery != null ? { ...userQuery } : {};
1198
+ let body;
1199
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1200
+ if (userBody != null) {
1201
+ if (typeof userBody === 'string') {
1202
+ body = userBody;
1203
+ }
1204
+ else {
1205
+ body = { ...userBody };
1206
+ }
1207
+ }
986
1208
  params = params !== null && params !== void 0 ? params : {};
987
1209
  for (const key in params) {
988
1210
  if (acceptedPath.includes(key)) {
989
1211
  continue;
990
1212
  }
991
- else if (key !== 'body') {
1213
+ else if (key !== 'body' && key !== 'querystring') {
992
1214
  // @ts-expect-error
993
1215
  querystring[key] = params[key];
994
1216
  }
@@ -1013,14 +1235,24 @@ class Ml {
1013
1235
  }
1014
1236
  async getMemoryStats(params, options) {
1015
1237
  const acceptedPath = ['node_id'];
1016
- const querystring = {};
1017
- const body = undefined;
1238
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1239
+ const querystring = userQuery != null ? { ...userQuery } : {};
1240
+ let body;
1241
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1242
+ if (userBody != null) {
1243
+ if (typeof userBody === 'string') {
1244
+ body = userBody;
1245
+ }
1246
+ else {
1247
+ body = { ...userBody };
1248
+ }
1249
+ }
1018
1250
  params = params !== null && params !== void 0 ? params : {};
1019
1251
  for (const key in params) {
1020
1252
  if (acceptedPath.includes(key)) {
1021
1253
  continue;
1022
1254
  }
1023
- else if (key !== 'body') {
1255
+ else if (key !== 'body' && key !== 'querystring') {
1024
1256
  // @ts-expect-error
1025
1257
  querystring[key] = params[key];
1026
1258
  }
@@ -1045,13 +1277,23 @@ class Ml {
1045
1277
  }
1046
1278
  async getModelSnapshotUpgradeStats(params, options) {
1047
1279
  const acceptedPath = ['job_id', 'snapshot_id'];
1048
- const querystring = {};
1049
- const body = undefined;
1280
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1281
+ const querystring = userQuery != null ? { ...userQuery } : {};
1282
+ let body;
1283
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1284
+ if (userBody != null) {
1285
+ if (typeof userBody === 'string') {
1286
+ body = userBody;
1287
+ }
1288
+ else {
1289
+ body = { ...userBody };
1290
+ }
1291
+ }
1050
1292
  for (const key in params) {
1051
1293
  if (acceptedPath.includes(key)) {
1052
1294
  continue;
1053
1295
  }
1054
- else if (key !== 'body') {
1296
+ else if (key !== 'body' && key !== 'querystring') {
1055
1297
  // @ts-expect-error
1056
1298
  querystring[key] = params[key];
1057
1299
  }
@@ -1070,15 +1312,17 @@ class Ml {
1070
1312
  async getModelSnapshots(params, options) {
1071
1313
  const acceptedPath = ['job_id', 'snapshot_id'];
1072
1314
  const acceptedBody = ['desc', 'end', 'page', 'sort', 'start'];
1073
- const querystring = {};
1074
- // @ts-expect-error
1075
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1315
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1316
+ const querystring = userQuery != null ? { ...userQuery } : {};
1076
1317
  let body;
1077
- if (typeof userBody === 'string') {
1078
- body = userBody;
1079
- }
1080
- else {
1081
- body = userBody != null ? { ...userBody } : undefined;
1318
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1319
+ if (userBody != null) {
1320
+ if (typeof userBody === 'string') {
1321
+ body = userBody;
1322
+ }
1323
+ else {
1324
+ body = { ...userBody };
1325
+ }
1082
1326
  }
1083
1327
  for (const key in params) {
1084
1328
  if (acceptedBody.includes(key)) {
@@ -1089,7 +1333,7 @@ class Ml {
1089
1333
  else if (acceptedPath.includes(key)) {
1090
1334
  continue;
1091
1335
  }
1092
- else if (key !== 'body') {
1336
+ else if (key !== 'body' && key !== 'querystring') {
1093
1337
  // @ts-expect-error
1094
1338
  querystring[key] = params[key];
1095
1339
  }
@@ -1116,15 +1360,17 @@ class Ml {
1116
1360
  async getOverallBuckets(params, options) {
1117
1361
  const acceptedPath = ['job_id'];
1118
1362
  const acceptedBody = ['allow_no_match', 'bucket_span', 'end', 'exclude_interim', 'overall_score', 'start', 'top_n'];
1119
- const querystring = {};
1120
- // @ts-expect-error
1121
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1363
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1364
+ const querystring = userQuery != null ? { ...userQuery } : {};
1122
1365
  let body;
1123
- if (typeof userBody === 'string') {
1124
- body = userBody;
1125
- }
1126
- else {
1127
- body = userBody != null ? { ...userBody } : undefined;
1366
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1367
+ if (userBody != null) {
1368
+ if (typeof userBody === 'string') {
1369
+ body = userBody;
1370
+ }
1371
+ else {
1372
+ body = { ...userBody };
1373
+ }
1128
1374
  }
1129
1375
  for (const key in params) {
1130
1376
  if (acceptedBody.includes(key)) {
@@ -1135,7 +1381,7 @@ class Ml {
1135
1381
  else if (acceptedPath.includes(key)) {
1136
1382
  continue;
1137
1383
  }
1138
- else if (key !== 'body') {
1384
+ else if (key !== 'body' && key !== 'querystring') {
1139
1385
  // @ts-expect-error
1140
1386
  querystring[key] = params[key];
1141
1387
  }
@@ -1153,15 +1399,17 @@ class Ml {
1153
1399
  async getRecords(params, options) {
1154
1400
  const acceptedPath = ['job_id'];
1155
1401
  const acceptedBody = ['desc', 'end', 'exclude_interim', 'page', 'record_score', 'sort', 'start'];
1156
- const querystring = {};
1157
- // @ts-expect-error
1158
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1402
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1403
+ const querystring = userQuery != null ? { ...userQuery } : {};
1159
1404
  let body;
1160
- if (typeof userBody === 'string') {
1161
- body = userBody;
1162
- }
1163
- else {
1164
- body = userBody != null ? { ...userBody } : undefined;
1405
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1406
+ if (userBody != null) {
1407
+ if (typeof userBody === 'string') {
1408
+ body = userBody;
1409
+ }
1410
+ else {
1411
+ body = { ...userBody };
1412
+ }
1165
1413
  }
1166
1414
  for (const key in params) {
1167
1415
  if (acceptedBody.includes(key)) {
@@ -1172,7 +1420,7 @@ class Ml {
1172
1420
  else if (acceptedPath.includes(key)) {
1173
1421
  continue;
1174
1422
  }
1175
- else if (key !== 'body') {
1423
+ else if (key !== 'body' && key !== 'querystring') {
1176
1424
  // @ts-expect-error
1177
1425
  querystring[key] = params[key];
1178
1426
  }
@@ -1189,14 +1437,24 @@ class Ml {
1189
1437
  }
1190
1438
  async getTrainedModels(params, options) {
1191
1439
  const acceptedPath = ['model_id'];
1192
- const querystring = {};
1193
- const body = undefined;
1440
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1441
+ const querystring = userQuery != null ? { ...userQuery } : {};
1442
+ let body;
1443
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1444
+ if (userBody != null) {
1445
+ if (typeof userBody === 'string') {
1446
+ body = userBody;
1447
+ }
1448
+ else {
1449
+ body = { ...userBody };
1450
+ }
1451
+ }
1194
1452
  params = params !== null && params !== void 0 ? params : {};
1195
1453
  for (const key in params) {
1196
1454
  if (acceptedPath.includes(key)) {
1197
1455
  continue;
1198
1456
  }
1199
- else if (key !== 'body') {
1457
+ else if (key !== 'body' && key !== 'querystring') {
1200
1458
  // @ts-expect-error
1201
1459
  querystring[key] = params[key];
1202
1460
  }
@@ -1221,14 +1479,24 @@ class Ml {
1221
1479
  }
1222
1480
  async getTrainedModelsStats(params, options) {
1223
1481
  const acceptedPath = ['model_id'];
1224
- const querystring = {};
1225
- const body = undefined;
1482
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1483
+ const querystring = userQuery != null ? { ...userQuery } : {};
1484
+ let body;
1485
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1486
+ if (userBody != null) {
1487
+ if (typeof userBody === 'string') {
1488
+ body = userBody;
1489
+ }
1490
+ else {
1491
+ body = { ...userBody };
1492
+ }
1493
+ }
1226
1494
  params = params !== null && params !== void 0 ? params : {};
1227
1495
  for (const key in params) {
1228
1496
  if (acceptedPath.includes(key)) {
1229
1497
  continue;
1230
1498
  }
1231
- else if (key !== 'body') {
1499
+ else if (key !== 'body' && key !== 'querystring') {
1232
1500
  // @ts-expect-error
1233
1501
  querystring[key] = params[key];
1234
1502
  }
@@ -1254,15 +1522,17 @@ class Ml {
1254
1522
  async inferTrainedModel(params, options) {
1255
1523
  const acceptedPath = ['model_id'];
1256
1524
  const acceptedBody = ['docs', 'inference_config'];
1257
- const querystring = {};
1258
- // @ts-expect-error
1259
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1525
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1526
+ const querystring = userQuery != null ? { ...userQuery } : {};
1260
1527
  let body;
1261
- if (typeof userBody === 'string') {
1262
- body = userBody;
1263
- }
1264
- else {
1265
- body = userBody != null ? { ...userBody } : undefined;
1528
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1529
+ if (userBody != null) {
1530
+ if (typeof userBody === 'string') {
1531
+ body = userBody;
1532
+ }
1533
+ else {
1534
+ body = { ...userBody };
1535
+ }
1266
1536
  }
1267
1537
  for (const key in params) {
1268
1538
  if (acceptedBody.includes(key)) {
@@ -1273,7 +1543,7 @@ class Ml {
1273
1543
  else if (acceptedPath.includes(key)) {
1274
1544
  continue;
1275
1545
  }
1276
- else if (key !== 'body') {
1546
+ else if (key !== 'body' && key !== 'querystring') {
1277
1547
  // @ts-expect-error
1278
1548
  querystring[key] = params[key];
1279
1549
  }
@@ -1290,14 +1560,24 @@ class Ml {
1290
1560
  }
1291
1561
  async info(params, options) {
1292
1562
  const acceptedPath = [];
1293
- const querystring = {};
1294
- const body = undefined;
1563
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1564
+ const querystring = userQuery != null ? { ...userQuery } : {};
1565
+ let body;
1566
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1567
+ if (userBody != null) {
1568
+ if (typeof userBody === 'string') {
1569
+ body = userBody;
1570
+ }
1571
+ else {
1572
+ body = { ...userBody };
1573
+ }
1574
+ }
1295
1575
  params = params !== null && params !== void 0 ? params : {};
1296
1576
  for (const key in params) {
1297
1577
  if (acceptedPath.includes(key)) {
1298
1578
  continue;
1299
1579
  }
1300
- else if (key !== 'body') {
1580
+ else if (key !== 'body' && key !== 'querystring') {
1301
1581
  // @ts-expect-error
1302
1582
  querystring[key] = params[key];
1303
1583
  }
@@ -1312,15 +1592,17 @@ class Ml {
1312
1592
  async openJob(params, options) {
1313
1593
  const acceptedPath = ['job_id'];
1314
1594
  const acceptedBody = ['timeout'];
1315
- const querystring = {};
1316
- // @ts-expect-error
1317
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1595
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1596
+ const querystring = userQuery != null ? { ...userQuery } : {};
1318
1597
  let body;
1319
- if (typeof userBody === 'string') {
1320
- body = userBody;
1321
- }
1322
- else {
1323
- body = userBody != null ? { ...userBody } : undefined;
1598
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1599
+ if (userBody != null) {
1600
+ if (typeof userBody === 'string') {
1601
+ body = userBody;
1602
+ }
1603
+ else {
1604
+ body = { ...userBody };
1605
+ }
1324
1606
  }
1325
1607
  for (const key in params) {
1326
1608
  if (acceptedBody.includes(key)) {
@@ -1331,7 +1613,7 @@ class Ml {
1331
1613
  else if (acceptedPath.includes(key)) {
1332
1614
  continue;
1333
1615
  }
1334
- else if (key !== 'body') {
1616
+ else if (key !== 'body' && key !== 'querystring') {
1335
1617
  // @ts-expect-error
1336
1618
  querystring[key] = params[key];
1337
1619
  }
@@ -1349,15 +1631,17 @@ class Ml {
1349
1631
  async postCalendarEvents(params, options) {
1350
1632
  const acceptedPath = ['calendar_id'];
1351
1633
  const acceptedBody = ['events'];
1352
- const querystring = {};
1353
- // @ts-expect-error
1354
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1634
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1635
+ const querystring = userQuery != null ? { ...userQuery } : {};
1355
1636
  let body;
1356
- if (typeof userBody === 'string') {
1357
- body = userBody;
1358
- }
1359
- else {
1360
- body = userBody != null ? { ...userBody } : undefined;
1637
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1638
+ if (userBody != null) {
1639
+ if (typeof userBody === 'string') {
1640
+ body = userBody;
1641
+ }
1642
+ else {
1643
+ body = { ...userBody };
1644
+ }
1361
1645
  }
1362
1646
  for (const key in params) {
1363
1647
  if (acceptedBody.includes(key)) {
@@ -1368,7 +1652,7 @@ class Ml {
1368
1652
  else if (acceptedPath.includes(key)) {
1369
1653
  continue;
1370
1654
  }
1371
- else if (key !== 'body') {
1655
+ else if (key !== 'body' && key !== 'querystring') {
1372
1656
  // @ts-expect-error
1373
1657
  querystring[key] = params[key];
1374
1658
  }
@@ -1387,8 +1671,8 @@ class Ml {
1387
1671
  var _a;
1388
1672
  const acceptedPath = ['job_id'];
1389
1673
  const acceptedBody = ['data'];
1390
- const querystring = {};
1391
- // @ts-expect-error
1674
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1675
+ const querystring = userQuery != null ? { ...userQuery } : {};
1392
1676
  let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1393
1677
  for (const key in params) {
1394
1678
  if (acceptedBody.includes(key)) {
@@ -1398,7 +1682,7 @@ class Ml {
1398
1682
  else if (acceptedPath.includes(key)) {
1399
1683
  continue;
1400
1684
  }
1401
- else if (key !== 'body') {
1685
+ else if (key !== 'body' && key !== 'querystring') {
1402
1686
  // @ts-expect-error
1403
1687
  querystring[key] = params[key];
1404
1688
  }
@@ -1416,15 +1700,17 @@ class Ml {
1416
1700
  async previewDataFrameAnalytics(params, options) {
1417
1701
  const acceptedPath = ['id'];
1418
1702
  const acceptedBody = ['config'];
1419
- const querystring = {};
1420
- // @ts-expect-error
1421
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1703
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1704
+ const querystring = userQuery != null ? { ...userQuery } : {};
1422
1705
  let body;
1423
- if (typeof userBody === 'string') {
1424
- body = userBody;
1425
- }
1426
- else {
1427
- body = userBody != null ? { ...userBody } : undefined;
1706
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1707
+ if (userBody != null) {
1708
+ if (typeof userBody === 'string') {
1709
+ body = userBody;
1710
+ }
1711
+ else {
1712
+ body = { ...userBody };
1713
+ }
1428
1714
  }
1429
1715
  params = params !== null && params !== void 0 ? params : {};
1430
1716
  for (const key in params) {
@@ -1436,7 +1722,7 @@ class Ml {
1436
1722
  else if (acceptedPath.includes(key)) {
1437
1723
  continue;
1438
1724
  }
1439
- else if (key !== 'body') {
1725
+ else if (key !== 'body' && key !== 'querystring') {
1440
1726
  // @ts-expect-error
1441
1727
  querystring[key] = params[key];
1442
1728
  }
@@ -1462,15 +1748,17 @@ class Ml {
1462
1748
  async previewDatafeed(params, options) {
1463
1749
  const acceptedPath = ['datafeed_id'];
1464
1750
  const acceptedBody = ['datafeed_config', 'job_config'];
1465
- const querystring = {};
1466
- // @ts-expect-error
1467
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1751
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1752
+ const querystring = userQuery != null ? { ...userQuery } : {};
1468
1753
  let body;
1469
- if (typeof userBody === 'string') {
1470
- body = userBody;
1471
- }
1472
- else {
1473
- body = userBody != null ? { ...userBody } : undefined;
1754
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1755
+ if (userBody != null) {
1756
+ if (typeof userBody === 'string') {
1757
+ body = userBody;
1758
+ }
1759
+ else {
1760
+ body = { ...userBody };
1761
+ }
1474
1762
  }
1475
1763
  params = params !== null && params !== void 0 ? params : {};
1476
1764
  for (const key in params) {
@@ -1482,7 +1770,7 @@ class Ml {
1482
1770
  else if (acceptedPath.includes(key)) {
1483
1771
  continue;
1484
1772
  }
1485
- else if (key !== 'body') {
1773
+ else if (key !== 'body' && key !== 'querystring') {
1486
1774
  // @ts-expect-error
1487
1775
  querystring[key] = params[key];
1488
1776
  }
@@ -1508,15 +1796,17 @@ class Ml {
1508
1796
  async putCalendar(params, options) {
1509
1797
  const acceptedPath = ['calendar_id'];
1510
1798
  const acceptedBody = ['job_ids', 'description'];
1511
- const querystring = {};
1512
- // @ts-expect-error
1513
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1799
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1800
+ const querystring = userQuery != null ? { ...userQuery } : {};
1514
1801
  let body;
1515
- if (typeof userBody === 'string') {
1516
- body = userBody;
1517
- }
1518
- else {
1519
- body = userBody != null ? { ...userBody } : undefined;
1802
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1803
+ if (userBody != null) {
1804
+ if (typeof userBody === 'string') {
1805
+ body = userBody;
1806
+ }
1807
+ else {
1808
+ body = { ...userBody };
1809
+ }
1520
1810
  }
1521
1811
  for (const key in params) {
1522
1812
  if (acceptedBody.includes(key)) {
@@ -1527,7 +1817,7 @@ class Ml {
1527
1817
  else if (acceptedPath.includes(key)) {
1528
1818
  continue;
1529
1819
  }
1530
- else if (key !== 'body') {
1820
+ else if (key !== 'body' && key !== 'querystring') {
1531
1821
  // @ts-expect-error
1532
1822
  querystring[key] = params[key];
1533
1823
  }
@@ -1544,13 +1834,23 @@ class Ml {
1544
1834
  }
1545
1835
  async putCalendarJob(params, options) {
1546
1836
  const acceptedPath = ['calendar_id', 'job_id'];
1547
- const querystring = {};
1548
- const body = undefined;
1837
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1838
+ const querystring = userQuery != null ? { ...userQuery } : {};
1839
+ let body;
1840
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1841
+ if (userBody != null) {
1842
+ if (typeof userBody === 'string') {
1843
+ body = userBody;
1844
+ }
1845
+ else {
1846
+ body = { ...userBody };
1847
+ }
1848
+ }
1549
1849
  for (const key in params) {
1550
1850
  if (acceptedPath.includes(key)) {
1551
1851
  continue;
1552
1852
  }
1553
- else if (key !== 'body') {
1853
+ else if (key !== 'body' && key !== 'querystring') {
1554
1854
  // @ts-expect-error
1555
1855
  querystring[key] = params[key];
1556
1856
  }
@@ -1569,15 +1869,17 @@ class Ml {
1569
1869
  async putDataFrameAnalytics(params, options) {
1570
1870
  const acceptedPath = ['id'];
1571
1871
  const acceptedBody = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', '_meta', 'model_memory_limit', 'source', 'headers', 'version'];
1572
- const querystring = {};
1573
- // @ts-expect-error
1574
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1872
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1873
+ const querystring = userQuery != null ? { ...userQuery } : {};
1575
1874
  let body;
1576
- if (typeof userBody === 'string') {
1577
- body = userBody;
1578
- }
1579
- else {
1580
- body = userBody != null ? { ...userBody } : undefined;
1875
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1876
+ if (userBody != null) {
1877
+ if (typeof userBody === 'string') {
1878
+ body = userBody;
1879
+ }
1880
+ else {
1881
+ body = { ...userBody };
1882
+ }
1581
1883
  }
1582
1884
  for (const key in params) {
1583
1885
  if (acceptedBody.includes(key)) {
@@ -1588,7 +1890,7 @@ class Ml {
1588
1890
  else if (acceptedPath.includes(key)) {
1589
1891
  continue;
1590
1892
  }
1591
- else if (key !== 'body') {
1893
+ else if (key !== 'body' && key !== 'querystring') {
1592
1894
  // @ts-expect-error
1593
1895
  querystring[key] = params[key];
1594
1896
  }
@@ -1606,15 +1908,17 @@ class Ml {
1606
1908
  async putDatafeed(params, options) {
1607
1909
  const acceptedPath = ['datafeed_id'];
1608
1910
  const acceptedBody = ['aggregations', 'aggs', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size', 'headers'];
1609
- const querystring = {};
1610
- // @ts-expect-error
1611
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1911
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1912
+ const querystring = userQuery != null ? { ...userQuery } : {};
1612
1913
  let body;
1613
- if (typeof userBody === 'string') {
1614
- body = userBody;
1615
- }
1616
- else {
1617
- body = userBody != null ? { ...userBody } : undefined;
1914
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1915
+ if (userBody != null) {
1916
+ if (typeof userBody === 'string') {
1917
+ body = userBody;
1918
+ }
1919
+ else {
1920
+ body = { ...userBody };
1921
+ }
1618
1922
  }
1619
1923
  for (const key in params) {
1620
1924
  if (acceptedBody.includes(key)) {
@@ -1625,7 +1929,7 @@ class Ml {
1625
1929
  else if (acceptedPath.includes(key)) {
1626
1930
  continue;
1627
1931
  }
1628
- else if (key !== 'body') {
1932
+ else if (key !== 'body' && key !== 'querystring') {
1629
1933
  // @ts-expect-error
1630
1934
  querystring[key] = params[key];
1631
1935
  }
@@ -1643,15 +1947,17 @@ class Ml {
1643
1947
  async putFilter(params, options) {
1644
1948
  const acceptedPath = ['filter_id'];
1645
1949
  const acceptedBody = ['description', 'items'];
1646
- const querystring = {};
1647
- // @ts-expect-error
1648
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1950
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1951
+ const querystring = userQuery != null ? { ...userQuery } : {};
1649
1952
  let body;
1650
- if (typeof userBody === 'string') {
1651
- body = userBody;
1652
- }
1653
- else {
1654
- body = userBody != null ? { ...userBody } : undefined;
1953
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1954
+ if (userBody != null) {
1955
+ if (typeof userBody === 'string') {
1956
+ body = userBody;
1957
+ }
1958
+ else {
1959
+ body = { ...userBody };
1960
+ }
1655
1961
  }
1656
1962
  for (const key in params) {
1657
1963
  if (acceptedBody.includes(key)) {
@@ -1662,7 +1968,7 @@ class Ml {
1662
1968
  else if (acceptedPath.includes(key)) {
1663
1969
  continue;
1664
1970
  }
1665
- else if (key !== 'body') {
1971
+ else if (key !== 'body' && key !== 'querystring') {
1666
1972
  // @ts-expect-error
1667
1973
  querystring[key] = params[key];
1668
1974
  }
@@ -1680,15 +1986,17 @@ class Ml {
1680
1986
  async putJob(params, options) {
1681
1987
  const acceptedPath = [];
1682
1988
  const acceptedBody = ['allow_lazy_open', 'analysis_config', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'daily_model_snapshot_retention_after_days', 'data_description', 'datafeed_config', 'description', 'job_id', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days'];
1683
- const querystring = {};
1684
- // @ts-expect-error
1685
- const userBody = params === null || params === void 0 ? void 0 : params.body;
1989
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
1990
+ const querystring = userQuery != null ? { ...userQuery } : {};
1686
1991
  let body;
1687
- if (typeof userBody === 'string') {
1688
- body = userBody;
1689
- }
1690
- else {
1691
- body = userBody != null ? { ...userBody } : undefined;
1992
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1993
+ if (userBody != null) {
1994
+ if (typeof userBody === 'string') {
1995
+ body = userBody;
1996
+ }
1997
+ else {
1998
+ body = { ...userBody };
1999
+ }
1692
2000
  }
1693
2001
  for (const key in params) {
1694
2002
  if (acceptedBody.includes(key)) {
@@ -1699,7 +2007,7 @@ class Ml {
1699
2007
  else if (acceptedPath.includes(key)) {
1700
2008
  continue;
1701
2009
  }
1702
- else if (key !== 'body') {
2010
+ else if (key !== 'body' && key !== 'querystring') {
1703
2011
  // @ts-expect-error
1704
2012
  querystring[key] = params[key];
1705
2013
  }
@@ -1717,15 +2025,17 @@ class Ml {
1717
2025
  async putTrainedModel(params, options) {
1718
2026
  const acceptedPath = ['model_id'];
1719
2027
  const acceptedBody = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'platform_architecture', 'tags', 'prefix_strings'];
1720
- const querystring = {};
1721
- // @ts-expect-error
1722
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2028
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2029
+ const querystring = userQuery != null ? { ...userQuery } : {};
1723
2030
  let body;
1724
- if (typeof userBody === 'string') {
1725
- body = userBody;
1726
- }
1727
- else {
1728
- body = userBody != null ? { ...userBody } : undefined;
2031
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2032
+ if (userBody != null) {
2033
+ if (typeof userBody === 'string') {
2034
+ body = userBody;
2035
+ }
2036
+ else {
2037
+ body = { ...userBody };
2038
+ }
1729
2039
  }
1730
2040
  for (const key in params) {
1731
2041
  if (acceptedBody.includes(key)) {
@@ -1736,7 +2046,7 @@ class Ml {
1736
2046
  else if (acceptedPath.includes(key)) {
1737
2047
  continue;
1738
2048
  }
1739
- else if (key !== 'body') {
2049
+ else if (key !== 'body' && key !== 'querystring') {
1740
2050
  // @ts-expect-error
1741
2051
  querystring[key] = params[key];
1742
2052
  }
@@ -1753,13 +2063,23 @@ class Ml {
1753
2063
  }
1754
2064
  async putTrainedModelAlias(params, options) {
1755
2065
  const acceptedPath = ['model_alias', 'model_id'];
1756
- const querystring = {};
1757
- const body = undefined;
2066
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2067
+ const querystring = userQuery != null ? { ...userQuery } : {};
2068
+ let body;
2069
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2070
+ if (userBody != null) {
2071
+ if (typeof userBody === 'string') {
2072
+ body = userBody;
2073
+ }
2074
+ else {
2075
+ body = { ...userBody };
2076
+ }
2077
+ }
1758
2078
  for (const key in params) {
1759
2079
  if (acceptedPath.includes(key)) {
1760
2080
  continue;
1761
2081
  }
1762
- else if (key !== 'body') {
2082
+ else if (key !== 'body' && key !== 'querystring') {
1763
2083
  // @ts-expect-error
1764
2084
  querystring[key] = params[key];
1765
2085
  }
@@ -1778,15 +2098,17 @@ class Ml {
1778
2098
  async putTrainedModelDefinitionPart(params, options) {
1779
2099
  const acceptedPath = ['model_id', 'part'];
1780
2100
  const acceptedBody = ['definition', 'total_definition_length', 'total_parts'];
1781
- const querystring = {};
1782
- // @ts-expect-error
1783
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2101
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2102
+ const querystring = userQuery != null ? { ...userQuery } : {};
1784
2103
  let body;
1785
- if (typeof userBody === 'string') {
1786
- body = userBody;
1787
- }
1788
- else {
1789
- body = userBody != null ? { ...userBody } : undefined;
2104
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2105
+ if (userBody != null) {
2106
+ if (typeof userBody === 'string') {
2107
+ body = userBody;
2108
+ }
2109
+ else {
2110
+ body = { ...userBody };
2111
+ }
1790
2112
  }
1791
2113
  for (const key in params) {
1792
2114
  if (acceptedBody.includes(key)) {
@@ -1797,7 +2119,7 @@ class Ml {
1797
2119
  else if (acceptedPath.includes(key)) {
1798
2120
  continue;
1799
2121
  }
1800
- else if (key !== 'body') {
2122
+ else if (key !== 'body' && key !== 'querystring') {
1801
2123
  // @ts-expect-error
1802
2124
  querystring[key] = params[key];
1803
2125
  }
@@ -1816,15 +2138,17 @@ class Ml {
1816
2138
  async putTrainedModelVocabulary(params, options) {
1817
2139
  const acceptedPath = ['model_id'];
1818
2140
  const acceptedBody = ['vocabulary', 'merges', 'scores'];
1819
- const querystring = {};
1820
- // @ts-expect-error
1821
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2141
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2142
+ const querystring = userQuery != null ? { ...userQuery } : {};
1822
2143
  let body;
1823
- if (typeof userBody === 'string') {
1824
- body = userBody;
1825
- }
1826
- else {
1827
- body = userBody != null ? { ...userBody } : undefined;
2144
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2145
+ if (userBody != null) {
2146
+ if (typeof userBody === 'string') {
2147
+ body = userBody;
2148
+ }
2149
+ else {
2150
+ body = { ...userBody };
2151
+ }
1828
2152
  }
1829
2153
  for (const key in params) {
1830
2154
  if (acceptedBody.includes(key)) {
@@ -1835,7 +2159,7 @@ class Ml {
1835
2159
  else if (acceptedPath.includes(key)) {
1836
2160
  continue;
1837
2161
  }
1838
- else if (key !== 'body') {
2162
+ else if (key !== 'body' && key !== 'querystring') {
1839
2163
  // @ts-expect-error
1840
2164
  querystring[key] = params[key];
1841
2165
  }
@@ -1852,13 +2176,23 @@ class Ml {
1852
2176
  }
1853
2177
  async resetJob(params, options) {
1854
2178
  const acceptedPath = ['job_id'];
1855
- const querystring = {};
1856
- const body = undefined;
2179
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2180
+ const querystring = userQuery != null ? { ...userQuery } : {};
2181
+ let body;
2182
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2183
+ if (userBody != null) {
2184
+ if (typeof userBody === 'string') {
2185
+ body = userBody;
2186
+ }
2187
+ else {
2188
+ body = { ...userBody };
2189
+ }
2190
+ }
1857
2191
  for (const key in params) {
1858
2192
  if (acceptedPath.includes(key)) {
1859
2193
  continue;
1860
2194
  }
1861
- else if (key !== 'body') {
2195
+ else if (key !== 'body' && key !== 'querystring') {
1862
2196
  // @ts-expect-error
1863
2197
  querystring[key] = params[key];
1864
2198
  }
@@ -1876,15 +2210,17 @@ class Ml {
1876
2210
  async revertModelSnapshot(params, options) {
1877
2211
  const acceptedPath = ['job_id', 'snapshot_id'];
1878
2212
  const acceptedBody = ['delete_intervening_results'];
1879
- const querystring = {};
1880
- // @ts-expect-error
1881
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2213
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2214
+ const querystring = userQuery != null ? { ...userQuery } : {};
1882
2215
  let body;
1883
- if (typeof userBody === 'string') {
1884
- body = userBody;
1885
- }
1886
- else {
1887
- body = userBody != null ? { ...userBody } : undefined;
2216
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2217
+ if (userBody != null) {
2218
+ if (typeof userBody === 'string') {
2219
+ body = userBody;
2220
+ }
2221
+ else {
2222
+ body = { ...userBody };
2223
+ }
1888
2224
  }
1889
2225
  for (const key in params) {
1890
2226
  if (acceptedBody.includes(key)) {
@@ -1895,7 +2231,7 @@ class Ml {
1895
2231
  else if (acceptedPath.includes(key)) {
1896
2232
  continue;
1897
2233
  }
1898
- else if (key !== 'body') {
2234
+ else if (key !== 'body' && key !== 'querystring') {
1899
2235
  // @ts-expect-error
1900
2236
  querystring[key] = params[key];
1901
2237
  }
@@ -1913,14 +2249,24 @@ class Ml {
1913
2249
  }
1914
2250
  async setUpgradeMode(params, options) {
1915
2251
  const acceptedPath = [];
1916
- const querystring = {};
1917
- const body = undefined;
2252
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2253
+ const querystring = userQuery != null ? { ...userQuery } : {};
2254
+ let body;
2255
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2256
+ if (userBody != null) {
2257
+ if (typeof userBody === 'string') {
2258
+ body = userBody;
2259
+ }
2260
+ else {
2261
+ body = { ...userBody };
2262
+ }
2263
+ }
1918
2264
  params = params !== null && params !== void 0 ? params : {};
1919
2265
  for (const key in params) {
1920
2266
  if (acceptedPath.includes(key)) {
1921
2267
  continue;
1922
2268
  }
1923
- else if (key !== 'body') {
2269
+ else if (key !== 'body' && key !== 'querystring') {
1924
2270
  // @ts-expect-error
1925
2271
  querystring[key] = params[key];
1926
2272
  }
@@ -1934,13 +2280,23 @@ class Ml {
1934
2280
  }
1935
2281
  async startDataFrameAnalytics(params, options) {
1936
2282
  const acceptedPath = ['id'];
1937
- const querystring = {};
1938
- const body = undefined;
2283
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2284
+ const querystring = userQuery != null ? { ...userQuery } : {};
2285
+ let body;
2286
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2287
+ if (userBody != null) {
2288
+ if (typeof userBody === 'string') {
2289
+ body = userBody;
2290
+ }
2291
+ else {
2292
+ body = { ...userBody };
2293
+ }
2294
+ }
1939
2295
  for (const key in params) {
1940
2296
  if (acceptedPath.includes(key)) {
1941
2297
  continue;
1942
2298
  }
1943
- else if (key !== 'body') {
2299
+ else if (key !== 'body' && key !== 'querystring') {
1944
2300
  // @ts-expect-error
1945
2301
  querystring[key] = params[key];
1946
2302
  }
@@ -1958,15 +2314,17 @@ class Ml {
1958
2314
  async startDatafeed(params, options) {
1959
2315
  const acceptedPath = ['datafeed_id'];
1960
2316
  const acceptedBody = ['end', 'start', 'timeout'];
1961
- const querystring = {};
1962
- // @ts-expect-error
1963
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2317
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2318
+ const querystring = userQuery != null ? { ...userQuery } : {};
1964
2319
  let body;
1965
- if (typeof userBody === 'string') {
1966
- body = userBody;
1967
- }
1968
- else {
1969
- body = userBody != null ? { ...userBody } : undefined;
2320
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2321
+ if (userBody != null) {
2322
+ if (typeof userBody === 'string') {
2323
+ body = userBody;
2324
+ }
2325
+ else {
2326
+ body = { ...userBody };
2327
+ }
1970
2328
  }
1971
2329
  for (const key in params) {
1972
2330
  if (acceptedBody.includes(key)) {
@@ -1977,7 +2335,7 @@ class Ml {
1977
2335
  else if (acceptedPath.includes(key)) {
1978
2336
  continue;
1979
2337
  }
1980
- else if (key !== 'body') {
2338
+ else if (key !== 'body' && key !== 'querystring') {
1981
2339
  // @ts-expect-error
1982
2340
  querystring[key] = params[key];
1983
2341
  }
@@ -1994,13 +2352,23 @@ class Ml {
1994
2352
  }
1995
2353
  async startTrainedModelDeployment(params, options) {
1996
2354
  const acceptedPath = ['model_id'];
1997
- const querystring = {};
1998
- const body = undefined;
2355
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2356
+ const querystring = userQuery != null ? { ...userQuery } : {};
2357
+ let body;
2358
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2359
+ if (userBody != null) {
2360
+ if (typeof userBody === 'string') {
2361
+ body = userBody;
2362
+ }
2363
+ else {
2364
+ body = { ...userBody };
2365
+ }
2366
+ }
1999
2367
  for (const key in params) {
2000
2368
  if (acceptedPath.includes(key)) {
2001
2369
  continue;
2002
2370
  }
2003
- else if (key !== 'body') {
2371
+ else if (key !== 'body' && key !== 'querystring') {
2004
2372
  // @ts-expect-error
2005
2373
  querystring[key] = params[key];
2006
2374
  }
@@ -2017,13 +2385,23 @@ class Ml {
2017
2385
  }
2018
2386
  async stopDataFrameAnalytics(params, options) {
2019
2387
  const acceptedPath = ['id'];
2020
- const querystring = {};
2021
- const body = undefined;
2388
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2389
+ const querystring = userQuery != null ? { ...userQuery } : {};
2390
+ let body;
2391
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2392
+ if (userBody != null) {
2393
+ if (typeof userBody === 'string') {
2394
+ body = userBody;
2395
+ }
2396
+ else {
2397
+ body = { ...userBody };
2398
+ }
2399
+ }
2022
2400
  for (const key in params) {
2023
2401
  if (acceptedPath.includes(key)) {
2024
2402
  continue;
2025
2403
  }
2026
- else if (key !== 'body') {
2404
+ else if (key !== 'body' && key !== 'querystring') {
2027
2405
  // @ts-expect-error
2028
2406
  querystring[key] = params[key];
2029
2407
  }
@@ -2041,15 +2419,17 @@ class Ml {
2041
2419
  async stopDatafeed(params, options) {
2042
2420
  const acceptedPath = ['datafeed_id'];
2043
2421
  const acceptedBody = ['allow_no_match', 'force', 'timeout'];
2044
- const querystring = {};
2045
- // @ts-expect-error
2046
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2422
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2423
+ const querystring = userQuery != null ? { ...userQuery } : {};
2047
2424
  let body;
2048
- if (typeof userBody === 'string') {
2049
- body = userBody;
2050
- }
2051
- else {
2052
- body = userBody != null ? { ...userBody } : undefined;
2425
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2426
+ if (userBody != null) {
2427
+ if (typeof userBody === 'string') {
2428
+ body = userBody;
2429
+ }
2430
+ else {
2431
+ body = { ...userBody };
2432
+ }
2053
2433
  }
2054
2434
  for (const key in params) {
2055
2435
  if (acceptedBody.includes(key)) {
@@ -2060,7 +2440,7 @@ class Ml {
2060
2440
  else if (acceptedPath.includes(key)) {
2061
2441
  continue;
2062
2442
  }
2063
- else if (key !== 'body') {
2443
+ else if (key !== 'body' && key !== 'querystring') {
2064
2444
  // @ts-expect-error
2065
2445
  querystring[key] = params[key];
2066
2446
  }
@@ -2077,13 +2457,23 @@ class Ml {
2077
2457
  }
2078
2458
  async stopTrainedModelDeployment(params, options) {
2079
2459
  const acceptedPath = ['model_id'];
2080
- const querystring = {};
2081
- const body = undefined;
2460
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2461
+ const querystring = userQuery != null ? { ...userQuery } : {};
2462
+ let body;
2463
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2464
+ if (userBody != null) {
2465
+ if (typeof userBody === 'string') {
2466
+ body = userBody;
2467
+ }
2468
+ else {
2469
+ body = { ...userBody };
2470
+ }
2471
+ }
2082
2472
  for (const key in params) {
2083
2473
  if (acceptedPath.includes(key)) {
2084
2474
  continue;
2085
2475
  }
2086
- else if (key !== 'body') {
2476
+ else if (key !== 'body' && key !== 'querystring') {
2087
2477
  // @ts-expect-error
2088
2478
  querystring[key] = params[key];
2089
2479
  }
@@ -2101,15 +2491,17 @@ class Ml {
2101
2491
  async updateDataFrameAnalytics(params, options) {
2102
2492
  const acceptedPath = ['id'];
2103
2493
  const acceptedBody = ['description', 'model_memory_limit', 'max_num_threads', 'allow_lazy_start'];
2104
- const querystring = {};
2105
- // @ts-expect-error
2106
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2494
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2495
+ const querystring = userQuery != null ? { ...userQuery } : {};
2107
2496
  let body;
2108
- if (typeof userBody === 'string') {
2109
- body = userBody;
2110
- }
2111
- else {
2112
- body = userBody != null ? { ...userBody } : undefined;
2497
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2498
+ if (userBody != null) {
2499
+ if (typeof userBody === 'string') {
2500
+ body = userBody;
2501
+ }
2502
+ else {
2503
+ body = { ...userBody };
2504
+ }
2113
2505
  }
2114
2506
  for (const key in params) {
2115
2507
  if (acceptedBody.includes(key)) {
@@ -2120,7 +2512,7 @@ class Ml {
2120
2512
  else if (acceptedPath.includes(key)) {
2121
2513
  continue;
2122
2514
  }
2123
- else if (key !== 'body') {
2515
+ else if (key !== 'body' && key !== 'querystring') {
2124
2516
  // @ts-expect-error
2125
2517
  querystring[key] = params[key];
2126
2518
  }
@@ -2138,15 +2530,17 @@ class Ml {
2138
2530
  async updateDatafeed(params, options) {
2139
2531
  const acceptedPath = ['datafeed_id'];
2140
2532
  const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'];
2141
- const querystring = {};
2142
- // @ts-expect-error
2143
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2533
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2534
+ const querystring = userQuery != null ? { ...userQuery } : {};
2144
2535
  let body;
2145
- if (typeof userBody === 'string') {
2146
- body = userBody;
2147
- }
2148
- else {
2149
- body = userBody != null ? { ...userBody } : undefined;
2536
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2537
+ if (userBody != null) {
2538
+ if (typeof userBody === 'string') {
2539
+ body = userBody;
2540
+ }
2541
+ else {
2542
+ body = { ...userBody };
2543
+ }
2150
2544
  }
2151
2545
  for (const key in params) {
2152
2546
  if (acceptedBody.includes(key)) {
@@ -2157,7 +2551,7 @@ class Ml {
2157
2551
  else if (acceptedPath.includes(key)) {
2158
2552
  continue;
2159
2553
  }
2160
- else if (key !== 'body') {
2554
+ else if (key !== 'body' && key !== 'querystring') {
2161
2555
  // @ts-expect-error
2162
2556
  querystring[key] = params[key];
2163
2557
  }
@@ -2175,15 +2569,17 @@ class Ml {
2175
2569
  async updateFilter(params, options) {
2176
2570
  const acceptedPath = ['filter_id'];
2177
2571
  const acceptedBody = ['add_items', 'description', 'remove_items'];
2178
- const querystring = {};
2179
- // @ts-expect-error
2180
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2572
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2573
+ const querystring = userQuery != null ? { ...userQuery } : {};
2181
2574
  let body;
2182
- if (typeof userBody === 'string') {
2183
- body = userBody;
2184
- }
2185
- else {
2186
- body = userBody != null ? { ...userBody } : undefined;
2575
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2576
+ if (userBody != null) {
2577
+ if (typeof userBody === 'string') {
2578
+ body = userBody;
2579
+ }
2580
+ else {
2581
+ body = { ...userBody };
2582
+ }
2187
2583
  }
2188
2584
  for (const key in params) {
2189
2585
  if (acceptedBody.includes(key)) {
@@ -2194,7 +2590,7 @@ class Ml {
2194
2590
  else if (acceptedPath.includes(key)) {
2195
2591
  continue;
2196
2592
  }
2197
- else if (key !== 'body') {
2593
+ else if (key !== 'body' && key !== 'querystring') {
2198
2594
  // @ts-expect-error
2199
2595
  querystring[key] = params[key];
2200
2596
  }
@@ -2212,15 +2608,17 @@ class Ml {
2212
2608
  async updateJob(params, options) {
2213
2609
  const acceptedPath = ['job_id'];
2214
2610
  const acceptedBody = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'model_prune_window', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization'];
2215
- const querystring = {};
2216
- // @ts-expect-error
2217
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2611
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2612
+ const querystring = userQuery != null ? { ...userQuery } : {};
2218
2613
  let body;
2219
- if (typeof userBody === 'string') {
2220
- body = userBody;
2221
- }
2222
- else {
2223
- body = userBody != null ? { ...userBody } : undefined;
2614
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2615
+ if (userBody != null) {
2616
+ if (typeof userBody === 'string') {
2617
+ body = userBody;
2618
+ }
2619
+ else {
2620
+ body = { ...userBody };
2621
+ }
2224
2622
  }
2225
2623
  for (const key in params) {
2226
2624
  if (acceptedBody.includes(key)) {
@@ -2231,7 +2629,7 @@ class Ml {
2231
2629
  else if (acceptedPath.includes(key)) {
2232
2630
  continue;
2233
2631
  }
2234
- else if (key !== 'body') {
2632
+ else if (key !== 'body' && key !== 'querystring') {
2235
2633
  // @ts-expect-error
2236
2634
  querystring[key] = params[key];
2237
2635
  }
@@ -2249,15 +2647,17 @@ class Ml {
2249
2647
  async updateModelSnapshot(params, options) {
2250
2648
  const acceptedPath = ['job_id', 'snapshot_id'];
2251
2649
  const acceptedBody = ['description', 'retain'];
2252
- const querystring = {};
2253
- // @ts-expect-error
2254
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2650
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2651
+ const querystring = userQuery != null ? { ...userQuery } : {};
2255
2652
  let body;
2256
- if (typeof userBody === 'string') {
2257
- body = userBody;
2258
- }
2259
- else {
2260
- body = userBody != null ? { ...userBody } : undefined;
2653
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2654
+ if (userBody != null) {
2655
+ if (typeof userBody === 'string') {
2656
+ body = userBody;
2657
+ }
2658
+ else {
2659
+ body = { ...userBody };
2660
+ }
2261
2661
  }
2262
2662
  for (const key in params) {
2263
2663
  if (acceptedBody.includes(key)) {
@@ -2268,7 +2668,7 @@ class Ml {
2268
2668
  else if (acceptedPath.includes(key)) {
2269
2669
  continue;
2270
2670
  }
2271
- else if (key !== 'body') {
2671
+ else if (key !== 'body' && key !== 'querystring') {
2272
2672
  // @ts-expect-error
2273
2673
  querystring[key] = params[key];
2274
2674
  }
@@ -2287,15 +2687,17 @@ class Ml {
2287
2687
  async updateTrainedModelDeployment(params, options) {
2288
2688
  const acceptedPath = ['model_id'];
2289
2689
  const acceptedBody = ['number_of_allocations'];
2290
- const querystring = {};
2291
- // @ts-expect-error
2292
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2690
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2691
+ const querystring = userQuery != null ? { ...userQuery } : {};
2293
2692
  let body;
2294
- if (typeof userBody === 'string') {
2295
- body = userBody;
2296
- }
2297
- else {
2298
- body = userBody != null ? { ...userBody } : undefined;
2693
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2694
+ if (userBody != null) {
2695
+ if (typeof userBody === 'string') {
2696
+ body = userBody;
2697
+ }
2698
+ else {
2699
+ body = { ...userBody };
2700
+ }
2299
2701
  }
2300
2702
  for (const key in params) {
2301
2703
  if (acceptedBody.includes(key)) {
@@ -2306,7 +2708,7 @@ class Ml {
2306
2708
  else if (acceptedPath.includes(key)) {
2307
2709
  continue;
2308
2710
  }
2309
- else if (key !== 'body') {
2711
+ else if (key !== 'body' && key !== 'querystring') {
2310
2712
  // @ts-expect-error
2311
2713
  querystring[key] = params[key];
2312
2714
  }
@@ -2323,13 +2725,23 @@ class Ml {
2323
2725
  }
2324
2726
  async upgradeJobSnapshot(params, options) {
2325
2727
  const acceptedPath = ['job_id', 'snapshot_id'];
2326
- const querystring = {};
2327
- const body = undefined;
2728
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2729
+ const querystring = userQuery != null ? { ...userQuery } : {};
2730
+ let body;
2731
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2732
+ if (userBody != null) {
2733
+ if (typeof userBody === 'string') {
2734
+ body = userBody;
2735
+ }
2736
+ else {
2737
+ body = { ...userBody };
2738
+ }
2739
+ }
2328
2740
  for (const key in params) {
2329
2741
  if (acceptedPath.includes(key)) {
2330
2742
  continue;
2331
2743
  }
2332
- else if (key !== 'body') {
2744
+ else if (key !== 'body' && key !== 'querystring') {
2333
2745
  // @ts-expect-error
2334
2746
  querystring[key] = params[key];
2335
2747
  }
@@ -2348,15 +2760,17 @@ class Ml {
2348
2760
  async validate(params, options) {
2349
2761
  const acceptedPath = [];
2350
2762
  const acceptedBody = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_id', 'model_snapshot_retention_days', 'results_index_name'];
2351
- const querystring = {};
2352
- // @ts-expect-error
2353
- const userBody = params === null || params === void 0 ? void 0 : params.body;
2763
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2764
+ const querystring = userQuery != null ? { ...userQuery } : {};
2354
2765
  let body;
2355
- if (typeof userBody === 'string') {
2356
- body = userBody;
2357
- }
2358
- else {
2359
- body = userBody != null ? { ...userBody } : undefined;
2766
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
2767
+ if (userBody != null) {
2768
+ if (typeof userBody === 'string') {
2769
+ body = userBody;
2770
+ }
2771
+ else {
2772
+ body = { ...userBody };
2773
+ }
2360
2774
  }
2361
2775
  params = params !== null && params !== void 0 ? params : {};
2362
2776
  for (const key in params) {
@@ -2368,7 +2782,7 @@ class Ml {
2368
2782
  else if (acceptedPath.includes(key)) {
2369
2783
  continue;
2370
2784
  }
2371
- else if (key !== 'body') {
2785
+ else if (key !== 'body' && key !== 'querystring') {
2372
2786
  // @ts-expect-error
2373
2787
  querystring[key] = params[key];
2374
2788
  }
@@ -2384,8 +2798,8 @@ class Ml {
2384
2798
  var _a;
2385
2799
  const acceptedPath = [];
2386
2800
  const acceptedBody = ['detector'];
2387
- const querystring = {};
2388
- // @ts-expect-error
2801
+ const userQuery = params === null || params === void 0 ? void 0 : params.querystring;
2802
+ const querystring = userQuery != null ? { ...userQuery } : {};
2389
2803
  let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
2390
2804
  for (const key in params) {
2391
2805
  if (acceptedBody.includes(key)) {
@@ -2395,7 +2809,7 @@ class Ml {
2395
2809
  else if (acceptedPath.includes(key)) {
2396
2810
  continue;
2397
2811
  }
2398
- else if (key !== 'body') {
2812
+ else if (key !== 'body' && key !== 'querystring') {
2399
2813
  // @ts-expect-error
2400
2814
  querystring[key] = params[key];
2401
2815
  }