@autifyhq/autify-sdk 0.18.0 → 0.20.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.
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.UrlReplacementApi = exports.UrlReplacementApiFactory = exports.UrlReplacementApiFp = exports.UrlReplacementApiAxiosParamCreator = exports.ScheduleApi = exports.ScheduleApiFactory = exports.ScheduleApiFp = exports.ScheduleApiAxiosParamCreator = exports.ScenarioApi = exports.ScenarioApiFactory = exports.ScenarioApiFp = exports.ScenarioApiAxiosParamCreator = exports.ResultApi = exports.ResultApiFactory = exports.ResultApiFp = exports.ResultApiAxiosParamCreator = exports.CapabilityApi = exports.CapabilityApiFactory = exports.CapabilityApiFp = exports.CapabilityApiAxiosParamCreator = exports.AutifyConnectApi = exports.AutifyConnectApiFactory = exports.AutifyConnectApiFp = exports.AutifyConnectApiAxiosParamCreator = exports.TestPlanResultStatus = exports.TestCaseResultStatus = exports.ExecuteScenariosRequestExecutionTypeEnum = void 0;
16
+ exports.UrlReplacementApi = exports.UrlReplacementApiFactory = exports.UrlReplacementApiFp = exports.UrlReplacementApiAxiosParamCreator = exports.TestPlanVariableApi = exports.TestPlanVariableApiFactory = exports.TestPlanVariableApiFp = exports.TestPlanVariableApiAxiosParamCreator = exports.ScheduleApi = exports.ScheduleApiFactory = exports.ScheduleApiFp = exports.ScheduleApiAxiosParamCreator = exports.ScenarioApi = exports.ScenarioApiFactory = exports.ScenarioApiFp = exports.ScenarioApiAxiosParamCreator = exports.ResultApi = exports.ResultApiFactory = exports.ResultApiFp = exports.ResultApiAxiosParamCreator = exports.ProjectApi = exports.ProjectApiFactory = exports.ProjectApiFp = exports.ProjectApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.CapabilityApi = exports.CapabilityApiFactory = exports.CapabilityApiFp = exports.CapabilityApiAxiosParamCreator = exports.AutifyConnectApi = exports.AutifyConnectApiFactory = exports.AutifyConnectApiFp = exports.AutifyConnectApiAxiosParamCreator = exports.TestPlanResultStatus = exports.TestCaseResultStatus = exports.ExecuteScenariosRequestExecutionTypeEnum = void 0;
17
17
  const tslib_1 = require("tslib");
18
18
  const axios_1 = tslib_1.__importDefault(require("axios"));
19
19
  // URLSearchParams not necessarily used
@@ -461,6 +461,265 @@ class CapabilityApi extends base_1.BaseAPI {
461
461
  }
462
462
  }
463
463
  exports.CapabilityApi = CapabilityApi;
