@algolia/ingestion 1.53.0 → 1.54.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.
@@ -29,7 +29,7 @@ __export(ingestionClient_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(ingestionClient_exports);
31
31
  var import_client_common = require("@algolia/client-common");
32
- var apiClientVersion = "1.53.0";
32
+ var apiClientVersion = "1.54.0";
33
33
  var REGIONS = ["eu", "us"];
34
34
  function getDefaultHosts(region) {
35
35
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -194,18 +194,10 @@ function createIngestionClient({
194
194
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
195
195
  */
196
196
  createAuthentication(authenticationCreate, requestOptions) {
197
- if (!authenticationCreate) {
198
- throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");
199
- }
200
- if (!authenticationCreate.type) {
201
- throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");
202
- }
203
- if (!authenticationCreate.name) {
204
- throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");
205
- }
206
- if (!authenticationCreate.input) {
207
- throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");
208
- }
197
+ (0, import_client_common.validateRequired)("authenticationCreate", "createAuthentication", authenticationCreate);
198
+ (0, import_client_common.validateRequired)("authenticationCreate.type", "createAuthentication", authenticationCreate.type);
199
+ (0, import_client_common.validateRequired)("authenticationCreate.name", "createAuthentication", authenticationCreate.name);
200
+ (0, import_client_common.validateRequired)("authenticationCreate.input", "createAuthentication", authenticationCreate.input);
209
201
  const requestPath = "/1/authentications";
210
202
  const headers = {};
211
203
  const queryParameters = {};
@@ -229,18 +221,10 @@ function createIngestionClient({
229
221
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
230
222
  */
231
223
  createDestination(destinationCreate, requestOptions) {
232
- if (!destinationCreate) {
233
- throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");
234
- }
235
- if (!destinationCreate.type) {
236
- throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");
237
- }
238
- if (!destinationCreate.name) {
239
- throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");
240
- }
241
- if (!destinationCreate.input) {
242
- throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");
243
- }
224
+ (0, import_client_common.validateRequired)("destinationCreate", "createDestination", destinationCreate);
225
+ (0, import_client_common.validateRequired)("destinationCreate.type", "createDestination", destinationCreate.type);
226
+ (0, import_client_common.validateRequired)("destinationCreate.name", "createDestination", destinationCreate.name);
227
+ (0, import_client_common.validateRequired)("destinationCreate.input", "createDestination", destinationCreate.input);
244
228
  const requestPath = "/1/destinations";
245
229
  const headers = {};
246
230
  const queryParameters = {};
@@ -264,15 +248,9 @@ function createIngestionClient({
264
248
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
265
249
  */
266
250
  createSource(sourceCreate, requestOptions) {
267
- if (!sourceCreate) {
268
- throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");
269
- }
270
- if (!sourceCreate.type) {
271
- throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");
272
- }
273
- if (!sourceCreate.name) {
274
- throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");
275
- }
251
+ (0, import_client_common.validateRequired)("sourceCreate", "createSource", sourceCreate);
252
+ (0, import_client_common.validateRequired)("sourceCreate.type", "createSource", sourceCreate.type);
253
+ (0, import_client_common.validateRequired)("sourceCreate.name", "createSource", sourceCreate.name);
276
254
  const requestPath = "/1/sources";
277
255
  const headers = {};
278
256
  const queryParameters = {};
@@ -296,18 +274,10 @@ function createIngestionClient({
296
274
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
297
275
  */
298
276
  createTask(taskCreate, requestOptions) {
299
- if (!taskCreate) {
300
- throw new Error("Parameter `taskCreate` is required when calling `createTask`.");
301
- }
302
- if (!taskCreate.sourceID) {
303
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");
304
- }
305
- if (!taskCreate.destinationID) {
306
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");
307
- }
308
- if (!taskCreate.action) {
309
- throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");
310
- }
277
+ (0, import_client_common.validateRequired)("taskCreate", "createTask", taskCreate);
278
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTask", taskCreate.sourceID);
279
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTask", taskCreate.destinationID);
280
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTask", taskCreate.action);
311
281
  const requestPath = "/2/tasks";
312
282
  const headers = {};
313
283
  const queryParameters = {};
@@ -333,21 +303,11 @@ function createIngestionClient({
333
303
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
334
304
  */
335
305
  createTaskV1(taskCreate, requestOptions) {
336
- if (!taskCreate) {
337
- throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");
338
- }
339
- if (!taskCreate.sourceID) {
340
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");
341
- }
342
- if (!taskCreate.destinationID) {
343
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");
344
- }
345
- if (!taskCreate.trigger) {
346
- throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");
347
- }
348
- if (!taskCreate.action) {
349
- throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");
350
- }
306
+ (0, import_client_common.validateRequired)("taskCreate", "createTaskV1", taskCreate);
307
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTaskV1", taskCreate.sourceID);
308
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTaskV1", taskCreate.destinationID);
309
+ (0, import_client_common.validateRequired)("taskCreate.trigger", "createTaskV1", taskCreate.trigger);
310
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTaskV1", taskCreate.action);
351
311
  const requestPath = "/1/tasks";
352
312
  const headers = {};
353
313
  const queryParameters = {};
@@ -371,12 +331,8 @@ function createIngestionClient({
371
331
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
372
332
  */
373
333
  createTransformation(transformationCreate, requestOptions) {
374
- if (!transformationCreate) {
375
- throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");
376
- }
377
- if (!transformationCreate.name) {
378
- throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
379
- }
334
+ (0, import_client_common.validateRequired)("transformationCreate", "createTransformation", transformationCreate);
335
+ (0, import_client_common.validateRequired)("transformationCreate.name", "createTransformation", transformationCreate.name);
380
336
  const requestPath = "/1/transformations";
381
337
  const headers = {};
382
338
  const queryParameters = {};
@@ -397,9 +353,7 @@ function createIngestionClient({
397
353
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
398
354
  */
399
355
  customDelete({ path, parameters }, requestOptions) {
400
- if (!path) {
401
- throw new Error("Parameter `path` is required when calling `customDelete`.");
402
- }
356
+ (0, import_client_common.validateRequired)("path", "customDelete", path);
403
357
  const requestPath = "/{path}".replace("{path}", path);
404
358
  const headers = {};
405
359
  const queryParameters = parameters ? parameters : {};
@@ -419,9 +373,7 @@ function createIngestionClient({
419
373
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
420
374
  */
421
375
  customGet({ path, parameters }, requestOptions) {
422
- if (!path) {
423
- throw new Error("Parameter `path` is required when calling `customGet`.");
424
- }
376
+ (0, import_client_common.validateRequired)("path", "customGet", path);
425
377
  const requestPath = "/{path}".replace("{path}", path);
426
378
  const headers = {};
427
379
  const queryParameters = parameters ? parameters : {};
@@ -442,9 +394,7 @@ function createIngestionClient({
442
394
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
443
395
  */
444
396
  customPost({ path, parameters, body }, requestOptions) {
445
- if (!path) {
446
- throw new Error("Parameter `path` is required when calling `customPost`.");
447
- }
397
+ (0, import_client_common.validateRequired)("path", "customPost", path);
448
398
  const requestPath = "/{path}".replace("{path}", path);
449
399
  const headers = {};
450
400
  const queryParameters = parameters ? parameters : {};
@@ -466,9 +416,7 @@ function createIngestionClient({
466
416
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
467
417
  */
468
418
  customPut({ path, parameters, body }, requestOptions) {
469
- if (!path) {
470
- throw new Error("Parameter `path` is required when calling `customPut`.");
471
- }
419
+ (0, import_client_common.validateRequired)("path", "customPut", path);
472
420
  const requestPath = "/{path}".replace("{path}", path);
473
421
  const headers = {};
474
422
  const queryParameters = parameters ? parameters : {};
@@ -493,9 +441,7 @@ function createIngestionClient({
493
441
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
494
442
  */
495
443
  deleteAuthentication({ authenticationID }, requestOptions) {
496
- if (!authenticationID) {
497
- throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");
498
- }
444
+ (0, import_client_common.validateRequired)("authenticationID", "deleteAuthentication", authenticationID);
499
445
  const requestPath = "/1/authentications/{authenticationID}".replace(
500
446
  "{authenticationID}",
501
447
  encodeURIComponent(authenticationID)
@@ -522,9 +468,7 @@ function createIngestionClient({
522
468
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
523
469
  */
524
470
  deleteDestination({ destinationID }, requestOptions) {
525
- if (!destinationID) {
526
- throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");
527
- }
471
+ (0, import_client_common.validateRequired)("destinationID", "deleteDestination", destinationID);
528
472
  const requestPath = "/1/destinations/{destinationID}".replace(
529
473
  "{destinationID}",
530
474
  encodeURIComponent(destinationID)
@@ -551,9 +495,7 @@ function createIngestionClient({
551
495
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
552
496
  */
553
497
  deleteSource({ sourceID }, requestOptions) {
554
- if (!sourceID) {
555
- throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");
556
- }
498
+ (0, import_client_common.validateRequired)("sourceID", "deleteSource", sourceID);
557
499
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
558
500
  const headers = {};
559
501
  const queryParameters = {};
@@ -577,9 +519,7 @@ function createIngestionClient({
577
519
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
578
520
  */
579
521
  deleteTask({ taskID }, requestOptions) {
580
- if (!taskID) {
581
- throw new Error("Parameter `taskID` is required when calling `deleteTask`.");
582
- }
522
+ (0, import_client_common.validateRequired)("taskID", "deleteTask", taskID);
583
523
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
584
524
  const headers = {};
585
525
  const queryParameters = {};
@@ -605,9 +545,7 @@ function createIngestionClient({
605
545
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
606
546
  */
607
547
  deleteTaskV1({ taskID }, requestOptions) {
608
- if (!taskID) {
609
- throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");
610
- }
548
+ (0, import_client_common.validateRequired)("taskID", "deleteTaskV1", taskID);
611
549
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
612
550
  const headers = {};
613
551
  const queryParameters = {};
@@ -631,9 +569,7 @@ function createIngestionClient({
631
569
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
632
570
  */
633
571
  deleteTransformation({ transformationID }, requestOptions) {
634
- if (!transformationID) {
635
- throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");
636
- }
572
+ (0, import_client_common.validateRequired)("transformationID", "deleteTransformation", transformationID);
637
573
  const requestPath = "/1/transformations/{transformationID}".replace(
638
574
  "{transformationID}",
639
575
  encodeURIComponent(transformationID)
@@ -660,9 +596,7 @@ function createIngestionClient({
660
596
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
661
597
  */
662
598
  disableTask({ taskID }, requestOptions) {
663
- if (!taskID) {
664
- throw new Error("Parameter `taskID` is required when calling `disableTask`.");
665
- }
599
+ (0, import_client_common.validateRequired)("taskID", "disableTask", taskID);
666
600
  const requestPath = "/2/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
667
601
  const headers = {};
668
602
  const queryParameters = {};
@@ -688,9 +622,7 @@ function createIngestionClient({
688
622
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
689
623
  */
690
624
  disableTaskV1({ taskID }, requestOptions) {
691
- if (!taskID) {
692
- throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");
693
- }
625
+ (0, import_client_common.validateRequired)("taskID", "disableTaskV1", taskID);
694
626
  const requestPath = "/1/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
695
627
  const headers = {};
696
628
  const queryParameters = {};
@@ -714,9 +646,7 @@ function createIngestionClient({
714
646
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
715
647
  */
716
648
  enableTask({ taskID }, requestOptions) {
717
- if (!taskID) {
718
- throw new Error("Parameter `taskID` is required when calling `enableTask`.");
719
- }
649
+ (0, import_client_common.validateRequired)("taskID", "enableTask", taskID);
720
650
  const requestPath = "/2/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
721
651
  const headers = {};
722
652
  const queryParameters = {};
@@ -742,9 +672,7 @@ function createIngestionClient({
742
672
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
743
673
  */
744
674
  enableTaskV1({ taskID }, requestOptions) {
745
- if (!taskID) {
746
- throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");
747
- }
675
+ (0, import_client_common.validateRequired)("taskID", "enableTaskV1", taskID);
748
676
  const requestPath = "/1/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
749
677
  const headers = {};
750
678
  const queryParameters = {};
@@ -768,9 +696,7 @@ function createIngestionClient({
768
696
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
769
697
  */
770
698
  getAuthentication({ authenticationID }, requestOptions) {
771
- if (!authenticationID) {
772
- throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");
773
- }
699
+ (0, import_client_common.validateRequired)("authenticationID", "getAuthentication", authenticationID);
774
700
  const requestPath = "/1/authentications/{authenticationID}".replace(
775
701
  "{authenticationID}",
776
702
  encodeURIComponent(authenticationID)
@@ -797,9 +723,7 @@ function createIngestionClient({
797
723
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
798
724
  */
799
725
  getDestination({ destinationID }, requestOptions) {
800
- if (!destinationID) {
801
- throw new Error("Parameter `destinationID` is required when calling `getDestination`.");
802
- }
726
+ (0, import_client_common.validateRequired)("destinationID", "getDestination", destinationID);
803
727
  const requestPath = "/1/destinations/{destinationID}".replace(
804
728
  "{destinationID}",
805
729
  encodeURIComponent(destinationID)
@@ -827,12 +751,8 @@ function createIngestionClient({
827
751
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
828
752
  */
829
753
  getEvent({ runID, eventID }, requestOptions) {
830
- if (!runID) {
831
- throw new Error("Parameter `runID` is required when calling `getEvent`.");
832
- }
833
- if (!eventID) {
834
- throw new Error("Parameter `eventID` is required when calling `getEvent`.");
835
- }
754
+ (0, import_client_common.validateRequired)("runID", "getEvent", runID);
755
+ (0, import_client_common.validateRequired)("eventID", "getEvent", eventID);
836
756
  const requestPath = "/1/runs/{runID}/events/{eventID}".replace("{runID}", encodeURIComponent(runID)).replace("{eventID}", encodeURIComponent(eventID));
837
757
  const headers = {};
838
758
  const queryParameters = {};
@@ -856,9 +776,7 @@ function createIngestionClient({
856
776
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
857
777
  */
858
778
  getRun({ runID }, requestOptions) {
859
- if (!runID) {
860
- throw new Error("Parameter `runID` is required when calling `getRun`.");
861
- }
779
+ (0, import_client_common.validateRequired)("runID", "getRun", runID);
862
780
  const requestPath = "/1/runs/{runID}".replace("{runID}", encodeURIComponent(runID));
863
781
  const headers = {};
864
782
  const queryParameters = {};
@@ -882,9 +800,7 @@ function createIngestionClient({
882
800
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
883
801
  */
884
802
  getSource({ sourceID }, requestOptions) {
885
- if (!sourceID) {
886
- throw new Error("Parameter `sourceID` is required when calling `getSource`.");
887
- }
803
+ (0, import_client_common.validateRequired)("sourceID", "getSource", sourceID);
888
804
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
889
805
  const headers = {};
890
806
  const queryParameters = {};
@@ -908,9 +824,7 @@ function createIngestionClient({
908
824
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
909
825
  */
910
826
  getTask({ taskID }, requestOptions) {
911
- if (!taskID) {
912
- throw new Error("Parameter `taskID` is required when calling `getTask`.");
913
- }
827
+ (0, import_client_common.validateRequired)("taskID", "getTask", taskID);
914
828
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
915
829
  const headers = {};
916
830
  const queryParameters = {};
@@ -936,9 +850,7 @@ function createIngestionClient({
936
850
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
937
851
  */
938
852
  getTaskV1({ taskID }, requestOptions) {
939
- if (!taskID) {
940
- throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");
941
- }
853
+ (0, import_client_common.validateRequired)("taskID", "getTaskV1", taskID);
942
854
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
943
855
  const headers = {};
944
856
  const queryParameters = {};
@@ -962,9 +874,7 @@ function createIngestionClient({
962
874
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
963
875
  */
964
876
  getTransformation({ transformationID }, requestOptions) {
965
- if (!transformationID) {
966
- throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");
967
- }
877
+ (0, import_client_common.validateRequired)("transformationID", "getTransformation", transformationID);
968
878
  const requestPath = "/1/transformations/{transformationID}".replace(
969
879
  "{transformationID}",
970
880
  encodeURIComponent(transformationID)
@@ -1095,9 +1005,7 @@ function createIngestionClient({
1095
1005
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1096
1006
  */
1097
1007
  listEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate }, requestOptions) {
1098
- if (!runID) {
1099
- throw new Error("Parameter `runID` is required when calling `listEvents`.");
1100
- }
1008
+ (0, import_client_common.validateRequired)("runID", "listEvents", runID);
1101
1009
  const requestPath = "/1/runs/{runID}/events".replace("{runID}", encodeURIComponent(runID));
1102
1010
  const headers = {};
1103
1011
  const queryParameters = {};
@@ -1432,18 +1340,10 @@ function createIngestionClient({
1432
1340
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1433
1341
  */
1434
1342
  push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1435
- if (!indexName) {
1436
- throw new Error("Parameter `indexName` is required when calling `push`.");
1437
- }
1438
- if (!pushTaskPayload) {
1439
- throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");
1440
- }
1441
- if (!pushTaskPayload.action) {
1442
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");
1443
- }
1444
- if (!pushTaskPayload.records) {
1445
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");
1446
- }
1343
+ (0, import_client_common.validateRequired)("indexName", "push", indexName);
1344
+ (0, import_client_common.validateRequired)("pushTaskPayload", "push", pushTaskPayload);
1345
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "push", pushTaskPayload.action);
1346
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "push", pushTaskPayload.records);
1447
1347
  const requestPath = "/1/push/{indexName}".replace("{indexName}", encodeURIComponent(indexName));
1448
1348
  const headers = {};
1449
1349
  const queryParameters = {};
@@ -1484,18 +1384,10 @@ function createIngestionClient({
1484
1384
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1485
1385
  */
1486
1386
  pushTask({ taskID, pushTaskPayload, watch }, requestOptions) {
1487
- if (!taskID) {
1488
- throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1489
- }
1490
- if (!pushTaskPayload) {
1491
- throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");
1492
- }
1493
- if (!pushTaskPayload.action) {
1494
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");
1495
- }
1496
- if (!pushTaskPayload.records) {
1497
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");
1498
- }
1387
+ (0, import_client_common.validateRequired)("taskID", "pushTask", taskID);
1388
+ (0, import_client_common.validateRequired)("pushTaskPayload", "pushTask", pushTaskPayload);
1389
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "pushTask", pushTaskPayload.action);
1390
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "pushTask", pushTaskPayload.records);
1499
1391
  const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1500
1392
  const headers = {};
1501
1393
  const queryParameters = {};
@@ -1532,18 +1424,10 @@ function createIngestionClient({
1532
1424
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1533
1425
  */
1534
1426
  replaceTask({ taskID, taskReplace }, requestOptions) {
1535
- if (!taskID) {
1536
- throw new Error("Parameter `taskID` is required when calling `replaceTask`.");
1537
- }
1538
- if (!taskReplace) {
1539
- throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");
1540
- }
1541
- if (!taskReplace.destinationID) {
1542
- throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");
1543
- }
1544
- if (!taskReplace.action) {
1545
- throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");
1546
- }
1427
+ (0, import_client_common.validateRequired)("taskID", "replaceTask", taskID);
1428
+ (0, import_client_common.validateRequired)("taskReplace", "replaceTask", taskReplace);
1429
+ (0, import_client_common.validateRequired)("taskReplace.destinationID", "replaceTask", taskReplace.destinationID);
1430
+ (0, import_client_common.validateRequired)("taskReplace.action", "replaceTask", taskReplace.action);
1547
1431
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1548
1432
  const headers = {};
1549
1433
  const queryParameters = {};
@@ -1569,9 +1453,7 @@ function createIngestionClient({
1569
1453
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1570
1454
  */
1571
1455
  runSource({ sourceID, runSourcePayload }, requestOptions) {
1572
- if (!sourceID) {
1573
- throw new Error("Parameter `sourceID` is required when calling `runSource`.");
1574
- }
1456
+ (0, import_client_common.validateRequired)("sourceID", "runSource", sourceID);
1575
1457
  const requestPath = "/1/sources/{sourceID}/run".replace("{sourceID}", encodeURIComponent(sourceID));
1576
1458
  const headers = {};
1577
1459
  const queryParameters = {};
@@ -1597,9 +1479,7 @@ function createIngestionClient({
1597
1479
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1598
1480
  */
1599
1481
  runTask({ taskID, runTaskPayload }, requestOptions) {
1600
- if (!taskID) {
1601
- throw new Error("Parameter `taskID` is required when calling `runTask`.");
1602
- }
1482
+ (0, import_client_common.validateRequired)("taskID", "runTask", taskID);
1603
1483
  const requestPath = "/2/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1604
1484
  const headers = {};
1605
1485
  const queryParameters = {};
@@ -1627,9 +1507,7 @@ function createIngestionClient({
1627
1507
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1628
1508
  */
1629
1509
  runTaskV1({ taskID, runTaskPayload }, requestOptions) {
1630
- if (!taskID) {
1631
- throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");
1632
- }
1510
+ (0, import_client_common.validateRequired)("taskID", "runTaskV1", taskID);
1633
1511
  const requestPath = "/1/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1634
1512
  const headers = {};
1635
1513
  const queryParameters = {};
@@ -1653,14 +1531,12 @@ function createIngestionClient({
1653
1531
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1654
1532
  */
1655
1533
  searchAuthentications(authenticationSearch, requestOptions) {
1656
- if (!authenticationSearch) {
1657
- throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");
1658
- }
1659
- if (!authenticationSearch.authenticationIDs) {
1660
- throw new Error(
1661
- "Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`."
1662
- );
1663
- }
1534
+ (0, import_client_common.validateRequired)("authenticationSearch", "searchAuthentications", authenticationSearch);
1535
+ (0, import_client_common.validateRequired)(
1536
+ "authenticationSearch.authenticationIDs",
1537
+ "searchAuthentications",
1538
+ authenticationSearch.authenticationIDs
1539
+ );
1664
1540
  const requestPath = "/1/authentications/search";
1665
1541
  const headers = {};
1666
1542
  const queryParameters = {};
@@ -1684,12 +1560,8 @@ function createIngestionClient({
1684
1560
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1685
1561
  */
1686
1562
  searchDestinations(destinationSearch, requestOptions) {
1687
- if (!destinationSearch) {
1688
- throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");
1689
- }
1690
- if (!destinationSearch.destinationIDs) {
1691
- throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");
1692
- }
1563
+ (0, import_client_common.validateRequired)("destinationSearch", "searchDestinations", destinationSearch);
1564
+ (0, import_client_common.validateRequired)("destinationSearch.destinationIDs", "searchDestinations", destinationSearch.destinationIDs);
1693
1565
  const requestPath = "/1/destinations/search";
1694
1566
  const headers = {};
1695
1567
  const queryParameters = {};
@@ -1713,12 +1585,8 @@ function createIngestionClient({
1713
1585
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1714
1586
  */
1715
1587
  searchSources(sourceSearch, requestOptions) {
1716
- if (!sourceSearch) {
1717
- throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");
1718
- }
1719
- if (!sourceSearch.sourceIDs) {
1720
- throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");
1721
- }
1588
+ (0, import_client_common.validateRequired)("sourceSearch", "searchSources", sourceSearch);
1589
+ (0, import_client_common.validateRequired)("sourceSearch.sourceIDs", "searchSources", sourceSearch.sourceIDs);
1722
1590
  const requestPath = "/1/sources/search";
1723
1591
  const headers = {};
1724
1592
  const queryParameters = {};
@@ -1742,12 +1610,8 @@ function createIngestionClient({
1742
1610
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1743
1611
  */
1744
1612
  searchTasks(taskSearch, requestOptions) {
1745
- if (!taskSearch) {
1746
- throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");
1747
- }
1748
- if (!taskSearch.taskIDs) {
1749
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");
1750
- }
1613
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasks", taskSearch);
1614
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasks", taskSearch.taskIDs);
1751
1615
  const requestPath = "/2/tasks/search";
1752
1616
  const headers = {};
1753
1617
  const queryParameters = {};
@@ -1773,12 +1637,8 @@ function createIngestionClient({
1773
1637
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1774
1638
  */
1775
1639
  searchTasksV1(taskSearch, requestOptions) {
1776
- if (!taskSearch) {
1777
- throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");
1778
- }
1779
- if (!taskSearch.taskIDs) {
1780
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");
1781
- }
1640
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasksV1", taskSearch);
1641
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasksV1", taskSearch.taskIDs);
1782
1642
  const requestPath = "/1/tasks/search";
1783
1643
  const headers = {};
1784
1644
  const queryParameters = {};
@@ -1802,14 +1662,12 @@ function createIngestionClient({
1802
1662
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1803
1663
  */
1804
1664
  searchTransformations(transformationSearch, requestOptions) {
1805
- if (!transformationSearch) {
1806
- throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");
1807
- }
1808
- if (!transformationSearch.transformationIDs) {
1809
- throw new Error(
1810
- "Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`."
1811
- );
1812
- }
1665
+ (0, import_client_common.validateRequired)("transformationSearch", "searchTransformations", transformationSearch);
1666
+ (0, import_client_common.validateRequired)(
1667
+ "transformationSearch.transformationIDs",
1668
+ "searchTransformations",
1669
+ transformationSearch.transformationIDs
1670
+ );
1813
1671
  const requestPath = "/1/transformations/search";
1814
1672
  const headers = {};
1815
1673
  const queryParameters = {};
@@ -1834,9 +1692,7 @@ function createIngestionClient({
1834
1692
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1835
1693
  */
1836
1694
  triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1837
- if (!sourceID) {
1838
- throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");
1839
- }
1695
+ (0, import_client_common.validateRequired)("sourceID", "triggerDockerSourceDiscover", sourceID);
1840
1696
  const requestPath = "/1/sources/{sourceID}/discover".replace("{sourceID}", encodeURIComponent(sourceID));
1841
1697
  const headers = {};
1842
1698
  const queryParameters = {};
@@ -1867,12 +1723,8 @@ function createIngestionClient({
1867
1723
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1868
1724
  */
1869
1725
  tryTransformation(transformationTry, requestOptions) {
1870
- if (!transformationTry) {
1871
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1872
- }
1873
- if (!transformationTry.sampleRecord) {
1874
- throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1875
- }
1726
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformation", transformationTry);
1727
+ (0, import_client_common.validateRequired)("transformationTry.sampleRecord", "tryTransformation", transformationTry.sampleRecord);
1876
1728
  const requestPath = "/1/transformations/try";
1877
1729
  const headers = {};
1878
1730
  const queryParameters = {};
@@ -1898,17 +1750,13 @@ function createIngestionClient({
1898
1750
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1899
1751
  */
1900
1752
  tryTransformationBeforeUpdate({ transformationID, transformationTry }, requestOptions) {
1901
- if (!transformationID) {
1902
- throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");
1903
- }
1904
- if (!transformationTry) {
1905
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1906
- }
1907
- if (!transformationTry.sampleRecord) {
1908
- throw new Error(
1909
- "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
1910
- );
1911
- }
1753
+ (0, import_client_common.validateRequired)("transformationID", "tryTransformationBeforeUpdate", transformationID);
1754
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformationBeforeUpdate", transformationTry);
1755
+ (0, import_client_common.validateRequired)(
1756
+ "transformationTry.sampleRecord",
1757
+ "tryTransformationBeforeUpdate",
1758
+ transformationTry.sampleRecord
1759
+ );
1912
1760
  const requestPath = "/1/transformations/{transformationID}/try".replace(
1913
1761
  "{transformationID}",
1914
1762
  encodeURIComponent(transformationID)
@@ -1937,12 +1785,8 @@ function createIngestionClient({
1937
1785
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1938
1786
  */
1939
1787
  updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1940
- if (!authenticationID) {
1941
- throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");
1942
- }
1943
- if (!authenticationUpdate) {
1944
- throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");
1945
- }
1788
+ (0, import_client_common.validateRequired)("authenticationID", "updateAuthentication", authenticationID);
1789
+ (0, import_client_common.validateRequired)("authenticationUpdate", "updateAuthentication", authenticationUpdate);
1946
1790
  const requestPath = "/1/authentications/{authenticationID}".replace(
1947
1791
  "{authenticationID}",
1948
1792
  encodeURIComponent(authenticationID)
@@ -1971,12 +1815,8 @@ function createIngestionClient({
1971
1815
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1972
1816
  */
1973
1817
  updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1974
- if (!destinationID) {
1975
- throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");
1976
- }
1977
- if (!destinationUpdate) {
1978
- throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");
1979
- }
1818
+ (0, import_client_common.validateRequired)("destinationID", "updateDestination", destinationID);
1819
+ (0, import_client_common.validateRequired)("destinationUpdate", "updateDestination", destinationUpdate);
1980
1820
  const requestPath = "/1/destinations/{destinationID}".replace(
1981
1821
  "{destinationID}",
1982
1822
  encodeURIComponent(destinationID)
@@ -2005,12 +1845,8 @@ function createIngestionClient({
2005
1845
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2006
1846
  */
2007
1847
  updateSource({ sourceID, sourceUpdate }, requestOptions) {
2008
- if (!sourceID) {
2009
- throw new Error("Parameter `sourceID` is required when calling `updateSource`.");
2010
- }
2011
- if (!sourceUpdate) {
2012
- throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");
2013
- }
1848
+ (0, import_client_common.validateRequired)("sourceID", "updateSource", sourceID);
1849
+ (0, import_client_common.validateRequired)("sourceUpdate", "updateSource", sourceUpdate);
2014
1850
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
2015
1851
  const headers = {};
2016
1852
  const queryParameters = {};
@@ -2036,12 +1872,8 @@ function createIngestionClient({
2036
1872
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2037
1873
  */
2038
1874
  updateTask({ taskID, taskUpdate }, requestOptions) {
2039
- if (!taskID) {
2040
- throw new Error("Parameter `taskID` is required when calling `updateTask`.");
2041
- }
2042
- if (!taskUpdate) {
2043
- throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");
2044
- }
1875
+ (0, import_client_common.validateRequired)("taskID", "updateTask", taskID);
1876
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTask", taskUpdate);
2045
1877
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2046
1878
  const headers = {};
2047
1879
  const queryParameters = {};
@@ -2069,12 +1901,8 @@ function createIngestionClient({
2069
1901
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2070
1902
  */
2071
1903
  updateTaskV1({ taskID, taskUpdate }, requestOptions) {
2072
- if (!taskID) {
2073
- throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");
2074
- }
2075
- if (!taskUpdate) {
2076
- throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");
2077
- }
1904
+ (0, import_client_common.validateRequired)("taskID", "updateTaskV1", taskID);
1905
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTaskV1", taskUpdate);
2078
1906
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2079
1907
  const headers = {};
2080
1908
  const queryParameters = {};
@@ -2100,15 +1928,9 @@ function createIngestionClient({
2100
1928
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2101
1929
  */
2102
1930
  updateTransformation({ transformationID, transformationCreate }, requestOptions) {
2103
- if (!transformationID) {
2104
- throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");
2105
- }
2106
- if (!transformationCreate) {
2107
- throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");
2108
- }
2109
- if (!transformationCreate.name) {
2110
- throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
2111
- }
1931
+ (0, import_client_common.validateRequired)("transformationID", "updateTransformation", transformationID);
1932
+ (0, import_client_common.validateRequired)("transformationCreate", "updateTransformation", transformationCreate);
1933
+ (0, import_client_common.validateRequired)("transformationCreate.name", "updateTransformation", transformationCreate.name);
2112
1934
  const requestPath = "/1/transformations/{transformationID}".replace(
2113
1935
  "{transformationID}",
2114
1936
  encodeURIComponent(transformationID)
@@ -2168,12 +1990,8 @@ function createIngestionClient({
2168
1990
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2169
1991
  */
2170
1992
  validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
2171
- if (!sourceID) {
2172
- throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");
2173
- }
2174
- if (!sourceUpdate) {
2175
- throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");
2176
- }
1993
+ (0, import_client_common.validateRequired)("sourceID", "validateSourceBeforeUpdate", sourceID);
1994
+ (0, import_client_common.validateRequired)("sourceUpdate", "validateSourceBeforeUpdate", sourceUpdate);
2177
1995
  const requestPath = "/1/sources/{sourceID}/validate".replace("{sourceID}", encodeURIComponent(sourceID));
2178
1996
  const headers = {};
2179
1997
  const queryParameters = {};