@algolia/ingestion 1.53.0 → 1.54.1

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.
@@ -33,7 +33,7 @@ var import_requester_node_http = require("@algolia/requester-node-http");
33
33
 
34
34
  // src/ingestionClient.ts
35
35
  var import_client_common = require("@algolia/client-common");
36
- var apiClientVersion = "1.53.0";
36
+ var apiClientVersion = "1.54.1";
37
37
  var REGIONS = ["eu", "us"];
38
38
  function getDefaultHosts(region) {
39
39
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -198,18 +198,10 @@ function createIngestionClient({
198
198
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
199
199
  */
200
200
  createAuthentication(authenticationCreate, requestOptions) {
201
- if (!authenticationCreate) {
202
- throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");
203
- }
204
- if (!authenticationCreate.type) {
205
- throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");
206
- }
207
- if (!authenticationCreate.name) {
208
- throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");
209
- }
210
- if (!authenticationCreate.input) {
211
- throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");
212
- }
201
+ (0, import_client_common.validateRequired)("authenticationCreate", "createAuthentication", authenticationCreate);
202
+ (0, import_client_common.validateRequired)("authenticationCreate.type", "createAuthentication", authenticationCreate.type);
203
+ (0, import_client_common.validateRequired)("authenticationCreate.name", "createAuthentication", authenticationCreate.name);
204
+ (0, import_client_common.validateRequired)("authenticationCreate.input", "createAuthentication", authenticationCreate.input);
213
205
  const requestPath = "/1/authentications";
214
206
  const headers = {};
215
207
  const queryParameters = {};
@@ -233,18 +225,10 @@ function createIngestionClient({
233
225
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
234
226
  */
235
227
  createDestination(destinationCreate, requestOptions) {
236
- if (!destinationCreate) {
237
- throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");
238
- }
239
- if (!destinationCreate.type) {
240
- throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");
241
- }
242
- if (!destinationCreate.name) {
243
- throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");
244
- }
245
- if (!destinationCreate.input) {
246
- throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");
247
- }
228
+ (0, import_client_common.validateRequired)("destinationCreate", "createDestination", destinationCreate);
229
+ (0, import_client_common.validateRequired)("destinationCreate.type", "createDestination", destinationCreate.type);
230
+ (0, import_client_common.validateRequired)("destinationCreate.name", "createDestination", destinationCreate.name);
231
+ (0, import_client_common.validateRequired)("destinationCreate.input", "createDestination", destinationCreate.input);
248
232
  const requestPath = "/1/destinations";
249
233
  const headers = {};
250
234
  const queryParameters = {};
@@ -268,15 +252,9 @@ function createIngestionClient({
268
252
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
269
253
  */
270
254
  createSource(sourceCreate, requestOptions) {
271
- if (!sourceCreate) {
272
- throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");
273
- }
274
- if (!sourceCreate.type) {
275
- throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");
276
- }
277
- if (!sourceCreate.name) {
278
- throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");
279
- }
255
+ (0, import_client_common.validateRequired)("sourceCreate", "createSource", sourceCreate);
256
+ (0, import_client_common.validateRequired)("sourceCreate.type", "createSource", sourceCreate.type);
257
+ (0, import_client_common.validateRequired)("sourceCreate.name", "createSource", sourceCreate.name);
280
258
  const requestPath = "/1/sources";
281
259
  const headers = {};
282
260
  const queryParameters = {};
@@ -300,18 +278,10 @@ function createIngestionClient({
300
278
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
301
279
  */
302
280
  createTask(taskCreate, requestOptions) {
303
- if (!taskCreate) {
304
- throw new Error("Parameter `taskCreate` is required when calling `createTask`.");
305
- }
306
- if (!taskCreate.sourceID) {
307
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");
308
- }
309
- if (!taskCreate.destinationID) {
310
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");
311
- }
312
- if (!taskCreate.action) {
313
- throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");
314
- }
281
+ (0, import_client_common.validateRequired)("taskCreate", "createTask", taskCreate);
282
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTask", taskCreate.sourceID);
283
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTask", taskCreate.destinationID);
284
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTask", taskCreate.action);
315
285
  const requestPath = "/2/tasks";
316
286
  const headers = {};
317
287
  const queryParameters = {};
@@ -337,21 +307,11 @@ function createIngestionClient({
337
307
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
338
308
  */
339
309
  createTaskV1(taskCreate, requestOptions) {
340
- if (!taskCreate) {
341
- throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");
342
- }
343
- if (!taskCreate.sourceID) {
344
- throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");
345
- }
346
- if (!taskCreate.destinationID) {
347
- throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");
348
- }
349
- if (!taskCreate.trigger) {
350
- throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");
351
- }
352
- if (!taskCreate.action) {
353
- throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");
354
- }
310
+ (0, import_client_common.validateRequired)("taskCreate", "createTaskV1", taskCreate);
311
+ (0, import_client_common.validateRequired)("taskCreate.sourceID", "createTaskV1", taskCreate.sourceID);
312
+ (0, import_client_common.validateRequired)("taskCreate.destinationID", "createTaskV1", taskCreate.destinationID);
313
+ (0, import_client_common.validateRequired)("taskCreate.trigger", "createTaskV1", taskCreate.trigger);
314
+ (0, import_client_common.validateRequired)("taskCreate.action", "createTaskV1", taskCreate.action);
355
315
  const requestPath = "/1/tasks";
356
316
  const headers = {};
357
317
  const queryParameters = {};
@@ -375,12 +335,8 @@ function createIngestionClient({
375
335
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
376
336
  */
377
337
  createTransformation(transformationCreate, requestOptions) {
378
- if (!transformationCreate) {
379
- throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");
380
- }
381
- if (!transformationCreate.name) {
382
- throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");
383
- }
338
+ (0, import_client_common.validateRequired)("transformationCreate", "createTransformation", transformationCreate);
339
+ (0, import_client_common.validateRequired)("transformationCreate.name", "createTransformation", transformationCreate.name);
384
340
  const requestPath = "/1/transformations";
385
341
  const headers = {};
386
342
  const queryParameters = {};
@@ -401,9 +357,7 @@ function createIngestionClient({
401
357
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
402
358
  */
403
359
  customDelete({ path, parameters }, requestOptions) {
404
- if (!path) {
405
- throw new Error("Parameter `path` is required when calling `customDelete`.");
406
- }
360
+ (0, import_client_common.validateRequired)("path", "customDelete", path);
407
361
  const requestPath = "/{path}".replace("{path}", path);
408
362
  const headers = {};
409
363
  const queryParameters = parameters ? parameters : {};
@@ -423,9 +377,7 @@ function createIngestionClient({
423
377
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
424
378
  */
425
379
  customGet({ path, parameters }, requestOptions) {
426
- if (!path) {
427
- throw new Error("Parameter `path` is required when calling `customGet`.");
428
- }
380
+ (0, import_client_common.validateRequired)("path", "customGet", path);
429
381
  const requestPath = "/{path}".replace("{path}", path);
430
382
  const headers = {};
431
383
  const queryParameters = parameters ? parameters : {};
@@ -446,9 +398,7 @@ function createIngestionClient({
446
398
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
447
399
  */
448
400
  customPost({ path, parameters, body }, requestOptions) {
449
- if (!path) {
450
- throw new Error("Parameter `path` is required when calling `customPost`.");
451
- }
401
+ (0, import_client_common.validateRequired)("path", "customPost", path);
452
402
  const requestPath = "/{path}".replace("{path}", path);
453
403
  const headers = {};
454
404
  const queryParameters = parameters ? parameters : {};
@@ -470,9 +420,7 @@ function createIngestionClient({
470
420
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
471
421
  */
472
422
  customPut({ path, parameters, body }, requestOptions) {
473
- if (!path) {
474
- throw new Error("Parameter `path` is required when calling `customPut`.");
475
- }
423
+ (0, import_client_common.validateRequired)("path", "customPut", path);
476
424
  const requestPath = "/{path}".replace("{path}", path);
477
425
  const headers = {};
478
426
  const queryParameters = parameters ? parameters : {};
@@ -497,9 +445,7 @@ function createIngestionClient({
497
445
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
498
446
  */
499
447
  deleteAuthentication({ authenticationID }, requestOptions) {
500
- if (!authenticationID) {
501
- throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");
502
- }
448
+ (0, import_client_common.validateRequired)("authenticationID", "deleteAuthentication", authenticationID);
503
449
  const requestPath = "/1/authentications/{authenticationID}".replace(
504
450
  "{authenticationID}",
505
451
  encodeURIComponent(authenticationID)
@@ -526,9 +472,7 @@ function createIngestionClient({
526
472
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
527
473
  */
528
474
  deleteDestination({ destinationID }, requestOptions) {
529
- if (!destinationID) {
530
- throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");
531
- }
475
+ (0, import_client_common.validateRequired)("destinationID", "deleteDestination", destinationID);
532
476
  const requestPath = "/1/destinations/{destinationID}".replace(
533
477
  "{destinationID}",
534
478
  encodeURIComponent(destinationID)
@@ -555,9 +499,7 @@ function createIngestionClient({
555
499
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
556
500
  */
557
501
  deleteSource({ sourceID }, requestOptions) {
558
- if (!sourceID) {
559
- throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");
560
- }
502
+ (0, import_client_common.validateRequired)("sourceID", "deleteSource", sourceID);
561
503
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
562
504
  const headers = {};
563
505
  const queryParameters = {};
@@ -581,9 +523,7 @@ function createIngestionClient({
581
523
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
582
524
  */
583
525
  deleteTask({ taskID }, requestOptions) {
584
- if (!taskID) {
585
- throw new Error("Parameter `taskID` is required when calling `deleteTask`.");
586
- }
526
+ (0, import_client_common.validateRequired)("taskID", "deleteTask", taskID);
587
527
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
588
528
  const headers = {};
589
529
  const queryParameters = {};
@@ -609,9 +549,7 @@ function createIngestionClient({
609
549
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
610
550
  */
611
551
  deleteTaskV1({ taskID }, requestOptions) {
612
- if (!taskID) {
613
- throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");
614
- }
552
+ (0, import_client_common.validateRequired)("taskID", "deleteTaskV1", taskID);
615
553
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
616
554
  const headers = {};
617
555
  const queryParameters = {};
@@ -635,9 +573,7 @@ function createIngestionClient({
635
573
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
636
574
  */
637
575
  deleteTransformation({ transformationID }, requestOptions) {
638
- if (!transformationID) {
639
- throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");
640
- }
576
+ (0, import_client_common.validateRequired)("transformationID", "deleteTransformation", transformationID);
641
577
  const requestPath = "/1/transformations/{transformationID}".replace(
642
578
  "{transformationID}",
643
579
  encodeURIComponent(transformationID)
@@ -664,9 +600,7 @@ function createIngestionClient({
664
600
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
665
601
  */
666
602
  disableTask({ taskID }, requestOptions) {
667
- if (!taskID) {
668
- throw new Error("Parameter `taskID` is required when calling `disableTask`.");
669
- }
603
+ (0, import_client_common.validateRequired)("taskID", "disableTask", taskID);
670
604
  const requestPath = "/2/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
671
605
  const headers = {};
672
606
  const queryParameters = {};
@@ -692,9 +626,7 @@ function createIngestionClient({
692
626
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
693
627
  */
694
628
  disableTaskV1({ taskID }, requestOptions) {
695
- if (!taskID) {
696
- throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");
697
- }
629
+ (0, import_client_common.validateRequired)("taskID", "disableTaskV1", taskID);
698
630
  const requestPath = "/1/tasks/{taskID}/disable".replace("{taskID}", encodeURIComponent(taskID));
699
631
  const headers = {};
700
632
  const queryParameters = {};
@@ -718,9 +650,7 @@ function createIngestionClient({
718
650
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
719
651
  */
720
652
  enableTask({ taskID }, requestOptions) {
721
- if (!taskID) {
722
- throw new Error("Parameter `taskID` is required when calling `enableTask`.");
723
- }
653
+ (0, import_client_common.validateRequired)("taskID", "enableTask", taskID);
724
654
  const requestPath = "/2/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
725
655
  const headers = {};
726
656
  const queryParameters = {};
@@ -746,9 +676,7 @@ function createIngestionClient({
746
676
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
747
677
  */
748
678
  enableTaskV1({ taskID }, requestOptions) {
749
- if (!taskID) {
750
- throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");
751
- }
679
+ (0, import_client_common.validateRequired)("taskID", "enableTaskV1", taskID);
752
680
  const requestPath = "/1/tasks/{taskID}/enable".replace("{taskID}", encodeURIComponent(taskID));
753
681
  const headers = {};
754
682
  const queryParameters = {};
@@ -772,9 +700,7 @@ function createIngestionClient({
772
700
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
773
701
  */
774
702
  getAuthentication({ authenticationID }, requestOptions) {
775
- if (!authenticationID) {
776
- throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");
777
- }
703
+ (0, import_client_common.validateRequired)("authenticationID", "getAuthentication", authenticationID);
778
704
  const requestPath = "/1/authentications/{authenticationID}".replace(
779
705
  "{authenticationID}",
780
706
  encodeURIComponent(authenticationID)
@@ -801,9 +727,7 @@ function createIngestionClient({
801
727
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
802
728
  */
803
729
  getDestination({ destinationID }, requestOptions) {
804
- if (!destinationID) {
805
- throw new Error("Parameter `destinationID` is required when calling `getDestination`.");
806
- }
730
+ (0, import_client_common.validateRequired)("destinationID", "getDestination", destinationID);
807
731
  const requestPath = "/1/destinations/{destinationID}".replace(
808
732
  "{destinationID}",
809
733
  encodeURIComponent(destinationID)
@@ -831,12 +755,8 @@ function createIngestionClient({
831
755
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
832
756
  */
833
757
  getEvent({ runID, eventID }, requestOptions) {
834
- if (!runID) {
835
- throw new Error("Parameter `runID` is required when calling `getEvent`.");
836
- }
837
- if (!eventID) {
838
- throw new Error("Parameter `eventID` is required when calling `getEvent`.");
839
- }
758
+ (0, import_client_common.validateRequired)("runID", "getEvent", runID);
759
+ (0, import_client_common.validateRequired)("eventID", "getEvent", eventID);
840
760
  const requestPath = "/1/runs/{runID}/events/{eventID}".replace("{runID}", encodeURIComponent(runID)).replace("{eventID}", encodeURIComponent(eventID));
841
761
  const headers = {};
842
762
  const queryParameters = {};
@@ -860,9 +780,7 @@ function createIngestionClient({
860
780
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
861
781
  */
862
782
  getRun({ runID }, requestOptions) {
863
- if (!runID) {
864
- throw new Error("Parameter `runID` is required when calling `getRun`.");
865
- }
783
+ (0, import_client_common.validateRequired)("runID", "getRun", runID);
866
784
  const requestPath = "/1/runs/{runID}".replace("{runID}", encodeURIComponent(runID));
867
785
  const headers = {};
868
786
  const queryParameters = {};
@@ -886,9 +804,7 @@ function createIngestionClient({
886
804
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
887
805
  */
888
806
  getSource({ sourceID }, requestOptions) {
889
- if (!sourceID) {
890
- throw new Error("Parameter `sourceID` is required when calling `getSource`.");
891
- }
807
+ (0, import_client_common.validateRequired)("sourceID", "getSource", sourceID);
892
808
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
893
809
  const headers = {};
894
810
  const queryParameters = {};
@@ -912,9 +828,7 @@ function createIngestionClient({
912
828
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
913
829
  */
914
830
  getTask({ taskID }, requestOptions) {
915
- if (!taskID) {
916
- throw new Error("Parameter `taskID` is required when calling `getTask`.");
917
- }
831
+ (0, import_client_common.validateRequired)("taskID", "getTask", taskID);
918
832
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
919
833
  const headers = {};
920
834
  const queryParameters = {};
@@ -940,9 +854,7 @@ function createIngestionClient({
940
854
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
941
855
  */
942
856
  getTaskV1({ taskID }, requestOptions) {
943
- if (!taskID) {
944
- throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");
945
- }
857
+ (0, import_client_common.validateRequired)("taskID", "getTaskV1", taskID);
946
858
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
947
859
  const headers = {};
948
860
  const queryParameters = {};
@@ -966,9 +878,7 @@ function createIngestionClient({
966
878
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
967
879
  */
968
880
  getTransformation({ transformationID }, requestOptions) {
969
- if (!transformationID) {
970
- throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");
971
- }
881
+ (0, import_client_common.validateRequired)("transformationID", "getTransformation", transformationID);
972
882
  const requestPath = "/1/transformations/{transformationID}".replace(
973
883
  "{transformationID}",
974
884
  encodeURIComponent(transformationID)
@@ -1099,9 +1009,7 @@ function createIngestionClient({
1099
1009
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1100
1010
  */
1101
1011
  listEvents({ runID, itemsPerPage, page, status, type, sort, order, startDate, endDate }, requestOptions) {
1102
- if (!runID) {
1103
- throw new Error("Parameter `runID` is required when calling `listEvents`.");
1104
- }
1012
+ (0, import_client_common.validateRequired)("runID", "listEvents", runID);
1105
1013
  const requestPath = "/1/runs/{runID}/events".replace("{runID}", encodeURIComponent(runID));
1106
1014
  const headers = {};
1107
1015
  const queryParameters = {};
@@ -1436,18 +1344,10 @@ function createIngestionClient({
1436
1344
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1437
1345
  */
1438
1346
  push({ indexName, pushTaskPayload, watch, referenceIndexName }, requestOptions) {
1439
- if (!indexName) {
1440
- throw new Error("Parameter `indexName` is required when calling `push`.");
1441
- }
1442
- if (!pushTaskPayload) {
1443
- throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");
1444
- }
1445
- if (!pushTaskPayload.action) {
1446
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");
1447
- }
1448
- if (!pushTaskPayload.records) {
1449
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");
1450
- }
1347
+ (0, import_client_common.validateRequired)("indexName", "push", indexName);
1348
+ (0, import_client_common.validateRequired)("pushTaskPayload", "push", pushTaskPayload);
1349
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "push", pushTaskPayload.action);
1350
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "push", pushTaskPayload.records);
1451
1351
  const requestPath = "/1/push/{indexName}".replace("{indexName}", encodeURIComponent(indexName));
1452
1352
  const headers = {};
1453
1353
  const queryParameters = {};
@@ -1488,18 +1388,10 @@ function createIngestionClient({
1488
1388
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1489
1389
  */
1490
1390
  pushTask({ taskID, pushTaskPayload, watch }, requestOptions) {
1491
- if (!taskID) {
1492
- throw new Error("Parameter `taskID` is required when calling `pushTask`.");
1493
- }
1494
- if (!pushTaskPayload) {
1495
- throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");
1496
- }
1497
- if (!pushTaskPayload.action) {
1498
- throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");
1499
- }
1500
- if (!pushTaskPayload.records) {
1501
- throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");
1502
- }
1391
+ (0, import_client_common.validateRequired)("taskID", "pushTask", taskID);
1392
+ (0, import_client_common.validateRequired)("pushTaskPayload", "pushTask", pushTaskPayload);
1393
+ (0, import_client_common.validateRequired)("pushTaskPayload.action", "pushTask", pushTaskPayload.action);
1394
+ (0, import_client_common.validateRequired)("pushTaskPayload.records", "pushTask", pushTaskPayload.records);
1503
1395
  const requestPath = "/2/tasks/{taskID}/push".replace("{taskID}", encodeURIComponent(taskID));
1504
1396
  const headers = {};
1505
1397
  const queryParameters = {};
@@ -1536,18 +1428,10 @@ function createIngestionClient({
1536
1428
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1537
1429
  */
1538
1430
  replaceTask({ taskID, taskReplace }, requestOptions) {
1539
- if (!taskID) {
1540
- throw new Error("Parameter `taskID` is required when calling `replaceTask`.");
1541
- }
1542
- if (!taskReplace) {
1543
- throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");
1544
- }
1545
- if (!taskReplace.destinationID) {
1546
- throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");
1547
- }
1548
- if (!taskReplace.action) {
1549
- throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");
1550
- }
1431
+ (0, import_client_common.validateRequired)("taskID", "replaceTask", taskID);
1432
+ (0, import_client_common.validateRequired)("taskReplace", "replaceTask", taskReplace);
1433
+ (0, import_client_common.validateRequired)("taskReplace.destinationID", "replaceTask", taskReplace.destinationID);
1434
+ (0, import_client_common.validateRequired)("taskReplace.action", "replaceTask", taskReplace.action);
1551
1435
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
1552
1436
  const headers = {};
1553
1437
  const queryParameters = {};
@@ -1573,9 +1457,7 @@ function createIngestionClient({
1573
1457
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1574
1458
  */
1575
1459
  runSource({ sourceID, runSourcePayload }, requestOptions) {
1576
- if (!sourceID) {
1577
- throw new Error("Parameter `sourceID` is required when calling `runSource`.");
1578
- }
1460
+ (0, import_client_common.validateRequired)("sourceID", "runSource", sourceID);
1579
1461
  const requestPath = "/1/sources/{sourceID}/run".replace("{sourceID}", encodeURIComponent(sourceID));
1580
1462
  const headers = {};
1581
1463
  const queryParameters = {};
@@ -1601,9 +1483,7 @@ function createIngestionClient({
1601
1483
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1602
1484
  */
1603
1485
  runTask({ taskID, runTaskPayload }, requestOptions) {
1604
- if (!taskID) {
1605
- throw new Error("Parameter `taskID` is required when calling `runTask`.");
1606
- }
1486
+ (0, import_client_common.validateRequired)("taskID", "runTask", taskID);
1607
1487
  const requestPath = "/2/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1608
1488
  const headers = {};
1609
1489
  const queryParameters = {};
@@ -1631,9 +1511,7 @@ function createIngestionClient({
1631
1511
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1632
1512
  */
1633
1513
  runTaskV1({ taskID, runTaskPayload }, requestOptions) {
1634
- if (!taskID) {
1635
- throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");
1636
- }
1514
+ (0, import_client_common.validateRequired)("taskID", "runTaskV1", taskID);
1637
1515
  const requestPath = "/1/tasks/{taskID}/run".replace("{taskID}", encodeURIComponent(taskID));
1638
1516
  const headers = {};
1639
1517
  const queryParameters = {};
@@ -1657,14 +1535,12 @@ function createIngestionClient({
1657
1535
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1658
1536
  */
1659
1537
  searchAuthentications(authenticationSearch, requestOptions) {
1660
- if (!authenticationSearch) {
1661
- throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");
1662
- }
1663
- if (!authenticationSearch.authenticationIDs) {
1664
- throw new Error(
1665
- "Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`."
1666
- );
1667
- }
1538
+ (0, import_client_common.validateRequired)("authenticationSearch", "searchAuthentications", authenticationSearch);
1539
+ (0, import_client_common.validateRequired)(
1540
+ "authenticationSearch.authenticationIDs",
1541
+ "searchAuthentications",
1542
+ authenticationSearch.authenticationIDs
1543
+ );
1668
1544
  const requestPath = "/1/authentications/search";
1669
1545
  const headers = {};
1670
1546
  const queryParameters = {};
@@ -1688,12 +1564,8 @@ function createIngestionClient({
1688
1564
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1689
1565
  */
1690
1566
  searchDestinations(destinationSearch, requestOptions) {
1691
- if (!destinationSearch) {
1692
- throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");
1693
- }
1694
- if (!destinationSearch.destinationIDs) {
1695
- throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");
1696
- }
1567
+ (0, import_client_common.validateRequired)("destinationSearch", "searchDestinations", destinationSearch);
1568
+ (0, import_client_common.validateRequired)("destinationSearch.destinationIDs", "searchDestinations", destinationSearch.destinationIDs);
1697
1569
  const requestPath = "/1/destinations/search";
1698
1570
  const headers = {};
1699
1571
  const queryParameters = {};
@@ -1717,12 +1589,8 @@ function createIngestionClient({
1717
1589
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1718
1590
  */
1719
1591
  searchSources(sourceSearch, requestOptions) {
1720
- if (!sourceSearch) {
1721
- throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");
1722
- }
1723
- if (!sourceSearch.sourceIDs) {
1724
- throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");
1725
- }
1592
+ (0, import_client_common.validateRequired)("sourceSearch", "searchSources", sourceSearch);
1593
+ (0, import_client_common.validateRequired)("sourceSearch.sourceIDs", "searchSources", sourceSearch.sourceIDs);
1726
1594
  const requestPath = "/1/sources/search";
1727
1595
  const headers = {};
1728
1596
  const queryParameters = {};
@@ -1746,12 +1614,8 @@ function createIngestionClient({
1746
1614
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1747
1615
  */
1748
1616
  searchTasks(taskSearch, requestOptions) {
1749
- if (!taskSearch) {
1750
- throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");
1751
- }
1752
- if (!taskSearch.taskIDs) {
1753
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");
1754
- }
1617
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasks", taskSearch);
1618
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasks", taskSearch.taskIDs);
1755
1619
  const requestPath = "/2/tasks/search";
1756
1620
  const headers = {};
1757
1621
  const queryParameters = {};
@@ -1777,12 +1641,8 @@ function createIngestionClient({
1777
1641
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1778
1642
  */
1779
1643
  searchTasksV1(taskSearch, requestOptions) {
1780
- if (!taskSearch) {
1781
- throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");
1782
- }
1783
- if (!taskSearch.taskIDs) {
1784
- throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");
1785
- }
1644
+ (0, import_client_common.validateRequired)("taskSearch", "searchTasksV1", taskSearch);
1645
+ (0, import_client_common.validateRequired)("taskSearch.taskIDs", "searchTasksV1", taskSearch.taskIDs);
1786
1646
  const requestPath = "/1/tasks/search";
1787
1647
  const headers = {};
1788
1648
  const queryParameters = {};
@@ -1806,14 +1666,12 @@ function createIngestionClient({
1806
1666
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1807
1667
  */
1808
1668
  searchTransformations(transformationSearch, requestOptions) {
1809
- if (!transformationSearch) {
1810
- throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");
1811
- }
1812
- if (!transformationSearch.transformationIDs) {
1813
- throw new Error(
1814
- "Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`."
1815
- );
1816
- }
1669
+ (0, import_client_common.validateRequired)("transformationSearch", "searchTransformations", transformationSearch);
1670
+ (0, import_client_common.validateRequired)(
1671
+ "transformationSearch.transformationIDs",
1672
+ "searchTransformations",
1673
+ transformationSearch.transformationIDs
1674
+ );
1817
1675
  const requestPath = "/1/transformations/search";
1818
1676
  const headers = {};
1819
1677
  const queryParameters = {};
@@ -1838,9 +1696,7 @@ function createIngestionClient({
1838
1696
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1839
1697
  */
1840
1698
  triggerDockerSourceDiscover({ sourceID }, requestOptions) {
1841
- if (!sourceID) {
1842
- throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");
1843
- }
1699
+ (0, import_client_common.validateRequired)("sourceID", "triggerDockerSourceDiscover", sourceID);
1844
1700
  const requestPath = "/1/sources/{sourceID}/discover".replace("{sourceID}", encodeURIComponent(sourceID));
1845
1701
  const headers = {};
1846
1702
  const queryParameters = {};
@@ -1871,12 +1727,8 @@ function createIngestionClient({
1871
1727
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1872
1728
  */
1873
1729
  tryTransformation(transformationTry, requestOptions) {
1874
- if (!transformationTry) {
1875
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");
1876
- }
1877
- if (!transformationTry.sampleRecord) {
1878
- throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");
1879
- }
1730
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformation", transformationTry);
1731
+ (0, import_client_common.validateRequired)("transformationTry.sampleRecord", "tryTransformation", transformationTry.sampleRecord);
1880
1732
  const requestPath = "/1/transformations/try";
1881
1733
  const headers = {};
1882
1734
  const queryParameters = {};
@@ -1902,17 +1754,13 @@ function createIngestionClient({
1902
1754
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1903
1755
  */
1904
1756
  tryTransformationBeforeUpdate({ transformationID, transformationTry }, requestOptions) {
1905
- if (!transformationID) {
1906
- throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");
1907
- }
1908
- if (!transformationTry) {
1909
- throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");
1910
- }
1911
- if (!transformationTry.sampleRecord) {
1912
- throw new Error(
1913
- "Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`."
1914
- );
1915
- }
1757
+ (0, import_client_common.validateRequired)("transformationID", "tryTransformationBeforeUpdate", transformationID);
1758
+ (0, import_client_common.validateRequired)("transformationTry", "tryTransformationBeforeUpdate", transformationTry);
1759
+ (0, import_client_common.validateRequired)(
1760
+ "transformationTry.sampleRecord",
1761
+ "tryTransformationBeforeUpdate",
1762
+ transformationTry.sampleRecord
1763
+ );
1916
1764
  const requestPath = "/1/transformations/{transformationID}/try".replace(
1917
1765
  "{transformationID}",
1918
1766
  encodeURIComponent(transformationID)
@@ -1941,12 +1789,8 @@ function createIngestionClient({
1941
1789
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1942
1790
  */
1943
1791
  updateAuthentication({ authenticationID, authenticationUpdate }, requestOptions) {
1944
- if (!authenticationID) {
1945
- throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");
1946
- }
1947
- if (!authenticationUpdate) {
1948
- throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");
1949
- }
1792
+ (0, import_client_common.validateRequired)("authenticationID", "updateAuthentication", authenticationID);
1793
+ (0, import_client_common.validateRequired)("authenticationUpdate", "updateAuthentication", authenticationUpdate);
1950
1794
  const requestPath = "/1/authentications/{authenticationID}".replace(
1951
1795
  "{authenticationID}",
1952
1796
  encodeURIComponent(authenticationID)
@@ -1975,12 +1819,8 @@ function createIngestionClient({
1975
1819
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1976
1820
  */
1977
1821
  updateDestination({ destinationID, destinationUpdate }, requestOptions) {
1978
- if (!destinationID) {
1979
- throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");
1980
- }
1981
- if (!destinationUpdate) {
1982
- throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");
1983
- }
1822
+ (0, import_client_common.validateRequired)("destinationID", "updateDestination", destinationID);
1823
+ (0, import_client_common.validateRequired)("destinationUpdate", "updateDestination", destinationUpdate);
1984
1824
  const requestPath = "/1/destinations/{destinationID}".replace(
1985
1825
  "{destinationID}",
1986
1826
  encodeURIComponent(destinationID)
@@ -2009,12 +1849,8 @@ function createIngestionClient({
2009
1849
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2010
1850
  */
2011
1851
  updateSource({ sourceID, sourceUpdate }, requestOptions) {
2012
- if (!sourceID) {
2013
- throw new Error("Parameter `sourceID` is required when calling `updateSource`.");
2014
- }
2015
- if (!sourceUpdate) {
2016
- throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");
2017
- }
1852
+ (0, import_client_common.validateRequired)("sourceID", "updateSource", sourceID);
1853
+ (0, import_client_common.validateRequired)("sourceUpdate", "updateSource", sourceUpdate);
2018
1854
  const requestPath = "/1/sources/{sourceID}".replace("{sourceID}", encodeURIComponent(sourceID));
2019
1855
  const headers = {};
2020
1856
  const queryParameters = {};
@@ -2040,12 +1876,8 @@ function createIngestionClient({
2040
1876
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2041
1877
  */
2042
1878
  updateTask({ taskID, taskUpdate }, requestOptions) {
2043
- if (!taskID) {
2044
- throw new Error("Parameter `taskID` is required when calling `updateTask`.");
2045
- }
2046
- if (!taskUpdate) {
2047
- throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");
2048
- }
1879
+ (0, import_client_common.validateRequired)("taskID", "updateTask", taskID);
1880
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTask", taskUpdate);
2049
1881
  const requestPath = "/2/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2050
1882
  const headers = {};
2051
1883
  const queryParameters = {};
@@ -2073,12 +1905,8 @@ function createIngestionClient({
2073
1905
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2074
1906
  */
2075
1907
  updateTaskV1({ taskID, taskUpdate }, requestOptions) {
2076
- if (!taskID) {
2077
- throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");
2078
- }
2079
- if (!taskUpdate) {
2080
- throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");
2081
- }
1908
+ (0, import_client_common.validateRequired)("taskID", "updateTaskV1", taskID);
1909
+ (0, import_client_common.validateRequired)("taskUpdate", "updateTaskV1", taskUpdate);
2082
1910
  const requestPath = "/1/tasks/{taskID}".replace("{taskID}", encodeURIComponent(taskID));
2083
1911
  const headers = {};
2084
1912
  const queryParameters = {};
@@ -2104,15 +1932,9 @@ function createIngestionClient({
2104
1932
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2105
1933
  */
2106
1934
  updateTransformation({ transformationID, transformationCreate }, requestOptions) {
2107
- if (!transformationID) {
2108
- throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");
2109
- }
2110
- if (!transformationCreate) {
2111
- throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");
2112
- }
2113
- if (!transformationCreate.name) {
2114
- throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");
2115
- }
1935
+ (0, import_client_common.validateRequired)("transformationID", "updateTransformation", transformationID);
1936
+ (0, import_client_common.validateRequired)("transformationCreate", "updateTransformation", transformationCreate);
1937
+ (0, import_client_common.validateRequired)("transformationCreate.name", "updateTransformation", transformationCreate.name);
2116
1938
  const requestPath = "/1/transformations/{transformationID}".replace(
2117
1939
  "{transformationID}",
2118
1940
  encodeURIComponent(transformationID)
@@ -2172,12 +1994,8 @@ function createIngestionClient({
2172
1994
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
2173
1995
  */
2174
1996
  validateSourceBeforeUpdate({ sourceID, sourceUpdate }, requestOptions) {
2175
- if (!sourceID) {
2176
- throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");
2177
- }
2178
- if (!sourceUpdate) {
2179
- throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");
2180
- }
1997
+ (0, import_client_common.validateRequired)("sourceID", "validateSourceBeforeUpdate", sourceID);
1998
+ (0, import_client_common.validateRequired)("sourceUpdate", "validateSourceBeforeUpdate", sourceUpdate);
2181
1999
  const requestPath = "/1/sources/{sourceID}/validate".replace("{sourceID}", encodeURIComponent(sourceID));
2182
2000
  const headers = {};
2183
2001
  const queryParameters = {};