464
+ /**
465
+ * CreditApi - axios parameter creator
466
+ * @export
467
+ */
468
+ const CreditApiAxiosParamCreator = function (configuration) {
469
+ return {
470
+ /**
471
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
472
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
473
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-21\").
474
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-28\").
475
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
476
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
477
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
478
+ * @param {*} [options] Override http request option.
479
+ * @throws {RequiredError}
480
+ */
481
+ getCreditUsage: async (projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options = {}) => {
482
+ // verify required parameter 'projectId' is not null or undefined
483
+ (0, common_1.assertParamExists)("getCreditUsage", "projectId", projectId);
484
+ const localVarPath = `/projects/{project_id}/credits`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId)));
485
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
486
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
487
+ let baseOptions;
488
+ if (configuration) {
489
+ baseOptions = configuration.baseOptions;
490
+ }
491
+ const localVarRequestOptions = {
492
+ method: "GET",
493
+ ...baseOptions,
494
+ ...options,
495
+ };
496
+ const localVarHeaderParameter = {};
497
+ const localVarQueryParameter = {};
498
+ // authentication bearerAuth required
499
+ // http bearer authentication required
500
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
501
+ if (dateFrom !== undefined) {
502
+ localVarQueryParameter["date_from"] =
503
+ dateFrom instanceof Date
504
+ ? dateFrom.toISOString().substr(0, 10)
505
+ : dateFrom;
506
+ }
507
+ if (dateTo !== undefined) {
508
+ localVarQueryParameter["date_to"] =
509
+ dateTo instanceof Date
510
+ ? dateTo.toISOString().substr(0, 10)
511
+ : dateTo;
512
+ }
513
+ if (scenarioId !== undefined) {
514
+ localVarQueryParameter["scenario_id"] = scenarioId;
515
+ }
516
+ if (testPlanId !== undefined) {
517
+ localVarQueryParameter["test_plan_id"] = testPlanId;
518
+ }
519
+ if (userId !== undefined) {
520
+ localVarQueryParameter["user_id"] = userId;
521
+ }
522
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
523
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
524
+ localVarRequestOptions.headers = {
525
+ ...localVarHeaderParameter,
526
+ ...headersFromBaseOptions,
527
+ ...options.headers,
528
+ };
529
+ return {
530
+ url: (0, common_1.toPathString)(localVarUrlObj),
531
+ options: localVarRequestOptions,
532
+ };
533
+ },
534
+ };
535
+ };
536
+ exports.CreditApiAxiosParamCreator = CreditApiAxiosParamCreator;
537
+ /**
538
+ * CreditApi - functional programming interface
539
+ * @export
540
+ */
541
+ const CreditApiFp = function (configuration) {
542
+ const localVarAxiosParamCreator = (0, exports.CreditApiAxiosParamCreator)(configuration);
543
+ return {
544
+ /**
545
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
546
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
547
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-21\").
548
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-28\").
549
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
550
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
551
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
552
+ * @param {*} [options] Override http request option.
553
+ * @throws {RequiredError}
554
+ */
555
+ async getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
556
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options);
557
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
558
+ },
559
+ };
560
+ };
561
+ exports.CreditApiFp = CreditApiFp;
562
+ /**
563
+ * CreditApi - factory interface
564
+ * @export
565
+ */
566
+ const CreditApiFactory = function (configuration, basePath, axios) {
567
+ const localVarFp = (0, exports.CreditApiFp)(configuration);
568
+ return {
569
+ /**
570
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
571
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
572
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-21\").
573
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-28\").
574
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
575
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
576
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
577
+ * @param {*} [options] Override http request option.
578
+ * @throws {RequiredError}
579
+ */
580
+ getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
581
+ return localVarFp
582
+ .getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options)
583
+ .then((request) => request(axios, basePath));
584
+ },
585
+ };
586
+ };
587
+ exports.CreditApiFactory = CreditApiFactory;
588
+ /**
589
+ * CreditApi - object-oriented interface
590
+ * @export
591
+ * @class CreditApi
592
+ * @extends {BaseAPI}
593
+ */
594
+ class CreditApi extends base_1.BaseAPI {
595
+ /**
596
+ * Get the number of credits used in the project\\ \\ Notes:\\ This endpoint works only for organizations on credit-based plans. It always returns 0 for `credits_consumed` and `credit_consumption_event_count` if your organization is on a run-based plan.
597
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/credits
598
+ * @param {string} [dateFrom] The date to start counting used credits from.\\ If not specified, the date will be set to 1 week ago.\\ Up to 90 days in advance can be specified. If the specified date is more than 90 days in the past, the date will be set to 90 days ago.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-21\").
599
+ * @param {string} [dateTo] The date to end counting used credits from.\\ If not specified, the date will be set to today.\\ Date must follow the format YYYY-MM-DD (example: \"2023-09-28\").
600
+ * @param {number} [scenarioId] The scenario ID to filter used credits by.
601
+ * @param {number} [testPlanId] The test plan ID to filter used credits by.
602
+ * @param {number} [userId] The user ID that executed tests to filter used credits by.
603
+ * @param {*} [options] Override http request option.
604
+ * @throws {RequiredError}
605
+ * @memberof CreditApi
606
+ */
607
+ getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options) {
608
+ return (0, exports.CreditApiFp)(this.configuration)
609
+ .getCreditUsage(projectId, dateFrom, dateTo, scenarioId, testPlanId, userId, options)
610
+ .then((request) => request(this.axios, this.basePath));
611
+ }
612
+ }
613
+ exports.CreditApi = CreditApi;
614
+ /**
615
+ * ProjectApi - axios parameter creator
616
+ * @export
617
+ */
618
+ const ProjectApiAxiosParamCreator = function (configuration) {
619
+ return {
620
+ /**
621
+ * Get project information.
622
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
623
+ * @param {*} [options] Override http request option.
624
+ * @throws {RequiredError}
625
+ */
626
+ getProjectInfo: async (projectId, options = {}) => {
627
+ // verify required parameter 'projectId' is not null or undefined
628
+ (0, common_1.assertParamExists)("getProjectInfo", "projectId", projectId);
629
+ const localVarPath = `/projects/{project_id}/project_info`.replace(`{${"project_id"}}`, encodeURIComponent(String(projectId)));
630
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
631
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
632
+ let baseOptions;
633
+ if (configuration) {
634
+ baseOptions = configuration.baseOptions;
635
+ }
636
+ const localVarRequestOptions = {
637
+ method: "GET",
638
+ ...baseOptions,
639
+ ...options,
640
+ };
641
+ const localVarHeaderParameter = {};
642
+ const localVarQueryParameter = {};
643
+ // authentication bearerAuth required
644
+ // http bearer authentication required
645
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
646
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
647
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
648
+ localVarRequestOptions.headers = {
649
+ ...localVarHeaderParameter,
650
+ ...headersFromBaseOptions,
651
+ ...options.headers,
652
+ };
653
+ return {
654
+ url: (0, common_1.toPathString)(localVarUrlObj),
655
+ options: localVarRequestOptions,
656
+ };
657
+ },
658
+ };
659
+ };
660
+ exports.ProjectApiAxiosParamCreator = ProjectApiAxiosParamCreator;
661
+ /**
662
+ * ProjectApi - functional programming interface
663
+ * @export
664
+ */
665
+ const ProjectApiFp = function (configuration) {
666
+ const localVarAxiosParamCreator = (0, exports.ProjectApiAxiosParamCreator)(configuration);
667
+ return {
668
+ /**
669
+ * Get project information.
670
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
671
+ * @param {*} [options] Override http request option.
672
+ * @throws {RequiredError}
673
+ */
674
+ async getProjectInfo(projectId, options) {
675
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getProjectInfo(projectId, options);
676
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
677
+ },
678
+ };
679
+ };
680
+ exports.ProjectApiFp = ProjectApiFp;
681
+ /**
682
+ * ProjectApi - factory interface
683
+ * @export
684
+ */
685
+ const ProjectApiFactory = function (configuration, basePath, axios) {
686
+ const localVarFp = (0, exports.ProjectApiFp)(configuration);
687
+ return {
688
+ /**
689
+ * Get project information.
690
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
691
+ * @param {*} [options] Override http request option.
692
+ * @throws {RequiredError}
693
+ */
694
+ getProjectInfo(projectId, options) {
695
+ return localVarFp
696
+ .getProjectInfo(projectId, options)
697
+ .then((request) => request(axios, basePath));
698
+ },
699
+ };
700
+ };
701
+ exports.ProjectApiFactory = ProjectApiFactory;
702
+ /**
703
+ * ProjectApi - object-oriented interface
704
+ * @export
705
+ * @class ProjectApi
706
+ * @extends {BaseAPI}
707
+ */
708
+ class ProjectApi extends base_1.BaseAPI {
709
+ /**
710
+ * Get project information.
711
+ * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/project_info
712
+ * @param {*} [options] Override http request option.
713
+ * @throws {RequiredError}
714
+ * @memberof ProjectApi
715
+ */
716
+ getProjectInfo(projectId, options) {
717
+ return (0, exports.ProjectApiFp)(this.configuration)
718
+ .getProjectInfo(projectId, options)
719
+ .then((request) => request(this.axios, this.basePath));
720
+ }
721
+ }
722
+ exports.ProjectApi = ProjectApi;
464
723
  /**
465
724
  * ResultApi - axios parameter creator
466
725
  * @export
@@ -472,10 +731,11 @@ const ResultApiAxiosParamCreator = function (configuration) {
472
731
  * @summary Get a test result.
473
732
  * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
474
733
  * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
734
+ * @param {boolean} [getDetails] The flag to get details of the test case result.
475
735
  * @param {*} [options] Override http request option.
476
736
  * @throws {RequiredError}
477
737
  */
