@elastic/elasticsearch 8.0.0-alpha.2 → 8.1.0

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 (137) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/NOTICE.txt +2 -0
  3. package/README.md +14 -69
  4. package/index.d.ts +2 -1
  5. package/index.js +2 -0
  6. package/lib/api/api/_internal.d.ts +20 -0
  7. package/lib/api/api/_internal.js +84 -0
  8. package/lib/api/api/_internal.js.map +1 -0
  9. package/lib/api/api/async_search.d.ts +3 -3
  10. package/lib/api/api/async_search.js +16 -4
  11. package/lib/api/api/async_search.js.map +1 -1
  12. package/lib/api/api/bulk.d.ts +3 -3
  13. package/lib/api/api/bulk.js +2 -6
  14. package/lib/api/api/bulk.js.map +1 -1
  15. package/lib/api/api/ccr.js +32 -8
  16. package/lib/api/api/ccr.js.map +1 -1
  17. package/lib/api/api/clear_scroll.js +8 -2
  18. package/lib/api/api/clear_scroll.js.map +1 -1
  19. package/lib/api/api/close_point_in_time.js +8 -2
  20. package/lib/api/api/close_point_in_time.js.map +1 -1
  21. package/lib/api/api/cluster.js +32 -8
  22. package/lib/api/api/cluster.js.map +1 -1
  23. package/lib/api/api/count.js +8 -2
  24. package/lib/api/api/count.js.map +1 -1
  25. package/lib/api/api/create.js +1 -1
  26. package/lib/api/api/create.js.map +1 -1
  27. package/lib/api/api/delete.js +1 -1
  28. package/lib/api/api/delete.js.map +1 -1
  29. package/lib/api/api/delete_by_query.js +8 -2
  30. package/lib/api/api/delete_by_query.js.map +1 -1
  31. package/lib/api/api/enrich.js +8 -2
  32. package/lib/api/api/enrich.js.map +1 -1
  33. package/lib/api/api/eql.js +9 -3
  34. package/lib/api/api/eql.js.map +1 -1
  35. package/lib/api/api/exists_source.js +1 -1
  36. package/lib/api/api/exists_source.js.map +1 -1
  37. package/lib/api/api/explain.js +8 -2
  38. package/lib/api/api/explain.js.map +1 -1
  39. package/lib/api/api/field_caps.d.ts +3 -3
  40. package/lib/api/api/field_caps.js +8 -3
  41. package/lib/api/api/field_caps.js.map +1 -1
  42. package/lib/api/api/fleet.d.ts +9 -9
  43. package/lib/api/api/fleet.js +31 -10
  44. package/lib/api/api/fleet.js.map +1 -1
  45. package/lib/api/api/graph.js +8 -2
  46. package/lib/api/api/graph.js.map +1 -1
  47. package/lib/api/api/ilm.d.ts +3 -3
  48. package/lib/api/api/ilm.js +33 -6
  49. package/lib/api/api/ilm.js.map +1 -1
  50. package/lib/api/api/indices.d.ts +3 -9
  51. package/lib/api/api/indices.js +107 -63
  52. package/lib/api/api/indices.js.map +1 -1
  53. package/lib/api/api/ingest.js +16 -4
  54. package/lib/api/api/ingest.js.map +1 -1
  55. package/lib/api/api/knn_search.d.ts +3 -3
  56. package/lib/api/api/knn_search.js +17 -3
  57. package/lib/api/api/knn_search.js.map +1 -1
  58. package/lib/api/api/license.d.ts +3 -3
  59. package/lib/api/api/license.js +8 -3
  60. package/lib/api/api/license.js.map +1 -1
  61. package/lib/api/api/mget.js +8 -2
  62. package/lib/api/api/mget.js.map +1 -1
  63. package/lib/api/api/ml.d.ts +24 -24
  64. package/lib/api/api/ml.js +378 -105
  65. package/lib/api/api/ml.js.map +1 -1
  66. package/lib/api/api/monitoring.d.ts +3 -3
  67. package/lib/api/api/monitoring.js.map +1 -1
  68. package/lib/api/api/msearch.d.ts +3 -3
  69. package/lib/api/api/msearch.js.map +1 -1
  70. package/lib/api/api/msearch_template.d.ts +3 -3
  71. package/lib/api/api/msearch_template.js.map +1 -1
  72. package/lib/api/api/mtermvectors.js +8 -2
  73. package/lib/api/api/mtermvectors.js.map +1 -1
  74. package/lib/api/api/nodes.d.ts +6 -6
  75. package/lib/api/api/nodes.js +10 -4
  76. package/lib/api/api/nodes.js.map +1 -1
  77. package/lib/api/api/put_script.js +8 -2
  78. package/lib/api/api/put_script.js.map +1 -1
  79. package/lib/api/api/rank_eval.js +8 -2
  80. package/lib/api/api/rank_eval.js.map +1 -1
  81. package/lib/api/api/reindex.d.ts +3 -3
  82. package/lib/api/api/reindex.js +8 -3
  83. package/lib/api/api/reindex.js.map +1 -1
  84. package/lib/api/api/render_search_template.js +8 -2
  85. package/lib/api/api/render_search_template.js.map +1 -1
  86. package/lib/api/api/rollup.d.ts +3 -3
  87. package/lib/api/api/rollup.js +19 -7
  88. package/lib/api/api/rollup.js.map +1 -1
  89. package/lib/api/api/scripts_painless_execute.js +8 -2
  90. package/lib/api/api/scripts_painless_execute.js.map +1 -1
  91. package/lib/api/api/scroll.d.ts +3 -3
  92. package/lib/api/api/scroll.js +16 -2
  93. package/lib/api/api/scroll.js.map +1 -1
  94. package/lib/api/api/search.d.ts +3 -3
  95. package/lib/api/api/search.js +16 -4
  96. package/lib/api/api/search.js.map +1 -1
  97. package/lib/api/api/search_mvt.js +9 -3
  98. package/lib/api/api/search_mvt.js.map +1 -1
  99. package/lib/api/api/search_template.js +8 -2
  100. package/lib/api/api/search_template.js.map +1 -1
  101. package/lib/api/api/searchable_snapshots.d.ts +3 -3
  102. package/lib/api/api/searchable_snapshots.js +9 -2
  103. package/lib/api/api/searchable_snapshots.js.map +1 -1
  104. package/lib/api/api/security.d.ts +36 -27
  105. package/lib/api/api/security.js +237 -38
  106. package/lib/api/api/security.js.map +1 -1
  107. package/lib/api/api/slm.js +8 -2
  108. package/lib/api/api/slm.js.map +1 -1
  109. package/lib/api/api/snapshot.js +32 -8
  110. package/lib/api/api/snapshot.js.map +1 -1
  111. package/lib/api/api/sql.d.ts +9 -9
  112. package/lib/api/api/sql.js +28 -10
  113. package/lib/api/api/sql.js.map +1 -1
  114. package/lib/api/api/terms_enum.js +8 -2
  115. package/lib/api/api/terms_enum.js.map +1 -1
  116. package/lib/api/api/termvectors.js +8 -2
  117. package/lib/api/api/termvectors.js.map +1 -1
  118. package/lib/api/api/transform.d.ts +6 -3
  119. package/lib/api/api/transform.js +44 -8
  120. package/lib/api/api/transform.js.map +1 -1
  121. package/lib/api/api/update.js +9 -3
  122. package/lib/api/api/update.js.map +1 -1
  123. package/lib/api/api/update_by_query.js +8 -2
  124. package/lib/api/api/update_by_query.js.map +1 -1
  125. package/lib/api/api/watcher.js +24 -6
  126. package/lib/api/api/watcher.js.map +1 -1
  127. package/lib/api/index.d.ts +4 -0
  128. package/lib/api/index.js +14 -2
  129. package/lib/api/index.js.map +1 -1
  130. package/lib/api/types.d.ts +2899 -1563
  131. package/lib/api/typesWithBodyKey.d.ts +2994 -1569
  132. package/lib/client.js +6 -1
  133. package/lib/client.js.map +1 -1
  134. package/lib/helpers.d.ts +4 -4
  135. package/lib/helpers.js +19 -12
  136. package/lib/helpers.js.map +1 -1
  137. package/package.json +3 -3
