hostinger-api-sdk 0.0.1 → 0.0.3

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.
package/dist/esm/api.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 0.0.9
6
+ * API Version: 0.0.16
7
7
  *
8
8
  * NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
9
9
  * If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
@@ -56,6 +56,42 @@ export const BillingV1SubscriptionSubscriptionResourceStatusEnum = {
56
56
  InTrial: 'in_trial',
57
57
  Future: 'future'
58
58
  };
59
+ export const DNSV1ZoneDestroyRequestFiltersInnerTypeEnum = {
60
+ A: 'A',
61
+ Aaaa: 'AAAA',
62
+ Cname: 'CNAME',
63
+ Alias: 'ALIAS',
64
+ Mx: 'MX',
65
+ Txt: 'TXT',
66
+ Ns: 'NS',
67
+ Soa: 'SOA',
68
+ Srv: 'SRV',
69
+ Caa: 'CAA'
70
+ };
71
+ export const DNSV1ZoneRecordResourceTypeEnum = {
72
+ A: 'A',
73
+ Aaaa: 'AAAA',
74
+ Cname: 'CNAME',
75
+ Alias: 'ALIAS',
76
+ Mx: 'MX',
77
+ Txt: 'TXT',
78
+ Ns: 'NS',
79
+ Soa: 'SOA',
80
+ Srv: 'SRV',
81
+ Caa: 'CAA'
82
+ };
83
+ export const DNSV1ZoneUpdateRequestZoneInnerTypeEnum = {
84
+ A: 'A',
85
+ Aaaa: 'AAAA',
86
+ Cname: 'CNAME',
87
+ Alias: 'ALIAS',
88
+ Mx: 'MX',
89
+ Txt: 'TXT',
90
+ Ns: 'NS',
91
+ Soa: 'SOA',
92
+ Srv: 'SRV',
93
+ Caa: 'CAA'
94
+ };
59
95
  export const DomainsV1DomainDomainResourceTypeEnum = {
60
96
  Domain: 'domain',
61
97
  FreeDomain: 'free_domain'
@@ -720,6 +756,664 @@ export class BillingSubscriptionsApi extends BaseAPI {
720
756
  return BillingSubscriptionsApiFp(this.configuration).getSubscriptionListV1(options).then((request) => request(this.axios, this.basePath));
721
757
  }
722
758
  }