478
- describeResult: async (projectId, resultId, options = {}) => {
738
+ describeResult: async (projectId, resultId, getDetails, options = {}) => {
479
739
  // verify required parameter 'projectId' is not null or undefined
480
740
  (0, common_1.assertParamExists)("describeResult", "projectId", projectId);
481
741
  // verify required parameter 'resultId' is not null or undefined
@@ -499,6 +759,9 @@ const ResultApiAxiosParamCreator = function (configuration) {
499
759
  // authentication bearerAuth required
500
760
  // http bearer authentication required
501
761
  await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
762
+ if (getDetails !== undefined) {
763
+ localVarQueryParameter["get_details"] = getDetails;
764
+ }
502
765
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
503
766
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
504
767
  localVarRequestOptions.headers = {
@@ -577,11 +840,12 @@ const ResultApiFp = function (configuration) {
577
840
  * @summary Get a test result.
578
841
  * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
579
842
  * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
843
+ * @param {boolean} [getDetails] The flag to get details of the test case result.
580
844
  * @param {*} [options] Override http request option.
581
845
  * @throws {RequiredError}
582
846
  */
583
- async describeResult(projectId, resultId, options) {
584
- const localVarAxiosArgs = await localVarAxiosParamCreator.describeResult(projectId, resultId, options);
847
+ async describeResult(projectId, resultId, getDetails, options) {
848
+ const localVarAxiosArgs = await localVarAxiosParamCreator.describeResult(projectId, resultId, getDetails, options);
585
849
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
586
850
  },
587
851
  /**
@@ -613,12 +877,13 @@ const ResultApiFactory = function (configuration, basePath, axios) {
613
877
  * @summary Get a test result.
614
878
  * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
615
879
  * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
880
+ * @param {boolean} [getDetails] The flag to get details of the test case result.
616
881
  * @param {*} [options] Override http request option.
617
882
  * @throws {RequiredError}
618
883
  */
619
- describeResult(projectId, resultId, options) {
884
+ describeResult(projectId, resultId, getDetails, options) {
620
885
  return localVarFp
621
- .describeResult(projectId, resultId, options)
886
+ .describeResult(projectId, resultId, getDetails, options)
622
887
  .then((request) => request(axios, basePath));
623
888
  },
624
889
  /**
@@ -651,13 +916,14 @@ class ResultApi extends base_1.BaseAPI {
651
916
  * @summary Get a test result.
652
917
  * @param {number} projectId For example, 1 for the following URL: https://app.autify.com/projects/1/results/4
653
918
  * @param {number} resultId For example, 4 for the following URL: https://app.autify.com/projects/1/results/4
919
+ * @param {boolean} [getDetails] The flag to get details of the test case result.
654
920
  * @param {*} [options] Override http request option.
655
921
  * @throws {RequiredError}
656
922
  * @memberof ResultApi
657
923
  */
658
- describeResult(projectId, resultId, options) {
924
+ describeResult(projectId, resultId, getDetails, options) {
659
925
  return (0, exports.ResultApiFp)(this.configuration)
660
- .describeResult(projectId, resultId, options)
926
+ .describeResult(projectId, resultId, getDetails, options)
661
927
  .then((request) => request(this.axios, this.basePath));
662
928
  }
663
929
  /**
@@ -1071,6 +1337,360 @@ class ScheduleApi extends base_1.BaseAPI {
1071
1337
  }
1072
1338
  }
1073
1339
  exports.ScheduleApi = ScheduleApi;
1340
+ /**
1341
+ * TestPlanVariableApi - axios parameter creator
1342
+ * @export
1343
+ */
1344
+ const TestPlanVariableApiAxiosParamCreator = function (configuration) {
1345
+ return {
1346
+ /**
1347
+ * Create a new variable for the test plan
1348
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1349
+ * @param {CreateTestPlanVariableRequest} createTestPlanVariableRequest The new variable key and default value to use in the test plan
1350
+ * @param {*} [options] Override http request option.
1351
+ * @throws {RequiredError}
1352
+ */
1353
+ createTestPlanVariable: async (testPlanId, createTestPlanVariableRequest, options = {}) => {
1354
+ // verify required parameter 'testPlanId' is not null or undefined
1355
+ (0, common_1.assertParamExists)("createTestPlanVariable", "testPlanId", testPlanId);
1356
+ // verify required parameter 'createTestPlanVariableRequest' is not null or undefined
1357
+ (0, common_1.assertParamExists)("createTestPlanVariable", "createTestPlanVariableRequest", createTestPlanVariableRequest);
1358
+ const localVarPath = `/test_plans/{test_plan_id}/test_plan_variables`.replace(`{${"test_plan_id"}}`, encodeURIComponent(String(testPlanId)));
1359
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1360
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
1361
+ let baseOptions;
1362
+ if (configuration) {
1363
+ baseOptions = configuration.baseOptions;
1364
+ }
1365
+ const localVarRequestOptions = {
1366
+ method: "POST",
1367
+ ...baseOptions,
1368
+ ...options,
1369
+ };
1370
+ const localVarHeaderParameter = {};
1371
+ const localVarQueryParameter = {};
1372
+ // authentication bearerAuth required
1373
+ // http bearer authentication required
1374
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1375
+ localVarHeaderParameter["Content-Type"] = "application/json";
1376
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1377
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1378
+ localVarRequestOptions.headers = {
1379
+ ...localVarHeaderParameter,
1380
+ ...headersFromBaseOptions,
1381
+ ...options.headers,
1382
+ };
1383
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createTestPlanVariableRequest, localVarRequestOptions, configuration);
1384
+ return {
1385
+ url: (0, common_1.toPathString)(localVarUrlObj),
1386
+ options: localVarRequestOptions,
1387
+ };
1388
+ },
1389
+ /**
1390
+ * Delete an existing test plan variable for the test plan
1391
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15/
1392
+ * @param {number} testPlanVariableId test_plan_variable id
1393
+ * @param {*} [options] Override http request option.
1394
+ * @throws {RequiredError}
1395
+ */
1396
+ deleteTestPlanVariable: async (testPlanId, testPlanVariableId, options = {}) => {
1397
+ // verify required parameter 'testPlanId' is not null or undefined
1398
+ (0, common_1.assertParamExists)("deleteTestPlanVariable", "testPlanId", testPlanId);
1399
+ // verify required parameter 'testPlanVariableId' is not null or undefined
1400
+ (0, common_1.assertParamExists)("deleteTestPlanVariable", "testPlanVariableId", testPlanVariableId);
1401
+ const localVarPath = `/test_plans/{test_plan_id}/test_plan_variables/{test_plan_variable_id}`
1402
+ .replace(`{${"test_plan_id"}}`, encodeURIComponent(String(testPlanId)))
1403
+ .replace(`{${"test_plan_variable_id"}}`, encodeURIComponent(String(testPlanVariableId)));
1404
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1405
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
1406
+ let baseOptions;
1407
+ if (configuration) {
1408
+ baseOptions = configuration.baseOptions;
1409
+ }
1410
+ const localVarRequestOptions = {
1411
+ method: "DELETE",
1412
+ ...baseOptions,
1413
+ ...options,
1414
+ };
1415
+ const localVarHeaderParameter = {};
1416
+ const localVarQueryParameter = {};
1417
+ // authentication bearerAuth required
1418
+ // http bearer authentication required
1419
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1420
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1421
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1422
+ localVarRequestOptions.headers = {
1423
+ ...localVarHeaderParameter,
1424
+ ...headersFromBaseOptions,
1425
+ ...options.headers,
1426
+ };
1427
+ return {
1428
+ url: (0, common_1.toPathString)(localVarUrlObj),
1429
+ options: localVarRequestOptions,
1430
+ };
1431
+ },
1432
+ /**
1433
+ * List the test plan\'s variables
1434
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1435
+ * @param {*} [options] Override http request option.
1436
+ * @throws {RequiredError}
1437
+ */
1438
+ listTestPlanVariable: async (testPlanId, options = {}) => {
1439
+ // verify required parameter 'testPlanId' is not null or undefined
1440
+ (0, common_1.assertParamExists)("listTestPlanVariable", "testPlanId", testPlanId);
1441
+ const localVarPath = `/test_plans/{test_plan_id}/test_plan_variables`.replace(`{${"test_plan_id"}}`, encodeURIComponent(String(testPlanId)));
1442
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1443
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
1444
+ let baseOptions;
1445
+ if (configuration) {
1446
+ baseOptions = configuration.baseOptions;
1447
+ }
1448
+ const localVarRequestOptions = {
1449
+ method: "GET",
1450
+ ...baseOptions,
1451
+ ...options,
1452
+ };
1453
+ const localVarHeaderParameter = {};
1454
+ const localVarQueryParameter = {};
1455
+ // authentication bearerAuth required
1456
+ // http bearer authentication required
1457
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1458
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1459
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1460
+ localVarRequestOptions.headers = {
1461
+ ...localVarHeaderParameter,
1462
+ ...headersFromBaseOptions,
1463
+ ...options.headers,
1464
+ };
1465
+ return {
1466
+ url: (0, common_1.toPathString)(localVarUrlObj),
1467
+ options: localVarRequestOptions,
1468
+ };
1469
+ },
1470
+ /**
1471
+ * Update a url replacement for the test plan
1472
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1473
+ * @param {number} testPlanVariableId test_plan_variable id
1474
+ * @param {UpdateTestPlanVariableRequest} updateTestPlanVariableRequest The variable\'s new key and/or default_value\'s value to register
1475
+ * @param {*} [options] Override http request option.
1476
+ * @throws {RequiredError}
1477
+ */
1478
+ updateTestPlanVariable: async (testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options = {}) => {
1479
+ // verify required parameter 'testPlanId' is not null or undefined
1480
+ (0, common_1.assertParamExists)("updateTestPlanVariable", "testPlanId", testPlanId);
1481
+ // verify required parameter 'testPlanVariableId' is not null or undefined
1482
+ (0, common_1.assertParamExists)("updateTestPlanVariable", "testPlanVariableId", testPlanVariableId);
1483
+ // verify required parameter 'updateTestPlanVariableRequest' is not null or undefined
1484
+ (0, common_1.assertParamExists)("updateTestPlanVariable", "updateTestPlanVariableRequest", updateTestPlanVariableRequest);
1485
+ const localVarPath = `/test_plans/{test_plan_id}/test_plan_variables/{test_plan_variable_id}`
1486
+ .replace(`{${"test_plan_id"}}`, encodeURIComponent(String(testPlanId)))
1487
+ .replace(`{${"test_plan_variable_id"}}`, encodeURIComponent(String(testPlanVariableId)));
1488
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1489
+ const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
1490
+ let baseOptions;
1491
+ if (configuration) {
1492
+ baseOptions = configuration.baseOptions;
1493
+ }
1494
+ const localVarRequestOptions = {
1495
+ method: "PUT",
1496
+ ...baseOptions,
1497
+ ...options,
1498
+ };
1499
+ const localVarHeaderParameter = {};
1500
+ const localVarQueryParameter = {};
1501
+ // authentication bearerAuth required
1502
+ // http bearer authentication required
1503
+ await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1504
+ localVarHeaderParameter["Content-Type"] = "application/json";
1505
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1506
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1507
+ localVarRequestOptions.headers = {
1508
+ ...localVarHeaderParameter,
1509
+ ...headersFromBaseOptions,
1510
+ ...options.headers,
1511
+ };
1512
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateTestPlanVariableRequest, localVarRequestOptions, configuration);
1513
+ return {
1514
+ url: (0, common_1.toPathString)(localVarUrlObj),
1515
+ options: localVarRequestOptions,
1516
+ };
1517
+ },
1518
+ };
1519
+ };
1520
+ exports.TestPlanVariableApiAxiosParamCreator = TestPlanVariableApiAxiosParamCreator;
1521
+ /**
1522
+ * TestPlanVariableApi - functional programming interface
1523
+ * @export
1524
+ */
1525
+ const TestPlanVariableApiFp = function (configuration) {
1526
+ const localVarAxiosParamCreator = (0, exports.TestPlanVariableApiAxiosParamCreator)(configuration);
1527
+ return {
1528
+ /**
1529
+ * Create a new variable for the test plan
1530
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1531
+ * @param {CreateTestPlanVariableRequest} createTestPlanVariableRequest The new variable key and default value to use in the test plan
1532
+ * @param {*} [options] Override http request option.
1533
+ * @throws {RequiredError}
1534
+ */
1535
+ async createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options) {
1536
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options);
1537
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1538
+ },
1539
+ /**
1540
+ * Delete an existing test plan variable for the test plan
1541
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15/
1542
+ * @param {number} testPlanVariableId test_plan_variable id
1543
+ * @param {*} [options] Override http request option.
1544
+ * @throws {RequiredError}
1545
+ */
1546
+ async deleteTestPlanVariable(testPlanId, testPlanVariableId, options) {
1547
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTestPlanVariable(testPlanId, testPlanVariableId, options);
1548
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1549
+ },
1550
+ /**
1551
+ * List the test plan\'s variables
1552
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1553
+ * @param {*} [options] Override http request option.
1554
+ * @throws {RequiredError}
1555
+ */
1556
+ async listTestPlanVariable(testPlanId, options) {
1557
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listTestPlanVariable(testPlanId, options);
1558
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1559
+ },
1560
+ /**
1561
+ * Update a url replacement for the test plan
1562
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1563
+ * @param {number} testPlanVariableId test_plan_variable id
1564
+ * @param {UpdateTestPlanVariableRequest} updateTestPlanVariableRequest The variable\'s new key and/or default_value\'s value to register
1565
+ * @param {*} [options] Override http request option.
1566
+ * @throws {RequiredError}
1567
+ */
1568
+ async updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options) {
1569
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options);
1570
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1571
+ },
1572
+ };
1573
+ };
1574
+ exports.TestPlanVariableApiFp = TestPlanVariableApiFp;
1575
+ /**
1576
+ * TestPlanVariableApi - factory interface
1577
+ * @export
1578
+ */
1579
+ const TestPlanVariableApiFactory = function (configuration, basePath, axios) {
1580
+ const localVarFp = (0, exports.TestPlanVariableApiFp)(configuration);
1581
+ return {
1582
+ /**
1583
+ * Create a new variable for the test plan
1584
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1585
+ * @param {CreateTestPlanVariableRequest} createTestPlanVariableRequest The new variable key and default value to use in the test plan
1586
+ * @param {*} [options] Override http request option.
1587
+ * @throws {RequiredError}
1588
+ */
1589
+ createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options) {
1590
+ return localVarFp
1591
+ .createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options)
1592
+ .then((request) => request(axios, basePath));
1593
+ },
1594
+ /**
1595
+ * Delete an existing test plan variable for the test plan
1596
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15/
1597
+ * @param {number} testPlanVariableId test_plan_variable id
1598
+ * @param {*} [options] Override http request option.
1599
+ * @throws {RequiredError}
1600
+ */
1601
+ deleteTestPlanVariable(testPlanId, testPlanVariableId, options) {
1602
+ return localVarFp
1603
+ .deleteTestPlanVariable(testPlanId, testPlanVariableId, options)
1604
+ .then((request) => request(axios, basePath));
1605
+ },
1606
+ /**
1607
+ * List the test plan\'s variables
1608
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1609
+ * @param {*} [options] Override http request option.
1610
+ * @throws {RequiredError}
1611
+ */
1612
+ listTestPlanVariable(testPlanId, options) {
1613
+ return localVarFp
1614
+ .listTestPlanVariable(testPlanId, options)
1615
+ .then((request) => request(axios, basePath));
1616
+ },
1617
+ /**
1618
+ * Update a url replacement for the test plan
1619
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1620
+ * @param {number} testPlanVariableId test_plan_variable id
1621
+ * @param {UpdateTestPlanVariableRequest} updateTestPlanVariableRequest The variable\'s new key and/or default_value\'s value to register
1622
+ * @param {*} [options] Override http request option.
1623
+ * @throws {RequiredError}
1624
+ */
1625
+ updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options) {
1626
+ return localVarFp
1627
+ .updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options)
1628
+ .then((request) => request(axios, basePath));
1629
+ },
1630
+ };
1631
+ };
1632
+ exports.TestPlanVariableApiFactory = TestPlanVariableApiFactory;
1633
+ /**
1634
+ * TestPlanVariableApi - object-oriented interface
1635
+ * @export
1636
+ * @class TestPlanVariableApi
1637
+ * @extends {BaseAPI}
1638
+ */
1639
+ class TestPlanVariableApi extends base_1.BaseAPI {
1640
+ /**
1641
+ * Create a new variable for the test plan
1642
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1643
+ * @param {CreateTestPlanVariableRequest} createTestPlanVariableRequest The new variable key and default value to use in the test plan
1644
+ * @param {*} [options] Override http request option.
1645
+ * @throws {RequiredError}
1646
+ * @memberof TestPlanVariableApi
1647
+ */
1648
+ createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options) {
1649
+ return (0, exports.TestPlanVariableApiFp)(this.configuration)
1650
+ .createTestPlanVariable(testPlanId, createTestPlanVariableRequest, options)
1651
+ .then((request) => request(this.axios, this.basePath));
1652
+ }
1653
+ /**
1654
+ * Delete an existing test plan variable for the test plan
1655
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15/
1656
+ * @param {number} testPlanVariableId test_plan_variable id
1657
+ * @param {*} [options] Override http request option.
1658
+ * @throws {RequiredError}
1659
+ * @memberof TestPlanVariableApi
1660
+ */
1661
+ deleteTestPlanVariable(testPlanId, testPlanVariableId, options) {
1662
+ return (0, exports.TestPlanVariableApiFp)(this.configuration)
1663
+ .deleteTestPlanVariable(testPlanId, testPlanVariableId, options)
1664
+ .then((request) => request(this.axios, this.basePath));
1665
+ }
1666
+ /**
1667
+ * List the test plan\'s variables
1668
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1669
+ * @param {*} [options] Override http request option.
1670
+ * @throws {RequiredError}
1671
+ * @memberof TestPlanVariableApi
1672
+ */
1673
+ listTestPlanVariable(testPlanId, options) {
1674
+ return (0, exports.TestPlanVariableApiFp)(this.configuration)
1675
+ .listTestPlanVariable(testPlanId, options)
1676
+ .then((request) => request(this.axios, this.basePath));
1677
+ }
1678
+ /**
1679
+ * Update a url replacement for the test plan
1680
+ * @param {number} testPlanId For example, 15 for the following URL: https://app.autify.com/projects/1/test_plans/15
1681
+ * @param {number} testPlanVariableId test_plan_variable id
1682
+ * @param {UpdateTestPlanVariableRequest} updateTestPlanVariableRequest The variable\'s new key and/or default_value\'s value to register
1683
+ * @param {*} [options] Override http request option.
1684
+ * @throws {RequiredError}
1685
+ * @memberof TestPlanVariableApi
1686
+ */
1687
+ updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options) {
1688
+ return (0, exports.TestPlanVariableApiFp)(this.configuration)
1689
+ .updateTestPlanVariable(testPlanId, testPlanVariableId, updateTestPlanVariableRequest, options)
1690
+ .then((request) => request(this.axios, this.basePath));
1691
+ }
1692
+ }
1693
+ exports.TestPlanVariableApi = TestPlanVariableApi;
1074
1694
  /**
1075
1695
  * UrlReplacementApi - axios parameter creator
1076
1696
  * @export