package/lib/api/api/ml.js CHANGED
@@ -30,10 +30,24 @@ class Ml {
30
30
  }
31
31
  async closeJob(params, options) {
32
32
  const acceptedPath = ['job_id'];
33
+ const acceptedBody = ['allow_no_match', 'force', 'timeout'];
33
34
  const querystring = {};
34
- const body = undefined;
35
+ // @ts-expect-error
36
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
37
+ let body;
38
+ if (typeof userBody === 'string') {
39
+ body = userBody;
40
+ }
41
+ else {
42
+ body = userBody != null ? { ...userBody } : undefined;
43
+ }
35
44
  for (const key in params) {
36
- if (acceptedPath.includes(key)) {
45
+ if (acceptedBody.includes(key)) {
46
+ body = body !== null && body !== void 0 ? body : {};
47
+ // @ts-expect-error
48
+ body[key] = params[key];
49
+ }
50
+ else if (acceptedPath.includes(key)) {
37
51
  continue;
38
52
  }
39
53
  else if (key !== 'body') {
@@ -132,11 +146,25 @@ class Ml {
132
146
  }
133
147
  async deleteExpiredData(params, options) {
134
148
  const acceptedPath = ['job_id'];
149
+ const acceptedBody = ['requests_per_second', 'timeout'];
135
150
  const querystring = {};
136
- const body = undefined;
151
+ // @ts-expect-error
152
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
153
+ let body;
154
+ if (typeof userBody === 'string') {
155
+ body = userBody;
156
+ }
157
+ else {
158
+ body = userBody != null ? { ...userBody } : undefined;
159
+ }
137
160
  params = params !== null && params !== void 0 ? params : {};
138
161
  for (const key in params) {
139
- if (acceptedPath.includes(key)) {
162
+ if (acceptedBody.includes(key)) {
163
+ body = body !== null && body !== void 0 ? body : {};
164
+ // @ts-expect-error
165
+ body[key] = params[key];
166
+ }
167
+ else if (acceptedPath.includes(key)) {
140
168
  continue;
141
169
  }
142
170
  else if (key !== 'body') {
@@ -267,12 +295,18 @@ class Ml {
267
295
  return await this.transport.request({ path, method, querystring, body }, options);
268
296
  }
269
297
  async estimateModelMemory(params, options) {
270
- var _a;
271
298
  const acceptedPath = [];
272
299
  const acceptedBody = ['analysis_config', 'max_bucket_cardinality', 'overall_cardinality'];
273
300
  const querystring = {};
274
301
  // @ts-expect-error
275
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
302
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
303
+ let body;
304
+ if (typeof userBody === 'string') {
305
+ body = userBody;
306
+ }
307
+ else {
308
+ body = userBody != null ? { ...userBody } : undefined;
309
+ }
276
310
  params = params !== null && params !== void 0 ? params : {};
277
311
  for (const key in params) {
278
312
  if (acceptedBody.includes(key)) {
@@ -293,12 +327,18 @@ class Ml {
293
327
  return await this.transport.request({ path, method, querystring, body }, options);
294
328
  }
295
329
  async evaluateDataFrame(params, options) {
296
- var _a;
297
330
  const acceptedPath = [];
298
331
  const acceptedBody = ['evaluation', 'index', 'query'];
299
332
  const querystring = {};
300
333
  // @ts-expect-error
301
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
334
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
335
+ let body;
336
+ if (typeof userBody === 'string') {
337
+ body = userBody;
338
+ }
339
+ else {
340
+ body = userBody != null ? { ...userBody } : undefined;
341
+ }
302
342
  for (const key in params) {
303
343
  if (acceptedBody.includes(key)) {
304
344
  body = body !== null && body !== void 0 ? body : {};
@@ -318,12 +358,19 @@ class Ml {
318
358
  return await this.transport.request({ path, method, querystring, body }, options);
319
359
  }
320
360
  async explainDataFrameAnalytics(params, options) {
321
- var _a;
322
361
  const acceptedPath = ['id'];
323
362
  const acceptedBody = ['source', 'dest', 'analysis', 'description', 'model_memory_limit', 'max_num_threads', 'analyzed_fields', 'allow_lazy_start'];
324
363
  const querystring = {};
325
364
  // @ts-expect-error
326
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
365
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
366
+ let body;
367
+ if (typeof userBody === 'string') {
368
+ body = userBody;
369
+ }
370
+ else {
371
+ body = userBody != null ? { ...userBody } : undefined;
372
+ }
373
+ params = params !== null && params !== void 0 ? params : {};
327
374
  for (const key in params) {
328
375
  if (acceptedBody.includes(key)) {
329
376
  body = body !== null && body !== void 0 ? body : {};
@@ -351,12 +398,18 @@ class Ml {
351
398
  return await this.transport.request({ path, method, querystring, body }, options);
352
399
  }
353
400
  async flushJob(params, options) {
354
- var _a;
355
401
  const acceptedPath = ['job_id'];
356
- const acceptedBody = ['advance_time', 'calc_interim', 'end', 'start'];
402
+ const acceptedBody = ['advance_time', 'calc_interim', 'end', 'skip_time', 'start'];
357
403
  const querystring = {};
358
404
  // @ts-expect-error
359
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
405
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
406
+ let body;
407
+ if (typeof userBody === 'string') {
408
+ body = userBody;
409
+ }
410
+ else {
411
+ body = userBody != null ? { ...userBody } : undefined;
412
+ }
360
413
  for (const key in params) {
361
414
  if (acceptedBody.includes(key)) {
362
415
  body = body !== null && body !== void 0 ? body : {};
@@ -376,12 +429,18 @@ class Ml {
376
429
  return await this.transport.request({ path, method, querystring, body }, options);
377
430
  }
378
431
  async forecast(params, options) {
379
- var _a;
380
432
  const acceptedPath = ['job_id'];
381
433
  const acceptedBody = ['duration', 'expires_in', 'max_model_memory'];
382
434
  const querystring = {};
383
435
  // @ts-expect-error
384
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
436
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
437
+ let body;
438
+ if (typeof userBody === 'string') {
439
+ body = userBody;
440
+ }
441
+ else {
442
+ body = userBody != null ? { ...userBody } : undefined;
443
+ }
385
444
  for (const key in params) {
386
445
  if (acceptedBody.includes(key)) {
387
446
  body = body !== null && body !== void 0 ? body : {};
@@ -401,12 +460,18 @@ class Ml {
401
460
  return await this.transport.request({ path, method, querystring, body }, options);
402
461
  }
403
462
  async getBuckets(params, options) {
404
- var _a;
405
463
  const acceptedPath = ['job_id', 'timestamp'];
406
- const acceptedBody = ['anomaly_score', 'desc', 'exclude_interim', 'expand', 'page', 'sort', 'start', 'end'];
464
+ const acceptedBody = ['anomaly_score', 'desc', 'end', 'exclude_interim', 'expand', 'page', 'sort', 'start'];
407
465
  const querystring = {};
408
466
  // @ts-expect-error
409
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
467
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
468
+ let body;
469
+ if (typeof userBody === 'string') {
470
+ body = userBody;
471
+ }
472
+ else {
473
+ body = userBody != null ? { ...userBody } : undefined;
474
+ }
410
475
  for (const key in params) {
411
476
  if (acceptedBody.includes(key)) {
412
477
  body = body !== null && body !== void 0 ? body : {};
@@ -451,12 +516,18 @@ class Ml {
451
516
  return await this.transport.request({ path, method, querystring, body }, options);
452
517
  }
453
518
  async getCalendars(params, options) {
454
- var _a;
455
519
  const acceptedPath = ['calendar_id'];
456
520
  const acceptedBody = ['page'];
457
521
  const querystring = {};
458
522
  // @ts-expect-error
459
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
523
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
524
+ let body;
525
+ if (typeof userBody === 'string') {
526
+ body = userBody;
527
+ }
528
+ else {
529
+ body = userBody != null ? { ...userBody } : undefined;
530
+ }
460
531
  params = params !== null && params !== void 0 ? params : {};
461
532
  for (const key in params) {
462
533
  if (acceptedBody.includes(key)) {
@@ -485,12 +556,18 @@ class Ml {
485
556
  return await this.transport.request({ path, method, querystring, body }, options);
486
557
  }
487
558
  async getCategories(params, options) {
488
- var _a;
489
559
  const acceptedPath = ['job_id', 'category_id'];
490
560
  const acceptedBody = ['page'];
491
561
  const querystring = {};
492
562
  // @ts-expect-error
493
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
563
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
564
+ let body;
565
+ if (typeof userBody === 'string') {
566
+ body = userBody;
567
+ }
568
+ else {
569
+ body = userBody != null ? { ...userBody } : undefined;
570
+ }
494
571
  for (const key in params) {
495
572
  if (acceptedBody.includes(key)) {
496
573
  body = body !== null && body !== void 0 ? body : {};
@@ -648,12 +725,18 @@ class Ml {
648
725
  return await this.transport.request({ path, method, querystring, body }, options);
649
726
  }
650
727
  async getInfluencers(params, options) {
651
- var _a;
652
728
  const acceptedPath = ['job_id'];
653
729
  const acceptedBody = ['page'];
654
730
  const querystring = {};
655
731
  // @ts-expect-error
656
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
732
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
733
+ let body;
734
+ if (typeof userBody === 'string') {
735
+ body = userBody;
736
+ }
737
+ else {
738
+ body = userBody != null ? { ...userBody } : undefined;
739
+ }
657
740
  for (const key in params) {
658
741
  if (acceptedBody.includes(key)) {
659
742
  body = body !== null && body !== void 0 ? body : {};
@@ -724,14 +807,45 @@ class Ml {
724
807
  }
725
808
  return await this.transport.request({ path, method, querystring, body }, options);
726
809
  }
727
- async getModelSnapshots(params, options) {
810
+ async getModelSnapshotUpgradeStats(params, options) {
728
811
  const acceptedPath = ['job_id', 'snapshot_id'];
729
812
  const querystring = {};
730
813
  const body = undefined;
814
+ params = params !== null && params !== void 0 ? params : {};
731
815
  for (const key in params) {
732
816
  if (acceptedPath.includes(key)) {
733
817
  continue;
734
818
  }
819
+ else if (key !== 'body') {
820
+ querystring[key] = params[key];
821
+ }
822
+ }
823
+ const method = 'GET';
824
+ const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/model_snapshots/${encodeURIComponent(params.snapshot_id.toString())}/_upgrade/_stats`;
825
+ return await this.transport.request({ path, method, querystring, body }, options);
826
+ }
827
+ async getModelSnapshots(params, options) {
828
+ const acceptedPath = ['job_id', 'snapshot_id'];
829
+ const acceptedBody = ['desc', 'end', 'page', 'sort', 'start'];
830
+ const querystring = {};
831
+ // @ts-expect-error
832
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
833
+ let body;
834
+ if (typeof userBody === 'string') {
835
+ body = userBody;
836
+ }
837
+ else {
838
+ body = userBody != null ? { ...userBody } : undefined;
839
+ }
840
+ for (const key in params) {
841
+ if (acceptedBody.includes(key)) {
842
+ body = body !== null && body !== void 0 ? body : {};
843
+ // @ts-expect-error
844
+ body[key] = params[key];
845
+ }
846
+ else if (acceptedPath.includes(key)) {
847
+ continue;
848
+ }
735
849
  else if (key !== 'body') {
736
850
  // @ts-expect-error
737
851
  querystring[key] = params[key];
@@ -750,12 +864,18 @@ class Ml {
750
864
  return await this.transport.request({ path, method, querystring, body }, options);
751
865
  }
752
866
  async getOverallBuckets(params, options) {
753
- var _a;
754
867
  const acceptedPath = ['job_id'];
755
- const acceptedBody = ['allow_no_jobs'];
868
+ const acceptedBody = ['allow_no_match', 'bucket_span', 'end', 'exclude_interim', 'overall_score', 'start', 'top_n'];
756
869
  const querystring = {};
757
870
  // @ts-expect-error
758
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
871
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
872
+ let body;
873
+ if (typeof userBody === 'string') {
874
+ body = userBody;
875
+ }
876
+ else {
877
+ body = userBody != null ? { ...userBody } : undefined;
878
+ }
759
879
  for (const key in params) {
760
880
  if (acceptedBody.includes(key)) {
761
881
  body = body !== null && body !== void 0 ? body : {};
@@ -775,12 +895,18 @@ class Ml {
775
895
  return await this.transport.request({ path, method, querystring, body }, options);
776
896
  }
777
897
  async getRecords(params, options) {
778
- var _a;
779
898
  const acceptedPath = ['job_id'];
780
- const acceptedBody = ['desc', 'exclude_interim', 'page', 'record_score', 'sort', 'start', 'end'];
899
+ const acceptedBody = ['desc', 'end', 'exclude_interim', 'page', 'record_score', 'sort', 'start'];
781
900
  const querystring = {};
782
901
  // @ts-expect-error
783
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
902
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
903
+ let body;
904
+ if (typeof userBody === 'string') {
905
+ body = userBody;
906
+ }
907
+ else {
908
+ body = userBody != null ? { ...userBody } : undefined;
909
+ }
784
910
  for (const key in params) {
785
911
  if (acceptedBody.includes(key)) {
786
912
  body = body !== null && body !== void 0 ? body : {};
@@ -799,23 +925,6 @@ class Ml {
799
925
  const path = `/_ml/anomaly_detectors/${encodeURIComponent(params.job_id.toString())}/results/records`;
800
926
  return await this.transport.request({ path, method, querystring, body }, options);
801
927
  }
802
- async getTrainedModelDeploymentStats(params, options) {
803
- const acceptedPath = ['model_id'];
804
- const querystring = {};
805
- const body = undefined;
806
- params = params !== null && params !== void 0 ? params : {};
807
- for (const key in params) {
808
- if (acceptedPath.includes(key)) {
809
- continue;
810
- }
811
- else if (key !== 'body') {
812
- querystring[key] = params[key];
813
- }
814
- }
815
- const method = 'GET';
816
- const path = `/_ml/trained_models/${encodeURIComponent(params.model_id.toString())}/deployment/_stats`;
817
- return await this.transport.request({ path, method, querystring, body }, options);
818
- }
819
928
  async getTrainedModels(params, options) {
820
929
  const acceptedPath = ['model_id'];
821
930
  const querystring = {};
@@ -870,14 +979,28 @@ class Ml {
870
979
  }
871
980
  async inferTrainedModelDeployment(params, options) {
872
981
  const acceptedPath = ['model_id'];
982
+ const acceptedBody = ['docs'];
873
983
  const querystring = {};
874
- const body = undefined;
875
- params = params !== null && params !== void 0 ? params : {};
984
+ // @ts-expect-error
985
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
986
+ let body;
987
+ if (typeof userBody === 'string') {
988
+ body = userBody;
989
+ }
990
+ else {
991
+ body = userBody != null ? { ...userBody } : undefined;
992
+ }
876
993
  for (const key in params) {
877
- if (acceptedPath.includes(key)) {
994
+ if (acceptedBody.includes(key)) {
995
+ body = body !== null && body !== void 0 ? body : {};
996
+ // @ts-expect-error
997
+ body[key] = params[key];
998
+ }
999
+ else if (acceptedPath.includes(key)) {
878
1000
  continue;
879
1001
  }
880
1002
  else if (key !== 'body') {
1003
+ // @ts-expect-error
881
1004
  querystring[key] = params[key];
882
1005
  }
883
1006
  }
@@ -904,12 +1027,18 @@ class Ml {
904
1027
  return await this.transport.request({ path, method, querystring, body }, options);
905
1028
  }
906
1029
  async openJob(params, options) {
907
- var _a;
908
1030
  const acceptedPath = ['job_id'];
909
1031
  const acceptedBody = ['timeout'];
910
1032
  const querystring = {};
911
1033
  // @ts-expect-error
912
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1034
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1035
+ let body;
1036
+ if (typeof userBody === 'string') {
1037
+ body = userBody;
1038
+ }
1039
+ else {
1040
+ body = userBody != null ? { ...userBody } : undefined;
1041
+ }
913
1042
  for (const key in params) {
914
1043
  if (acceptedBody.includes(key)) {
915
1044
  body = body !== null && body !== void 0 ? body : {};
@@ -929,12 +1058,18 @@ class Ml {
929
1058
  return await this.transport.request({ path, method, querystring, body }, options);
930
1059
  }
931
1060
  async postCalendarEvents(params, options) {
932
- var _a;
933
1061
  const acceptedPath = ['calendar_id'];
934
1062
  const acceptedBody = ['events'];
935
1063
  const querystring = {};
936
1064
  // @ts-expect-error
937
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1065
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1066
+ let body;
1067
+ if (typeof userBody === 'string') {
1068
+ body = userBody;
1069
+ }
1070
+ else {
1071
+ body = userBody != null ? { ...userBody } : undefined;
1072
+ }
938
1073
  for (const key in params) {
939
1074
  if (acceptedBody.includes(key)) {
940
1075
  body = body !== null && body !== void 0 ? body : {};
@@ -978,12 +1113,18 @@ class Ml {
978
1113
  return await this.transport.request({ path, method, querystring, bulkBody: body }, options);
979
1114
  }
980
1115
  async previewDataFrameAnalytics(params, options) {
981
- var _a;
982
1116
  const acceptedPath = ['id'];
983
1117
  const acceptedBody = ['config'];
984
1118
  const querystring = {};
985
1119
  // @ts-expect-error
986
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1120
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1121
+ let body;
1122
+ if (typeof userBody === 'string') {
1123
+ body = userBody;
1124
+ }
1125
+ else {
1126
+ body = userBody != null ? { ...userBody } : undefined;
1127
+ }
987
1128
  params = params !== null && params !== void 0 ? params : {};
988
1129
  for (const key in params) {
989
1130
  if (acceptedBody.includes(key)) {
@@ -1012,12 +1153,18 @@ class Ml {
1012
1153
  return await this.transport.request({ path, method, querystring, body }, options);
1013
1154
  }
1014
1155
  async previewDatafeed(params, options) {
1015
- var _a;
1016
1156
  const acceptedPath = ['datafeed_id'];
1017
- const acceptedBody = ['job_config', 'datafeed_config'];
1157
+ const acceptedBody = ['datafeed_config', 'job_config'];
1018
1158
  const querystring = {};
1019
1159
  // @ts-expect-error
1020
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1160
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1161
+ let body;
1162
+ if (typeof userBody === 'string') {
1163
+ body = userBody;
1164
+ }
1165
+ else {
1166
+ body = userBody != null ? { ...userBody } : undefined;
1167
+ }
1021
1168
  params = params !== null && params !== void 0 ? params : {};
1022
1169
  for (const key in params) {
1023
1170
  if (acceptedBody.includes(key)) {
@@ -1046,12 +1193,18 @@ class Ml {
1046
1193
  return await this.transport.request({ path, method, querystring, body }, options);
1047
1194
  }
1048
1195
  async putCalendar(params, options) {
1049
- var _a;
1050
1196
  const acceptedPath = ['calendar_id'];
1051
- const acceptedBody = ['description'];
1197
+ const acceptedBody = ['job_ids', 'description'];
1052
1198
  const querystring = {};
1053
1199
  // @ts-expect-error
1054
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1200
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1201
+ let body;
1202
+ if (typeof userBody === 'string') {
1203
+ body = userBody;
1204
+ }
1205
+ else {
1206
+ body = userBody != null ? { ...userBody } : undefined;
1207
+ }
1055
1208
  for (const key in params) {
1056
1209
  if (acceptedBody.includes(key)) {
1057
1210
  body = body !== null && body !== void 0 ? body : {};
@@ -1088,12 +1241,18 @@ class Ml {
1088
1241
  return await this.transport.request({ path, method, querystring, body }, options);
1089
1242
  }
1090
1243
  async putDataFrameAnalytics(params, options) {
1091
- var _a;
1092
1244
  const acceptedPath = ['id'];
1093
- const acceptedBody = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source'];
1245
+ const acceptedBody = ['allow_lazy_start', 'analysis', 'analyzed_fields', 'description', 'dest', 'max_num_threads', 'model_memory_limit', 'source', 'headers', 'version'];
1094
1246
  const querystring = {};
1095
1247
  // @ts-expect-error
1096
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1248
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1249
+ let body;
1250
+ if (typeof userBody === 'string') {
1251
+ body = userBody;
1252
+ }
1253
+ else {
1254
+ body = userBody != null ? { ...userBody } : undefined;
1255
+ }
1097
1256
  for (const key in params) {
1098
1257
  if (acceptedBody.includes(key)) {
1099
1258
  body = body !== null && body !== void 0 ? body : {};
@@ -1113,12 +1272,18 @@ class Ml {
1113
1272
  return await this.transport.request({ path, method, querystring, body }, options);
1114
1273
  }
1115
1274
  async putDatafeed(params, options) {
1116
- var _a;
1117
1275
  const acceptedPath = ['datafeed_id'];
1118
- const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indices_options', 'job_id', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'];
1276
+ 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', 'headers'];
1119
1277
  const querystring = {};
1120
1278
  // @ts-expect-error
1121
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1279
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1280
+ let body;
1281
+ if (typeof userBody === 'string') {
1282
+ body = userBody;
1283
+ }
1284
+ else {
1285
+ body = userBody != null ? { ...userBody } : undefined;
1286
+ }
1122
1287
  for (const key in params) {
1123
1288
  if (acceptedBody.includes(key)) {
1124
1289
  body = body !== null && body !== void 0 ? body : {};
@@ -1138,12 +1303,18 @@ class Ml {
1138
1303
  return await this.transport.request({ path, method, querystring, body }, options);
1139
1304
  }
1140
1305
  async putFilter(params, options) {
1141
- var _a;
1142
1306
  const acceptedPath = ['filter_id'];
1143
1307
  const acceptedBody = ['description', 'items'];
1144
1308
  const querystring = {};
1145
1309
  // @ts-expect-error
1146
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1310
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1311
+ let body;
1312
+ if (typeof userBody === 'string') {
1313
+ body = userBody;
1314
+ }
1315
+ else {
1316
+ body = userBody != null ? { ...userBody } : undefined;
1317
+ }
1147
1318
  for (const key in params) {
1148
1319
  if (acceptedBody.includes(key)) {
1149
1320
  body = body !== null && body !== void 0 ? body : {};
@@ -1163,12 +1334,18 @@ class Ml {
1163
1334
  return await this.transport.request({ path, method, querystring, body }, options);
1164
1335
  }
1165
1336
  async putJob(params, options) {
1166
- var _a;
1167
1337
  const acceptedPath = ['job_id'];
1168
1338
  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', 'groups', 'model_plot_config', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_index_name', 'results_retention_days'];
1169
1339
  const querystring = {};
1170
1340
  // @ts-expect-error
1171
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1341
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1342
+ let body;
1343
+ if (typeof userBody === 'string') {
1344
+ body = userBody;
1345
+ }
1346
+ else {
1347
+ body = userBody != null ? { ...userBody } : undefined;
1348
+ }
1172
1349
  for (const key in params) {
1173
1350
  if (acceptedBody.includes(key)) {
1174
1351
  body = body !== null && body !== void 0 ? body : {};
@@ -1188,12 +1365,18 @@ class Ml {
1188
1365
  return await this.transport.request({ path, method, querystring, body }, options);
1189
1366
  }
1190
1367
  async putTrainedModel(params, options) {
1191
- var _a;
1192
1368
  const acceptedPath = ['model_id'];
1193
- const acceptedBody = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'tags'];
1369
+ const acceptedBody = ['compressed_definition', 'definition', 'description', 'inference_config', 'input', 'metadata', 'model_type', 'model_size_bytes', 'tags'];
1194
1370
  const querystring = {};
1195
1371
  // @ts-expect-error
1196
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1372
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1373
+ let body;
1374
+ if (typeof userBody === 'string') {
1375
+ body = userBody;
1376
+ }
1377
+ else {
1378
+ body = userBody != null ? { ...userBody } : undefined;
1379
+ }
1197
1380
  for (const key in params) {
1198
1381
  if (acceptedBody.includes(key)) {
1199
1382
  body = body !== null && body !== void 0 ? body : {};
@@ -1231,14 +1414,28 @@ class Ml {
1231
1414
  }
1232
1415
  async putTrainedModelDefinitionPart(params, options) {
1233
1416
  const acceptedPath = ['model_id', 'part'];
1417
+ const acceptedBody = ['definition', 'total_definition_length', 'total_parts'];
1234
1418
  const querystring = {};
1235
- const body = undefined;
1236
- params = params !== null && params !== void 0 ? params : {};
1419
+ // @ts-expect-error
1420
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1421
+ let body;
1422
+ if (typeof userBody === 'string') {
1423
+ body = userBody;
1424
+ }
1425
+ else {
1426
+ body = userBody != null ? { ...userBody } : undefined;
1427
+ }
1237
1428
  for (const key in params) {
1238
- if (acceptedPath.includes(key)) {
1429
+ if (acceptedBody.includes(key)) {
1430
+ body = body !== null && body !== void 0 ? body : {};
1431
+ // @ts-expect-error
1432
+ body[key] = params[key];
1433
+ }
1434
+ else if (acceptedPath.includes(key)) {
1239
1435
  continue;
1240
1436
  }
1241
1437
  else if (key !== 'body') {
1438
+ // @ts-expect-error
1242
1439
  querystring[key] = params[key];
1243
1440
  }
1244
1441
  }
@@ -1248,14 +1445,28 @@ class Ml {
1248
1445
  }
1249
1446
  async putTrainedModelVocabulary(params, options) {
1250
1447
  const acceptedPath = ['model_id'];
1448
+ const acceptedBody = ['vocabulary'];
1251
1449
  const querystring = {};
1252
- const body = undefined;
1253
- params = params !== null && params !== void 0 ? params : {};
1450
+ // @ts-expect-error
1451
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1452
+ let body;
1453
+ if (typeof userBody === 'string') {
1454
+ body = userBody;
1455
+ }
1456
+ else {
1457
+ body = userBody != null ? { ...userBody } : undefined;
1458
+ }
1254
1459
  for (const key in params) {
1255
- if (acceptedPath.includes(key)) {
1460
+ if (acceptedBody.includes(key)) {
1461
+ body = body !== null && body !== void 0 ? body : {};
1462
+ // @ts-expect-error
1463
+ body[key] = params[key];
1464
+ }
1465
+ else if (acceptedPath.includes(key)) {
1256
1466
  continue;
1257
1467
  }
1258
1468
  else if (key !== 'body') {
1469
+ // @ts-expect-error
1259
1470
  querystring[key] = params[key];
1260
1471
  }
1261
1472
  }
@@ -1281,12 +1492,18 @@ class Ml {
1281
1492
  return await this.transport.request({ path, method, querystring, body }, options);
1282
1493
  }
1283
1494
  async revertModelSnapshot(params, options) {
1284
- var _a;
1285
1495
  const acceptedPath = ['job_id', 'snapshot_id'];
1286
1496
  const acceptedBody = ['delete_intervening_results'];
1287
1497
  const querystring = {};
1288
1498
  // @ts-expect-error
1289
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1499
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1500
+ let body;
1501
+ if (typeof userBody === 'string') {
1502
+ body = userBody;
1503
+ }
1504
+ else {
1505
+ body = userBody != null ? { ...userBody } : undefined;
1506
+ }
1290
1507
  for (const key in params) {
1291
1508
  if (acceptedBody.includes(key)) {
1292
1509
  body = body !== null && body !== void 0 ? body : {};
@@ -1341,12 +1558,18 @@ class Ml {
1341
1558
  return await this.transport.request({ path, method, querystring, body }, options);
1342
1559
  }
1343
1560
  async startDatafeed(params, options) {
1344
- var _a;
1345
1561
  const acceptedPath = ['datafeed_id'];
1346
1562
  const acceptedBody = ['end', 'start', 'timeout'];
1347
1563
  const querystring = {};
1348
1564
  // @ts-expect-error
1349
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1565
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1566
+ let body;
1567
+ if (typeof userBody === 'string') {
1568
+ body = userBody;
1569
+ }
1570
+ else {
1571
+ body = userBody != null ? { ...userBody } : undefined;
1572
+ }
1350
1573
  for (const key in params) {
1351
1574
  if (acceptedBody.includes(key)) {
1352
1575
  body = body !== null && body !== void 0 ? body : {};
@@ -1369,12 +1592,12 @@ class Ml {
1369
1592
  const acceptedPath = ['model_id'];
1370
1593
  const querystring = {};
1371
1594
  const body = undefined;
1372
- params = params !== null && params !== void 0 ? params : {};
1373
1595
  for (const key in params) {
1374
1596
  if (acceptedPath.includes(key)) {
1375
1597
  continue;
1376
1598
  }
1377
1599
  else if (key !== 'body') {
1600
+ // @ts-expect-error
1378
1601
  querystring[key] = params[key];
1379
1602
  }
1380
1603
  }
@@ -1400,12 +1623,18 @@ class Ml {
1400
1623
  return await this.transport.request({ path, method, querystring, body }, options);
1401
1624
  }
1402
1625
  async stopDatafeed(params, options) {
1403
- var _a;
1404
1626
  const acceptedPath = ['datafeed_id'];
1405
- const acceptedBody = ['force', 'timeout'];
1627
+ const acceptedBody = ['allow_no_match', 'force', 'timeout'];
1406
1628
  const querystring = {};
1407
1629
  // @ts-expect-error
1408
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1630
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1631
+ let body;
1632
+ if (typeof userBody === 'string') {
1633
+ body = userBody;
1634
+ }
1635
+ else {
1636
+ body = userBody != null ? { ...userBody } : undefined;
1637
+ }
1409
1638
  for (const key in params) {
1410
1639
  if (acceptedBody.includes(key)) {
1411
1640
  body = body !== null && body !== void 0 ? body : {};
@@ -1428,12 +1657,12 @@ class Ml {
1428
1657
  const acceptedPath = ['model_id'];
1429
1658
  const querystring = {};
1430
1659
  const body = undefined;
1431
- params = params !== null && params !== void 0 ? params : {};
1432
1660
  for (const key in params) {
1433
1661
  if (acceptedPath.includes(key)) {
1434
1662
  continue;
1435
1663
  }
1436
1664
  else if (key !== 'body') {
1665
+ // @ts-expect-error
1437
1666
  querystring[key] = params[key];
1438
1667
  }
1439
1668
  }
@@ -1442,12 +1671,18 @@ class Ml {
1442
1671
  return await this.transport.request({ path, method, querystring, body }, options);
1443
1672
  }
1444
1673
  async updateDataFrameAnalytics(params, options) {
1445
- var _a;
1446
1674
  const acceptedPath = ['id'];
1447
1675
  const acceptedBody = ['description', 'model_memory_limit', 'max_num_threads', 'allow_lazy_start'];
1448
1676
  const querystring = {};
1449
1677
  // @ts-expect-error
1450
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1678
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1679
+ let body;
1680
+ if (typeof userBody === 'string') {
1681
+ body = userBody;
1682
+ }
1683
+ else {
1684
+ body = userBody != null ? { ...userBody } : undefined;
1685
+ }
1451
1686
  for (const key in params) {
1452
1687
  if (acceptedBody.includes(key)) {
1453
1688
  body = body !== null && body !== void 0 ? body : {};
@@ -1468,14 +1703,28 @@ class Ml {
1468
1703
  }
1469
1704
  async updateDatafeed(params, options) {
1470
1705
  const acceptedPath = ['datafeed_id'];
1706
+ const acceptedBody = ['aggregations', 'chunking_config', 'delayed_data_check_config', 'frequency', 'indices', 'indexes', 'indices_options', 'max_empty_searches', 'query', 'query_delay', 'runtime_mappings', 'script_fields', 'scroll_size'];
1471
1707
  const querystring = {};
1472
- const body = undefined;
1473
- params = params !== null && params !== void 0 ? params : {};
1708
+ // @ts-expect-error
1709
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1710
+ let body;
1711
+ if (typeof userBody === 'string') {
1712
+ body = userBody;
1713
+ }
1714
+ else {
1715
+ body = userBody != null ? { ...userBody } : undefined;
1716
+ }
1474
1717
  for (const key in params) {
1475
- if (acceptedPath.includes(key)) {
1718
+ if (acceptedBody.includes(key)) {
1719
+ body = body !== null && body !== void 0 ? body : {};
1720
+ // @ts-expect-error
1721
+ body[key] = params[key];
1722
+ }
1723
+ else if (acceptedPath.includes(key)) {
1476
1724
  continue;
1477
1725
  }
1478
1726
  else if (key !== 'body') {
1727
+ // @ts-expect-error
1479
1728
  querystring[key] = params[key];
1480
1729
  }
1481
1730
  }
@@ -1484,12 +1733,18 @@ class Ml {
1484
1733
  return await this.transport.request({ path, method, querystring, body }, options);
1485
1734
  }
1486
1735
  async updateFilter(params, options) {
1487
- var _a;
1488
1736
  const acceptedPath = ['filter_id'];
1489
1737
  const acceptedBody = ['add_items', 'description', 'remove_items'];
1490
1738
  const querystring = {};
1491
1739
  // @ts-expect-error
1492
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1740
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1741
+ let body;
1742
+ if (typeof userBody === 'string') {
1743
+ body = userBody;
1744
+ }
1745
+ else {
1746
+ body = userBody != null ? { ...userBody } : undefined;
1747
+ }
1493
1748
  for (const key in params) {
1494
1749
  if (acceptedBody.includes(key)) {
1495
1750
  body = body !== null && body !== void 0 ? body : {};
@@ -1509,12 +1764,18 @@ class Ml {
1509
1764
  return await this.transport.request({ path, method, querystring, body }, options);
1510
1765
  }
1511
1766
  async updateJob(params, options) {
1512
- var _a;
1513
1767
  const acceptedPath = ['job_id'];
1514
1768
  const acceptedBody = ['allow_lazy_open', 'analysis_limits', 'background_persist_interval', 'custom_settings', 'categorization_filters', 'description', 'model_plot_config', 'daily_model_snapshot_retention_after_days', 'model_snapshot_retention_days', 'renormalization_window_days', 'results_retention_days', 'groups', 'detectors', 'per_partition_categorization'];
1515
1769
  const querystring = {};
1516
1770
  // @ts-expect-error
1517
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1771
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1772
+ let body;
1773
+ if (typeof userBody === 'string') {
1774
+ body = userBody;
1775
+ }
1776
+ else {
1777
+ body = userBody != null ? { ...userBody } : undefined;
1778
+ }
1518
1779
  for (const key in params) {
1519
1780
  if (acceptedBody.includes(key)) {
1520
1781
  body = body !== null && body !== void 0 ? body : {};
@@ -1534,12 +1795,18 @@ class Ml {
1534
1795
  return await this.transport.request({ path, method, querystring, body }, options);
1535
1796
  }
1536
1797
  async updateModelSnapshot(params, options) {
1537
- var _a;
1538
1798
  const acceptedPath = ['job_id', 'snapshot_id'];
1539
1799
  const acceptedBody = ['description', 'retain'];
1540
1800
  const querystring = {};
1541
1801
  // @ts-expect-error
1542
- let body = (_a = params.body) !== null && _a !== void 0 ? _a : undefined;
1802
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1803
+ let body;
1804
+ if (typeof userBody === 'string') {
1805
+ body = userBody;
1806
+ }
1807
+ else {
1808
+ body = userBody != null ? { ...userBody } : undefined;
1809
+ }
1543
1810
  for (const key in params) {
1544
1811
  if (acceptedBody.includes(key)) {
1545
1812
  body = body !== null && body !== void 0 ? body : {};
@@ -1576,12 +1843,18 @@ class Ml {
1576
1843
  return await this.transport.request({ path, method, querystring, body }, options);
1577
1844
  }
1578
1845
  async validate(params, options) {
1579
- var _a;
1580
1846
  const acceptedPath = [];
1581
- const acceptedBody = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_retention_days', 'results_index_name'];
1847
+ const acceptedBody = ['job_id', 'analysis_config', 'analysis_limits', 'data_description', 'description', 'model_plot', 'model_snapshot_id', 'model_snapshot_retention_days', 'results_index_name'];
1582
1848
  const querystring = {};
1583
1849
  // @ts-expect-error
1584
- let body = (_a = params === null || params === void 0 ? void 0 : params.body) !== null && _a !== void 0 ? _a : undefined;
1850
+ const userBody = params === null || params === void 0 ? void 0 : params.body;
1851
+ let body;
1852
+ if (typeof userBody === 'string') {
1853
+ body = userBody;
1854
+ }
1855
+ else {
1856
+ body = userBody != null ? { ...userBody } : undefined;
1857
+ }
1585
1858
  params = params !== null && params !== void 0 ? params : {};
1586
1859
  for (const key in params) {
1587
1860
  if (acceptedBody.includes(key)) {