759
+ /**
760
+ * DNSSnapshotApi - axios parameter creator
761
+ * @export
762
+ */
763
+ export const DNSSnapshotApiAxiosParamCreator = function (configuration) {
764
+ return {
765
+ /**
766
+ * This endpoint retrieves list of DNS snapshots.
767
+ * @summary Get snapshot list
768
+ * @param {string} domain Domain name
769
+ * @param {*} [options] Override http request option.
770
+ * @throws {RequiredError}
771
+ */
772
+ getSnapshotListV1: (domain_1, ...args_1) => __awaiter(this, [domain_1, ...args_1], void 0, function* (domain, options = {}) {
773
+ // verify required parameter 'domain' is not null or undefined
774
+ assertParamExists('getSnapshotListV1', 'domain', domain);
775
+ const localVarPath = `/api/dns/v1/snapshots/{domain}`
776
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
777
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
778
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
779
+ let baseOptions;
780
+ if (configuration) {
781
+ baseOptions = configuration.baseOptions;
782
+ }
783
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
784
+ const localVarHeaderParameter = {};
785
+ const localVarQueryParameter = {};
786
+ // authentication apiToken required
787
+ // http bearer authentication required
788
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
789
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
790
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
791
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
792
+ return {
793
+ url: toPathString(localVarUrlObj),
794
+ options: localVarRequestOptions,
795
+ };
796
+ }),
797
+ /**
798
+ * This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
799
+ * @summary Get snapshot
800
+ * @param {string} domain Domain name
801
+ * @param {number} snapshotId Snapshot ID
802
+ * @param {*} [options] Override http request option.
803
+ * @throws {RequiredError}
804
+ */
805
+ getSnapshotV1: (domain_1, snapshotId_1, ...args_1) => __awaiter(this, [domain_1, snapshotId_1, ...args_1], void 0, function* (domain, snapshotId, options = {}) {
806
+ // verify required parameter 'domain' is not null or undefined
807
+ assertParamExists('getSnapshotV1', 'domain', domain);
808
+ // verify required parameter 'snapshotId' is not null or undefined
809
+ assertParamExists('getSnapshotV1', 'snapshotId', snapshotId);
810
+ const localVarPath = `/api/dns/v1/snapshots/{domain}/{snapshotId}`
811
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)))
812
+ .replace(`{${"snapshotId"}}`, encodeURIComponent(String(snapshotId)));
813
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
814
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
815
+ let baseOptions;
816
+ if (configuration) {
817
+ baseOptions = configuration.baseOptions;
818
+ }
819
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
820
+ const localVarHeaderParameter = {};
821
+ const localVarQueryParameter = {};
822
+ // authentication apiToken required
823
+ // http bearer authentication required
824
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
825
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
826
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
827
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
828
+ return {
829
+ url: toPathString(localVarUrlObj),
830
+ options: localVarRequestOptions,
831
+ };
832
+ }),
833
+ /**
834
+ * This endpoint restores DNS zone to the selected snapshot.
835
+ * @summary Restore snapshot
836
+ * @param {string} domain Domain name
837
+ * @param {number} snapshotId Snapshot ID
838
+ * @param {*} [options] Override http request option.
839
+ * @throws {RequiredError}
840
+ */
841
+ restoreSnapshotV1: (domain_1, snapshotId_1, ...args_1) => __awaiter(this, [domain_1, snapshotId_1, ...args_1], void 0, function* (domain, snapshotId, options = {}) {
842
+ // verify required parameter 'domain' is not null or undefined
843
+ assertParamExists('restoreSnapshotV1', 'domain', domain);
844
+ // verify required parameter 'snapshotId' is not null or undefined
845
+ assertParamExists('restoreSnapshotV1', 'snapshotId', snapshotId);
846
+ const localVarPath = `/api/dns/v1/snapshots/{domain}/{snapshotId}`
847
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)))
848
+ .replace(`{${"snapshotId"}}`, encodeURIComponent(String(snapshotId)));
849
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
850
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
851
+ let baseOptions;
852
+ if (configuration) {
853
+ baseOptions = configuration.baseOptions;
854
+ }
855
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
856
+ const localVarHeaderParameter = {};
857
+ const localVarQueryParameter = {};
858
+ // authentication apiToken required
859
+ // http bearer authentication required
860
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
861
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
862
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
863
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
864
+ return {
865
+ url: toPathString(localVarUrlObj),
866
+ options: localVarRequestOptions,
867
+ };
868
+ }),
869
+ };
870
+ };
871
+ /**
872
+ * DNSSnapshotApi - functional programming interface
873
+ * @export
874
+ */
875
+ export const DNSSnapshotApiFp = function (configuration) {
876
+ const localVarAxiosParamCreator = DNSSnapshotApiAxiosParamCreator(configuration);
877
+ return {
878
+ /**
879
+ * This endpoint retrieves list of DNS snapshots.
880
+ * @summary Get snapshot list
881
+ * @param {string} domain Domain name
882
+ * @param {*} [options] Override http request option.
883
+ * @throws {RequiredError}
884
+ */
885
+ getSnapshotListV1(domain, options) {
886
+ return __awaiter(this, void 0, void 0, function* () {
887
+ var _a, _b;
888
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getSnapshotListV1(domain, options);
889
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSSnapshotApi.getSnapshotListV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
890
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
891
+ });
892
+ },
893
+ /**
894
+ * This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
895
+ * @summary Get snapshot
896
+ * @param {string} domain Domain name
897
+ * @param {number} snapshotId Snapshot ID
898
+ * @param {*} [options] Override http request option.
899
+ * @throws {RequiredError}
900
+ */
901
+ getSnapshotV1(domain, snapshotId, options) {
902
+ return __awaiter(this, void 0, void 0, function* () {
903
+ var _a, _b;
904
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getSnapshotV1(domain, snapshotId, options);
905
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSSnapshotApi.getSnapshotV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
906
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
907
+ });
908
+ },
909
+ /**
910
+ * This endpoint restores DNS zone to the selected snapshot.
911
+ * @summary Restore snapshot
912
+ * @param {string} domain Domain name
913
+ * @param {number} snapshotId Snapshot ID
914
+ * @param {*} [options] Override http request option.
915
+ * @throws {RequiredError}
916
+ */
917
+ restoreSnapshotV1(domain, snapshotId, options) {
918
+ return __awaiter(this, void 0, void 0, function* () {
919
+ var _a, _b;
920
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.restoreSnapshotV1(domain, snapshotId, options);
921
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSSnapshotApi.restoreSnapshotV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
922
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
923
+ });
924
+ },
925
+ };
926
+ };
927
+ /**
928
+ * DNSSnapshotApi - factory interface
929
+ * @export
930
+ */
931
+ export const DNSSnapshotApiFactory = function (configuration, basePath, axios) {
932
+ const localVarFp = DNSSnapshotApiFp(configuration);
933
+ return {
934
+ /**
935
+ * This endpoint retrieves list of DNS snapshots.
936
+ * @summary Get snapshot list
937
+ * @param {string} domain Domain name
938
+ * @param {*} [options] Override http request option.
939
+ * @throws {RequiredError}
940
+ */
941
+ getSnapshotListV1(domain, options) {
942
+ return localVarFp.getSnapshotListV1(domain, options).then((request) => request(axios, basePath));
943
+ },
944
+ /**
945
+ * This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
946
+ * @summary Get snapshot
947
+ * @param {string} domain Domain name
948
+ * @param {number} snapshotId Snapshot ID
949
+ * @param {*} [options] Override http request option.
950
+ * @throws {RequiredError}
951
+ */
952
+ getSnapshotV1(domain, snapshotId, options) {
953
+ return localVarFp.getSnapshotV1(domain, snapshotId, options).then((request) => request(axios, basePath));
954
+ },
955
+ /**
956
+ * This endpoint restores DNS zone to the selected snapshot.
957
+ * @summary Restore snapshot
958
+ * @param {string} domain Domain name
959
+ * @param {number} snapshotId Snapshot ID
960
+ * @param {*} [options] Override http request option.
961
+ * @throws {RequiredError}
962
+ */
963
+ restoreSnapshotV1(domain, snapshotId, options) {
964
+ return localVarFp.restoreSnapshotV1(domain, snapshotId, options).then((request) => request(axios, basePath));
965
+ },
966
+ };
967
+ };
968
+ /**
969
+ * DNSSnapshotApi - object-oriented interface
970
+ * @export
971
+ * @class DNSSnapshotApi
972
+ * @extends {BaseAPI}
973
+ */
974
+ export class DNSSnapshotApi extends BaseAPI {
975
+ /**
976
+ * This endpoint retrieves list of DNS snapshots.
977
+ * @summary Get snapshot list
978
+ * @param {string} domain Domain name
979
+ * @param {*} [options] Override http request option.
980
+ * @throws {RequiredError}
981
+ * @memberof DNSSnapshotApi
982
+ */
983
+ getSnapshotListV1(domain, options) {
984
+ return DNSSnapshotApiFp(this.configuration).getSnapshotListV1(domain, options).then((request) => request(this.axios, this.basePath));
985
+ }
986
+ /**
987
+ * This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
988
+ * @summary Get snapshot
989
+ * @param {string} domain Domain name
990
+ * @param {number} snapshotId Snapshot ID
991
+ * @param {*} [options] Override http request option.
992
+ * @throws {RequiredError}
993
+ * @memberof DNSSnapshotApi
994
+ */
995
+ getSnapshotV1(domain, snapshotId, options) {
996
+ return DNSSnapshotApiFp(this.configuration).getSnapshotV1(domain, snapshotId, options).then((request) => request(this.axios, this.basePath));
997
+ }
998
+ /**
999
+ * This endpoint restores DNS zone to the selected snapshot.
1000
+ * @summary Restore snapshot
1001
+ * @param {string} domain Domain name
1002
+ * @param {number} snapshotId Snapshot ID
1003
+ * @param {*} [options] Override http request option.
1004
+ * @throws {RequiredError}
1005
+ * @memberof DNSSnapshotApi
1006
+ */
1007
+ restoreSnapshotV1(domain, snapshotId, options) {
1008
+ return DNSSnapshotApiFp(this.configuration).restoreSnapshotV1(domain, snapshotId, options).then((request) => request(this.axios, this.basePath));
1009
+ }
1010
+ }
1011
+ /**
1012
+ * DNSZoneApi - axios parameter creator
1013
+ * @export
1014
+ */
1015
+ export const DNSZoneApiAxiosParamCreator = function (configuration) {
1016
+ return {
1017
+ /**
1018
+ * This endpoint deletes selected DNS records for the selected domain.
1019
+ * @summary Delete zone records
1020
+ * @param {string} domain Domain name
1021
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
1022
+ * @param {*} [options] Override http request option.
1023
+ * @throws {RequiredError}
1024
+ */
1025
+ deleteZoneRecordsV1: (domain_1, dNSV1ZoneDestroyRequest_1, ...args_1) => __awaiter(this, [domain_1, dNSV1ZoneDestroyRequest_1, ...args_1], void 0, function* (domain, dNSV1ZoneDestroyRequest, options = {}) {
1026
+ // verify required parameter 'domain' is not null or undefined
1027
+ assertParamExists('deleteZoneRecordsV1', 'domain', domain);
1028
+ // verify required parameter 'dNSV1ZoneDestroyRequest' is not null or undefined
1029
+ assertParamExists('deleteZoneRecordsV1', 'dNSV1ZoneDestroyRequest', dNSV1ZoneDestroyRequest);
1030
+ const localVarPath = `/api/dns/v1/zones/{domain}`
1031
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
1032
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1033
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1034
+ let baseOptions;
1035
+ if (configuration) {
1036
+ baseOptions = configuration.baseOptions;
1037
+ }
1038
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
1039
+ const localVarHeaderParameter = {};
1040
+ const localVarQueryParameter = {};
1041
+ // authentication apiToken required
1042
+ // http bearer authentication required
1043
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
1044
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1045
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1046
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1047
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1048
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneDestroyRequest, localVarRequestOptions, configuration);
1049
+ return {
1050
+ url: toPathString(localVarUrlObj),
1051
+ options: localVarRequestOptions,
1052
+ };
1053
+ }),
1054
+ /**
1055
+ * This endpoint retrieves DNS zone records for a specific domain.
1056
+ * @summary Get records
1057
+ * @param {string} domain Domain name
1058
+ * @param {*} [options] Override http request option.
1059
+ * @throws {RequiredError}
1060
+ */
1061
+ getRecordsV1: (domain_1, ...args_1) => __awaiter(this, [domain_1, ...args_1], void 0, function* (domain, options = {}) {
1062
+ // verify required parameter 'domain' is not null or undefined
1063
+ assertParamExists('getRecordsV1', 'domain', domain);
1064
+ const localVarPath = `/api/dns/v1/zones/{domain}`
1065
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
1066
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1067
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1068
+ let baseOptions;
1069
+ if (configuration) {
1070
+ baseOptions = configuration.baseOptions;
1071
+ }
1072
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1073
+ const localVarHeaderParameter = {};
1074
+ const localVarQueryParameter = {};
1075
+ // authentication apiToken required
1076
+ // http bearer authentication required
1077
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
1078
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1079
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1080
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1081
+ return {
1082
+ url: toPathString(localVarUrlObj),
1083
+ options: localVarRequestOptions,
1084
+ };
1085
+ }),
1086
+ /**
1087
+ * This endpoint resets DNS zone to the default records.
1088
+ * @summary Reset zone records
1089
+ * @param {string} domain Domain name
1090
+ * @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
1091
+ * @param {*} [options] Override http request option.
1092
+ * @throws {RequiredError}
1093
+ */
1094
+ resetZoneRecordsV1: (domain_1, dNSV1ZoneResetRequest_1, ...args_1) => __awaiter(this, [domain_1, dNSV1ZoneResetRequest_1, ...args_1], void 0, function* (domain, dNSV1ZoneResetRequest, options = {}) {
1095
+ // verify required parameter 'domain' is not null or undefined
1096
+ assertParamExists('resetZoneRecordsV1', 'domain', domain);
1097
+ // verify required parameter 'dNSV1ZoneResetRequest' is not null or undefined
1098
+ assertParamExists('resetZoneRecordsV1', 'dNSV1ZoneResetRequest', dNSV1ZoneResetRequest);
1099
+ const localVarPath = `/api/dns/v1/zones/{domain}/reset`
1100
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
1101
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1102
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1103
+ let baseOptions;
1104
+ if (configuration) {
1105
+ baseOptions = configuration.baseOptions;
1106
+ }
1107
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1108
+ const localVarHeaderParameter = {};
1109
+ const localVarQueryParameter = {};
1110
+ // authentication apiToken required
1111
+ // http bearer authentication required
1112
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
1113
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1114
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1115
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1116
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1117
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneResetRequest, localVarRequestOptions, configuration);
1118
+ return {
1119
+ url: toPathString(localVarUrlObj),
1120
+ options: localVarRequestOptions,
1121
+ };
1122
+ }),
1123
+ /**
1124
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
1125
+ * @summary Update zone records
1126
+ * @param {string} domain Domain name
1127
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1128
+ * @param {*} [options] Override http request option.
1129
+ * @throws {RequiredError}
1130
+ */
1131
+ updateZoneRecordsV1: (domain_1, dNSV1ZoneUpdateRequest_1, ...args_1) => __awaiter(this, [domain_1, dNSV1ZoneUpdateRequest_1, ...args_1], void 0, function* (domain, dNSV1ZoneUpdateRequest, options = {}) {
1132
+ // verify required parameter 'domain' is not null or undefined
1133
+ assertParamExists('updateZoneRecordsV1', 'domain', domain);
1134
+ // verify required parameter 'dNSV1ZoneUpdateRequest' is not null or undefined
1135
+ assertParamExists('updateZoneRecordsV1', 'dNSV1ZoneUpdateRequest', dNSV1ZoneUpdateRequest);
1136
+ const localVarPath = `/api/dns/v1/zones/{domain}`
1137
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
1138
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1139
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1140
+ let baseOptions;
1141
+ if (configuration) {
1142
+ baseOptions = configuration.baseOptions;
1143
+ }
1144
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
1145
+ const localVarHeaderParameter = {};
1146
+ const localVarQueryParameter = {};
1147
+ // authentication apiToken required
1148
+ // http bearer authentication required
1149
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
1150
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1151
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1152
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1153
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1154
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneUpdateRequest, localVarRequestOptions, configuration);
1155
+ return {
1156
+ url: toPathString(localVarUrlObj),
1157
+ options: localVarRequestOptions,
1158
+ };
1159
+ }),
1160
+ /**
1161
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
1162
+ * @summary Validate zone records
1163
+ * @param {string} domain Domain name
1164
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1165
+ * @param {*} [options] Override http request option.
1166
+ * @throws {RequiredError}
1167
+ */
1168
+ validateZoneRecordsV1: (domain_1, dNSV1ZoneUpdateRequest_1, ...args_1) => __awaiter(this, [domain_1, dNSV1ZoneUpdateRequest_1, ...args_1], void 0, function* (domain, dNSV1ZoneUpdateRequest, options = {}) {
1169
+ // verify required parameter 'domain' is not null or undefined
1170
+ assertParamExists('validateZoneRecordsV1', 'domain', domain);
1171
+ // verify required parameter 'dNSV1ZoneUpdateRequest' is not null or undefined
1172
+ assertParamExists('validateZoneRecordsV1', 'dNSV1ZoneUpdateRequest', dNSV1ZoneUpdateRequest);
1173
+ const localVarPath = `/api/dns/v1/zones/{domain}/validate`
1174
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
1175
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1176
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
1177
+ let baseOptions;
1178
+ if (configuration) {
1179
+ baseOptions = configuration.baseOptions;
1180
+ }
1181
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1182
+ const localVarHeaderParameter = {};
1183
+ const localVarQueryParameter = {};
1184
+ // authentication apiToken required
1185
+ // http bearer authentication required
1186
+ yield setBearerAuthToObject(localVarHeaderParameter, configuration);
1187
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1188
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1189
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1190
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1191
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneUpdateRequest, localVarRequestOptions, configuration);
1192
+ return {
1193
+ url: toPathString(localVarUrlObj),
1194
+ options: localVarRequestOptions,
1195
+ };
1196
+ }),
1197
+ };
1198
+ };
1199
+ /**
1200
+ * DNSZoneApi - functional programming interface
1201
+ * @export
1202
+ */
1203
+ export const DNSZoneApiFp = function (configuration) {
1204
+ const localVarAxiosParamCreator = DNSZoneApiAxiosParamCreator(configuration);
1205
+ return {
1206
+ /**
1207
+ * This endpoint deletes selected DNS records for the selected domain.
1208
+ * @summary Delete zone records
1209
+ * @param {string} domain Domain name
1210
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
1211
+ * @param {*} [options] Override http request option.
1212
+ * @throws {RequiredError}
1213
+ */
1214
+ deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options) {
1215
+ return __awaiter(this, void 0, void 0, function* () {
1216
+ var _a, _b;
1217
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options);
1218
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSZoneApi.deleteZoneRecordsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
1219
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1220
+ });
1221
+ },
1222
+ /**
1223
+ * This endpoint retrieves DNS zone records for a specific domain.
1224
+ * @summary Get records
1225
+ * @param {string} domain Domain name
1226
+ * @param {*} [options] Override http request option.
1227
+ * @throws {RequiredError}
1228
+ */
1229
+ getRecordsV1(domain, options) {
1230
+ return __awaiter(this, void 0, void 0, function* () {
1231
+ var _a, _b;
1232
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getRecordsV1(domain, options);
1233
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSZoneApi.getRecordsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
1234
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1235
+ });
1236
+ },
1237
+ /**
1238
+ * This endpoint resets DNS zone to the default records.
1239
+ * @summary Reset zone records
1240
+ * @param {string} domain Domain name
1241
+ * @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
1242
+ * @param {*} [options] Override http request option.
1243
+ * @throws {RequiredError}
1244
+ */
1245
+ resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options) {
1246
+ return __awaiter(this, void 0, void 0, function* () {
1247
+ var _a, _b;
1248
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options);
1249
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSZoneApi.resetZoneRecordsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
1250
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1251
+ });
1252
+ },
1253
+ /**
1254
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
1255
+ * @summary Update zone records
1256
+ * @param {string} domain Domain name
1257
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1258
+ * @param {*} [options] Override http request option.
1259
+ * @throws {RequiredError}
1260
+ */
1261
+ updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1262
+ return __awaiter(this, void 0, void 0, function* () {
1263
+ var _a, _b;
1264
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options);
1265
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSZoneApi.updateZoneRecordsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
1266
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1267
+ });
1268
+ },
1269
+ /**
1270
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
1271
+ * @summary Validate zone records
1272
+ * @param {string} domain Domain name
1273
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1274
+ * @param {*} [options] Override http request option.
1275
+ * @throws {RequiredError}
1276
+ */
1277
+ validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1278
+ return __awaiter(this, void 0, void 0, function* () {
1279
+ var _a, _b;
1280
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options);
1281
+ const localVarOperationServerBasePath = (_b = (_a = operationServerMap['DNSZoneApi.validateZoneRecordsV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
1282
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1283
+ });
1284
+ },
1285
+ };
1286
+ };
1287
+ /**
1288
+ * DNSZoneApi - factory interface
1289
+ * @export
1290
+ */
1291
+ export const DNSZoneApiFactory = function (configuration, basePath, axios) {
1292
+ const localVarFp = DNSZoneApiFp(configuration);
1293
+ return {
1294
+ /**
1295
+ * This endpoint deletes selected DNS records for the selected domain.
1296
+ * @summary Delete zone records
1297
+ * @param {string} domain Domain name
1298
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
1299
+ * @param {*} [options] Override http request option.
1300
+ * @throws {RequiredError}
1301
+ */
1302
+ deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options) {
1303
+ return localVarFp.deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options).then((request) => request(axios, basePath));
1304
+ },
1305
+ /**
1306
+ * This endpoint retrieves DNS zone records for a specific domain.
1307
+ * @summary Get records
1308
+ * @param {string} domain Domain name
1309
+ * @param {*} [options] Override http request option.
1310
+ * @throws {RequiredError}
1311
+ */
1312
+ getRecordsV1(domain, options) {
1313
+ return localVarFp.getRecordsV1(domain, options).then((request) => request(axios, basePath));
1314
+ },
1315
+ /**
1316
+ * This endpoint resets DNS zone to the default records.
1317
+ * @summary Reset zone records
1318
+ * @param {string} domain Domain name
1319
+ * @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
1320
+ * @param {*} [options] Override http request option.
1321
+ * @throws {RequiredError}
1322
+ */
1323
+ resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options) {
1324
+ return localVarFp.resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(axios, basePath));
1325
+ },
1326
+ /**
1327
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
1328
+ * @summary Update zone records
1329
+ * @param {string} domain Domain name
1330
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1331
+ * @param {*} [options] Override http request option.
1332
+ * @throws {RequiredError}
1333
+ */
1334
+ updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1335
+ return localVarFp.updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(axios, basePath));
1336
+ },
1337
+ /**
1338
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
1339
+ * @summary Validate zone records
1340
+ * @param {string} domain Domain name
1341
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1342
+ * @param {*} [options] Override http request option.
1343
+ * @throws {RequiredError}
1344
+ */
1345
+ validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1346
+ return localVarFp.validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(axios, basePath));
1347
+ },
1348
+ };
1349
+ };
1350
+ /**
1351
+ * DNSZoneApi - object-oriented interface
1352
+ * @export
1353
+ * @class DNSZoneApi
1354
+ * @extends {BaseAPI}
1355
+ */
1356
+ export class DNSZoneApi extends BaseAPI {
1357
+ /**
1358
+ * This endpoint deletes selected DNS records for the selected domain.
1359
+ * @summary Delete zone records
1360
+ * @param {string} domain Domain name
1361
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
1362
+ * @param {*} [options] Override http request option.
1363
+ * @throws {RequiredError}
1364
+ * @memberof DNSZoneApi
1365
+ */
1366
+ deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options) {
1367
+ return DNSZoneApiFp(this.configuration).deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options).then((request) => request(this.axios, this.basePath));
1368
+ }
1369
+ /**
1370
+ * This endpoint retrieves DNS zone records for a specific domain.
1371
+ * @summary Get records
1372
+ * @param {string} domain Domain name
1373
+ * @param {*} [options] Override http request option.
1374
+ * @throws {RequiredError}
1375
+ * @memberof DNSZoneApi
1376
+ */
1377
+ getRecordsV1(domain, options) {
1378
+ return DNSZoneApiFp(this.configuration).getRecordsV1(domain, options).then((request) => request(this.axios, this.basePath));
1379
+ }
1380
+ /**
1381
+ * This endpoint resets DNS zone to the default records.
1382
+ * @summary Reset zone records
1383
+ * @param {string} domain Domain name
1384
+ * @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
1385
+ * @param {*} [options] Override http request option.
1386
+ * @throws {RequiredError}
1387
+ * @memberof DNSZoneApi
1388
+ */
1389
+ resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options) {
1390
+ return DNSZoneApiFp(this.configuration).resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(this.axios, this.basePath));
1391
+ }
1392
+ /**
1393
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
1394
+ * @summary Update zone records
1395
+ * @param {string} domain Domain name
1396
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1397
+ * @param {*} [options] Override http request option.
1398
+ * @throws {RequiredError}
1399
+ * @memberof DNSZoneApi
1400
+ */
1401
+ updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1402
+ return DNSZoneApiFp(this.configuration).updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(this.axios, this.basePath));
1403
+ }
1404
+ /**
1405
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
1406
+ * @summary Validate zone records
1407
+ * @param {string} domain Domain name
1408
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
1409
+ * @param {*} [options] Override http request option.
1410
+ * @throws {RequiredError}
1411
+ * @memberof DNSZoneApi
1412
+ */
1413
+ validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options) {
1414
+ return DNSZoneApiFp(this.configuration).validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(this.axios, this.basePath));
1415
+ }
1416
+ }
723
1417
  /**
724
1418
  * DomainsPortfolioApi - axios parameter creator
725
1419
  * @export