@aurigma/axios-design-atoms-api-client 2.62.6 → 2.64.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.
@@ -439,9 +439,7 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
439
439
  if (tenantId === undefined || tenantId === null)
440
440
  throw new Error("The parameter 'tenantId' must be defined.");
441
441
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
442
- if (fontKey === null)
443
- throw new Error("The parameter 'fontKey' cannot be null.");
444
- else if (fontKey !== undefined)
442
+ if (fontKey !== undefined && fontKey !== null)
445
443
  url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
446
444
  url_ = url_.replace(/[?&]$/, "");
447
445
  let options_ = {
@@ -785,77 +783,41 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
785
783
  if (tenantId === undefined || tenantId === null)
786
784
  throw new Error("The parameter 'tenantId' must be defined.");
787
785
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
788
- if (f === null)
789
- throw new Error("The parameter 'f' cannot be null.");
790
- else if (f !== undefined)
786
+ if (f !== undefined && f !== null)
791
787
  url_ += "f=" + encodeURIComponent("" + f) + "&";
792
- if (w === null)
793
- throw new Error("The parameter 'w' cannot be null.");
794
- else if (w !== undefined)
788
+ if (w !== undefined && w !== null)
795
789
  url_ += "w=" + encodeURIComponent("" + w) + "&";
796
- if (h === null)
797
- throw new Error("The parameter 'h' cannot be null.");
798
- else if (h !== undefined)
790
+ if (h !== undefined && h !== null)
799
791
  url_ += "h=" + encodeURIComponent("" + h) + "&";
800
- if (cmyk === null)
801
- throw new Error("The parameter 'cmyk' cannot be null.");
802
- else if (cmyk !== undefined)
792
+ if (cmyk !== undefined && cmyk !== null)
803
793
  url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
804
- if (rgb === null)
805
- throw new Error("The parameter 'rgb' cannot be null.");
806
- else if (rgb !== undefined)
794
+ if (rgb !== undefined && rgb !== null)
807
795
  url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
808
- if (grayscale === null)
809
- throw new Error("The parameter 'grayscale' cannot be null.");
810
- else if (grayscale !== undefined)
796
+ if (grayscale !== undefined && grayscale !== null)
811
797
  url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
812
- if (target === null)
813
- throw new Error("The parameter 'target' cannot be null.");
814
- else if (target !== undefined)
798
+ if (target !== undefined && target !== null)
815
799
  url_ += "target=" + encodeURIComponent("" + target) + "&";
816
- if (sq === null)
817
- throw new Error("The parameter 'sq' cannot be null.");
818
- else if (sq !== undefined)
800
+ if (sq !== undefined && sq !== null)
819
801
  url_ += "sq=" + encodeURIComponent("" + sq) + "&";
820
- if (effect === null)
821
- throw new Error("The parameter 'effect' cannot be null.");
822
- else if (effect !== undefined)
802
+ if (effect !== undefined && effect !== null)
823
803
  url_ += "effect=" + encodeURIComponent("" + effect) + "&";
824
- if (kp === null)
825
- throw new Error("The parameter 'kp' cannot be null.");
826
- else if (kp !== undefined)
804
+ if (kp !== undefined && kp !== null)
827
805
  url_ += "kp=" + encodeURIComponent("" + kp) + "&";
828
- if (color === null)
829
- throw new Error("The parameter 'color' cannot be null.");
830
- else if (color !== undefined)
806
+ if (color !== undefined && color !== null)
831
807
  url_ += "color=" + encodeURIComponent("" + color) + "&";
832
- if (obm === null)
833
- throw new Error("The parameter 'obm' cannot be null.");
834
- else if (obm !== undefined)
808
+ if (obm !== undefined && obm !== null)
835
809
  url_ += "obm=" + encodeURIComponent("" + obm) + "&";
836
- if (oo === null)
837
- throw new Error("The parameter 'oo' cannot be null.");
838
- else if (oo !== undefined)
810
+ if (oo !== undefined && oo !== null)
839
811
  url_ += "oo=" + encodeURIComponent("" + oo) + "&";
840
- if (alphaMask === null)
841
- throw new Error("The parameter 'alphaMask' cannot be null.");
842
- else if (alphaMask !== undefined)
812
+ if (alphaMask !== undefined && alphaMask !== null)
843
813
  url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
844
- if (page === null)
845
- throw new Error("The parameter 'page' cannot be null.");
846
- else if (page !== undefined)
814
+ if (page !== undefined && page !== null)
847
815
  url_ += "page=" + encodeURIComponent("" + page) + "&";
848
- if (colorizeColor === null)
849
- throw new Error("The parameter 'colorizeColor' cannot be null.");
850
- else if (colorizeColor !== undefined)
816
+ if (colorizeColor !== undefined && colorizeColor !== null)
851
817
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
852
- if (rw === null)
853
- throw new Error("The parameter 'rw' cannot be null.");
854
- else if (rw !== undefined)
818
+ if (rw !== undefined && rw !== null)
855
819
  url_ += "rw=" + encodeURIComponent("" + rw) + "&";
856
- if (rh === null)
857
- throw new Error("The parameter 'rh' cannot be null.");
858
- else if (rh !== undefined)
820
+ if (rh !== undefined && rh !== null)
859
821
  url_ += "rh=" + encodeURIComponent("" + rh) + "&";
860
822
  url_ = url_.replace(/[?&]$/, "");
861
823
  let options_ = {
@@ -991,9 +953,7 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
991
953
  if (tenantId === undefined || tenantId === null)
992
954
  throw new Error("The parameter 'tenantId' must be defined.");
993
955
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
994
- if (f === null)
995
- throw new Error("The parameter 'f' cannot be null.");
996
- else if (f !== undefined)
956
+ if (f !== undefined && f !== null)
997
957
  url_ += "f=" + encodeURIComponent("" + f) + "&";
998
958
  url_ = url_.replace(/[?&]$/, "");
999
959
  let options_ = {
@@ -1068,9 +1028,7 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
1068
1028
  if (tenantId === undefined || tenantId === null)
1069
1029
  throw new Error("The parameter 'tenantId' must be defined.");
1070
1030
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
1071
- if (image === null)
1072
- throw new Error("The parameter 'image' cannot be null.");
1073
- else if (image !== undefined)
1031
+ if (image !== undefined && image !== null)
1074
1032
  url_ += "image=" + encodeURIComponent("" + image) + "&";
1075
1033
  url_ = url_.replace(/[?&]$/, "");
1076
1034
  let options_ = {
@@ -1158,77 +1116,41 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
1158
1116
  if (tenantId === undefined || tenantId === null)
1159
1117
  throw new Error("The parameter 'tenantId' must be defined.");
1160
1118
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
1161
- if (f === null)
1162
- throw new Error("The parameter 'f' cannot be null.");
1163
- else if (f !== undefined)
1119
+ if (f !== undefined && f !== null)
1164
1120
  url_ += "f=" + encodeURIComponent("" + f) + "&";
1165
- if (w === null)
1166
- throw new Error("The parameter 'w' cannot be null.");
1167
- else if (w !== undefined)
1121
+ if (w !== undefined && w !== null)
1168
1122
  url_ += "w=" + encodeURIComponent("" + w) + "&";
1169
- if (h === null)
1170
- throw new Error("The parameter 'h' cannot be null.");
1171
- else if (h !== undefined)
1123
+ if (h !== undefined && h !== null)
1172
1124
  url_ += "h=" + encodeURIComponent("" + h) + "&";
1173
- if (cmyk === null)
1174
- throw new Error("The parameter 'cmyk' cannot be null.");
1175
- else if (cmyk !== undefined)
1125
+ if (cmyk !== undefined && cmyk !== null)
1176
1126
  url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
1177
- if (rgb === null)
1178
- throw new Error("The parameter 'rgb' cannot be null.");
1179
- else if (rgb !== undefined)
1127
+ if (rgb !== undefined && rgb !== null)
1180
1128
  url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
1181
- if (grayscale === null)
1182
- throw new Error("The parameter 'grayscale' cannot be null.");
1183
- else if (grayscale !== undefined)
1129
+ if (grayscale !== undefined && grayscale !== null)
1184
1130
  url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
1185
- if (target === null)
1186
- throw new Error("The parameter 'target' cannot be null.");
1187
- else if (target !== undefined)
1131
+ if (target !== undefined && target !== null)
1188
1132
  url_ += "target=" + encodeURIComponent("" + target) + "&";
1189
- if (sq === null)
1190
- throw new Error("The parameter 'sq' cannot be null.");
1191
- else if (sq !== undefined)
1133
+ if (sq !== undefined && sq !== null)
1192
1134
  url_ += "sq=" + encodeURIComponent("" + sq) + "&";
1193
- if (effect === null)
1194
- throw new Error("The parameter 'effect' cannot be null.");
1195
- else if (effect !== undefined)
1135
+ if (effect !== undefined && effect !== null)
1196
1136
  url_ += "effect=" + encodeURIComponent("" + effect) + "&";
1197
- if (kp === null)
1198
- throw new Error("The parameter 'kp' cannot be null.");
1199
- else if (kp !== undefined)
1137
+ if (kp !== undefined && kp !== null)
1200
1138
  url_ += "kp=" + encodeURIComponent("" + kp) + "&";
1201
- if (color === null)
1202
- throw new Error("The parameter 'color' cannot be null.");
1203
- else if (color !== undefined)
1139
+ if (color !== undefined && color !== null)
1204
1140
  url_ += "color=" + encodeURIComponent("" + color) + "&";
1205
- if (obm === null)
1206
- throw new Error("The parameter 'obm' cannot be null.");
1207
- else if (obm !== undefined)
1141
+ if (obm !== undefined && obm !== null)
1208
1142
  url_ += "obm=" + encodeURIComponent("" + obm) + "&";
1209
- if (oo === null)
1210
- throw new Error("The parameter 'oo' cannot be null.");
1211
- else if (oo !== undefined)
1143
+ if (oo !== undefined && oo !== null)
1212
1144
  url_ += "oo=" + encodeURIComponent("" + oo) + "&";
1213
- if (alphaMask === null)
1214
- throw new Error("The parameter 'alphaMask' cannot be null.");
1215
- else if (alphaMask !== undefined)
1145
+ if (alphaMask !== undefined && alphaMask !== null)
1216
1146
  url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
1217
- if (page === null)
1218
- throw new Error("The parameter 'page' cannot be null.");
1219
- else if (page !== undefined)
1147
+ if (page !== undefined && page !== null)
1220
1148
  url_ += "page=" + encodeURIComponent("" + page) + "&";
1221
- if (colorizeColor === null)
1222
- throw new Error("The parameter 'colorizeColor' cannot be null.");
1223
- else if (colorizeColor !== undefined)
1149
+ if (colorizeColor !== undefined && colorizeColor !== null)
1224
1150
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
1225
- if (rw === null)
1226
- throw new Error("The parameter 'rw' cannot be null.");
1227
- else if (rw !== undefined)
1151
+ if (rw !== undefined && rw !== null)
1228
1152
  url_ += "rw=" + encodeURIComponent("" + rw) + "&";
1229
- if (rh === null)
1230
- throw new Error("The parameter 'rh' cannot be null.");
1231
- else if (rh !== undefined)
1153
+ if (rh !== undefined && rh !== null)
1232
1154
  url_ += "rh=" + encodeURIComponent("" + rh) + "&";
1233
1155
  url_ = url_.replace(/[?&]$/, "");
1234
1156
  let options_ = {
@@ -1303,9 +1225,7 @@ export class DesignAtomsCompatibilityApiClient extends ApiClientBase {
1303
1225
  if (tenantId === undefined || tenantId === null)
1304
1226
  throw new Error("The parameter 'tenantId' must be defined.");
1305
1227
  url_ = url_.replace("{tenantId}", encodeURIComponent("" + tenantId));
1306
- if (f === null)
1307
- throw new Error("The parameter 'f' cannot be null.");
1308
- else if (f !== undefined)
1228
+ if (f !== undefined && f !== null)
1309
1229
  url_ += "f=" + encodeURIComponent("" + f) + "&";
1310
1230
  url_ = url_.replace(/[?&]$/, "");
1311
1231
  let options_ = {
@@ -2097,7 +2017,7 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2097
2017
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2098
2018
  }
2099
2019
  /**
2100
- * Renders a web image preview with the specified parameters.
2020
+ * Renders a preview of an image with the specified parameters.
2101
2021
  * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2102
2022
  (default value is 'false').
2103
2023
  * @param tenantId (optional) Tenant identifier
@@ -2106,9 +2026,7 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2106
2026
  */
2107
2027
  renderImagePreview(attachment, tenantId, body, cancelToken) {
2108
2028
  let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview?";
2109
- if (attachment === null)
2110
- throw new Error("The parameter 'attachment' cannot be null.");
2111
- else if (attachment !== undefined)
2029
+ if (attachment !== undefined && attachment !== null)
2112
2030
  url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2113
2031
  if (tenantId === null)
2114
2032
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -2171,13 +2089,295 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2171
2089
  return Promise.resolve(null);
2172
2090
  }
2173
2091
  /**
2174
- * Renders a web image preview with the specified parameters and saves rendering result as resource.
2092
+ * Renders a preview of an uploaded image with the specified parameters.
2093
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2094
+ (default value is 'false').
2095
+ * @param tenantId (optional) Tenant identifier
2096
+ * @param sourceFile (optional)
2097
+ * @param mockupOwnerId (optional)
2098
+ * @param mockupId (optional)
2099
+ * @param width (optional)
2100
+ * @param height (optional)
2101
+ * @param fileFormat (optional)
2102
+ * @param fitMode (optional)
2103
+ * @return Success
2104
+ */
2105
+ renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
2106
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
2107
+ if (attachment !== undefined && attachment !== null)
2108
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2109
+ if (tenantId === null)
2110
+ throw new Error("The parameter 'tenantId' cannot be null.");
2111
+ else if (tenantId !== undefined)
2112
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2113
+ url_ = url_.replace(/[?&]$/, "");
2114
+ const content_ = new FormData();
2115
+ if (sourceFile !== null && sourceFile !== undefined)
2116
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
2117
+ if (mockupOwnerId !== null && mockupOwnerId !== undefined)
2118
+ content_.append("mockupOwnerId", mockupOwnerId.toString());
2119
+ if (mockupId !== null && mockupId !== undefined)
2120
+ content_.append("mockupId", mockupId.toString());
2121
+ if (width !== null && width !== undefined)
2122
+ content_.append("width", width.toString());
2123
+ if (height !== null && height !== undefined)
2124
+ content_.append("height", height.toString());
2125
+ if (fileFormat !== null && fileFormat !== undefined)
2126
+ content_.append("fileFormat", fileFormat.toString());
2127
+ if (fitMode !== null && fitMode !== undefined)
2128
+ content_.append("fitMode", fitMode.toString());
2129
+ let options_ = {
2130
+ data: content_,
2131
+ responseType: "blob",
2132
+ method: "POST",
2133
+ url: url_,
2134
+ headers: {
2135
+ "Accept": "application/octet-stream"
2136
+ },
2137
+ cancelToken
2138
+ };
2139
+ return this.transformOptions(options_).then(transformedOptions_ => {
2140
+ return this.instance.request(transformedOptions_);
2141
+ }).catch((_error) => {
2142
+ if (isAxiosError(_error) && _error.response) {
2143
+ return _error.response;
2144
+ }
2145
+ else {
2146
+ throw _error;
2147
+ }
2148
+ }).then((_response) => {
2149
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFile(_response));
2150
+ });
2151
+ }
2152
+ processRenderImagePreviewFromFile(response) {
2153
+ const status = response.status;
2154
+ let _headers = {};
2155
+ if (response.headers && typeof response.headers === "object") {
2156
+ for (let k in response.headers) {
2157
+ if (response.headers.hasOwnProperty(k)) {
2158
+ _headers[k] = response.headers[k];
2159
+ }
2160
+ }
2161
+ }
2162
+ if (status === 200 || status === 206) {
2163
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2164
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2165
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2166
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2167
+ }
2168
+ else if (status === 401) {
2169
+ const _responseText = response.data;
2170
+ return throwException("Unauthorized", status, _responseText, _headers);
2171
+ }
2172
+ else if (status === 403) {
2173
+ const _responseText = response.data;
2174
+ return throwException("Forbidden", status, _responseText, _headers);
2175
+ }
2176
+ else if (status !== 200 && status !== 204) {
2177
+ const _responseText = response.data;
2178
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2179
+ }
2180
+ return Promise.resolve(null);
2181
+ }
2182
+ /**
2183
+ * Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
2184
+ * @param tenantId (optional) Tenant identifier
2185
+ * @param resourceOwnerId (optional)
2186
+ * @param resourceNamespace (optional)
2187
+ * @param resourceName (optional)
2188
+ * @param resourceSourceId (optional)
2189
+ * @param resourceType (optional)
2190
+ * @param anonymousAccess (optional)
2191
+ * @param overwriteExistingResource (optional)
2192
+ * @param sourceFile (optional)
2193
+ * @param mockupOwnerId (optional)
2194
+ * @param mockupId (optional)
2195
+ * @param width (optional)
2196
+ * @param height (optional)
2197
+ * @param fileFormat (optional)
2198
+ * @param fitMode (optional)
2199
+ * @return Success
2200
+ */
2201
+ renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
2202
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/to-resource?";
2203
+ if (tenantId === null)
2204
+ throw new Error("The parameter 'tenantId' cannot be null.");
2205
+ else if (tenantId !== undefined)
2206
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2207
+ url_ = url_.replace(/[?&]$/, "");
2208
+ const content_ = new FormData();
2209
+ if (resourceOwnerId !== null && resourceOwnerId !== undefined)
2210
+ content_.append("resourceOwnerId", resourceOwnerId.toString());
2211
+ if (resourceNamespace !== null && resourceNamespace !== undefined)
2212
+ content_.append("resourceNamespace", resourceNamespace.toString());
2213
+ if (resourceName !== null && resourceName !== undefined)
2214
+ content_.append("resourceName", resourceName.toString());
2215
+ if (resourceSourceId !== null && resourceSourceId !== undefined)
2216
+ content_.append("resourceSourceId", resourceSourceId.toString());
2217
+ if (resourceType !== null && resourceType !== undefined)
2218
+ content_.append("resourceType", resourceType.toString());
2219
+ if (anonymousAccess === null || anonymousAccess === undefined)
2220
+ throw new Error("The parameter 'anonymousAccess' cannot be null.");
2221
+ else
2222
+ content_.append("anonymousAccess", anonymousAccess.toString());
2223
+ if (overwriteExistingResource === null || overwriteExistingResource === undefined)
2224
+ throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
2225
+ else
2226
+ content_.append("overwriteExistingResource", overwriteExistingResource.toString());
2227
+ if (sourceFile !== null && sourceFile !== undefined)
2228
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
2229
+ if (mockupOwnerId !== null && mockupOwnerId !== undefined)
2230
+ content_.append("mockupOwnerId", mockupOwnerId.toString());
2231
+ if (mockupId !== null && mockupId !== undefined)
2232
+ content_.append("mockupId", mockupId.toString());
2233
+ if (width !== null && width !== undefined)
2234
+ content_.append("width", width.toString());
2235
+ if (height !== null && height !== undefined)
2236
+ content_.append("height", height.toString());
2237
+ if (fileFormat !== null && fileFormat !== undefined)
2238
+ content_.append("fileFormat", fileFormat.toString());
2239
+ if (fitMode !== null && fitMode !== undefined)
2240
+ content_.append("fitMode", fitMode.toString());
2241
+ let options_ = {
2242
+ data: content_,
2243
+ method: "POST",
2244
+ url: url_,
2245
+ headers: {
2246
+ "Accept": "application/json"
2247
+ },
2248
+ cancelToken
2249
+ };
2250
+ return this.transformOptions(options_).then(transformedOptions_ => {
2251
+ return this.instance.request(transformedOptions_);
2252
+ }).catch((_error) => {
2253
+ if (isAxiosError(_error) && _error.response) {
2254
+ return _error.response;
2255
+ }
2256
+ else {
2257
+ throw _error;
2258
+ }
2259
+ }).then((_response) => {
2260
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFileToResource(_response));
2261
+ });
2262
+ }
2263
+ processRenderImagePreviewFromFileToResource(response) {
2264
+ const status = response.status;
2265
+ let _headers = {};
2266
+ if (response.headers && typeof response.headers === "object") {
2267
+ for (let k in response.headers) {
2268
+ if (response.headers.hasOwnProperty(k)) {
2269
+ _headers[k] = response.headers[k];
2270
+ }
2271
+ }
2272
+ }
2273
+ if (status === 200) {
2274
+ const _responseText = response.data;
2275
+ let result200 = null;
2276
+ let resultData200 = _responseText;
2277
+ result200 = JSON.parse(resultData200);
2278
+ return Promise.resolve(result200);
2279
+ }
2280
+ else if (status === 409) {
2281
+ const _responseText = response.data;
2282
+ let result409 = null;
2283
+ let resultData409 = _responseText;
2284
+ result409 = JSON.parse(resultData409);
2285
+ return throwException("Conflict", status, _responseText, _headers, result409);
2286
+ }
2287
+ else if (status === 401) {
2288
+ const _responseText = response.data;
2289
+ return throwException("Unauthorized", status, _responseText, _headers);
2290
+ }
2291
+ else if (status === 403) {
2292
+ const _responseText = response.data;
2293
+ return throwException("Forbidden", status, _responseText, _headers);
2294
+ }
2295
+ else if (status !== 200 && status !== 204) {
2296
+ const _responseText = response.data;
2297
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2298
+ }
2299
+ return Promise.resolve(null);
2300
+ }
2301
+ /**
2302
+ * Renders a preview of a web image with the specified parameters.
2303
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2304
+ (default value is 'false').
2175
2305
  * @param tenantId (optional) Tenant identifier
2176
2306
  * @param body (optional) Render model with preview parameters.
2177
2307
  * @return Success
2178
2308
  */
2179
- renderImagePreviewToResource(tenantId, body, cancelToken) {
2180
- let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
2309
+ renderImagePreviewFromUrl(attachment, tenantId, body, cancelToken) {
2310
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
2311
+ if (attachment !== undefined && attachment !== null)
2312
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2313
+ if (tenantId === null)
2314
+ throw new Error("The parameter 'tenantId' cannot be null.");
2315
+ else if (tenantId !== undefined)
2316
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2317
+ url_ = url_.replace(/[?&]$/, "");
2318
+ const content_ = JSON.stringify(body);
2319
+ let options_ = {
2320
+ data: content_,
2321
+ responseType: "blob",
2322
+ method: "POST",
2323
+ url: url_,
2324
+ headers: {
2325
+ "Content-Type": "application/json",
2326
+ "Accept": "application/octet-stream"
2327
+ },
2328
+ cancelToken
2329
+ };
2330
+ return this.transformOptions(options_).then(transformedOptions_ => {
2331
+ return this.instance.request(transformedOptions_);
2332
+ }).catch((_error) => {
2333
+ if (isAxiosError(_error) && _error.response) {
2334
+ return _error.response;
2335
+ }
2336
+ else {
2337
+ throw _error;
2338
+ }
2339
+ }).then((_response) => {
2340
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrl(_response));
2341
+ });
2342
+ }
2343
+ processRenderImagePreviewFromUrl(response) {
2344
+ const status = response.status;
2345
+ let _headers = {};
2346
+ if (response.headers && typeof response.headers === "object") {
2347
+ for (let k in response.headers) {
2348
+ if (response.headers.hasOwnProperty(k)) {
2349
+ _headers[k] = response.headers[k];
2350
+ }
2351
+ }
2352
+ }
2353
+ if (status === 200 || status === 206) {
2354
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2355
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2356
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2357
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2358
+ }
2359
+ else if (status === 401) {
2360
+ const _responseText = response.data;
2361
+ return throwException("Unauthorized", status, _responseText, _headers);
2362
+ }
2363
+ else if (status === 403) {
2364
+ const _responseText = response.data;
2365
+ return throwException("Forbidden", status, _responseText, _headers);
2366
+ }
2367
+ else if (status !== 200 && status !== 204) {
2368
+ const _responseText = response.data;
2369
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2370
+ }
2371
+ return Promise.resolve(null);
2372
+ }
2373
+ /**
2374
+ * Renders a preview of a web image with the specified parameters and saves rendering result as resource.
2375
+ * @param tenantId (optional) Tenant identifier
2376
+ * @param body (optional) Render model with preview parameters.
2377
+ * @return Success
2378
+ */
2379
+ renderImagePreviewFromUrlToResource(tenantId, body, cancelToken) {
2380
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
2181
2381
  if (tenantId === null)
2182
2382
  throw new Error("The parameter 'tenantId' cannot be null.");
2183
2383
  else if (tenantId !== undefined)
@@ -2204,10 +2404,10 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2204
2404
  throw _error;
2205
2405
  }
2206
2406
  }).then((_response) => {
2207
- return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
2407
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
2208
2408
  });
2209
2409
  }
2210
- processRenderImagePreviewToResource(response) {
2410
+ processRenderImagePreviewFromUrlToResource(response) {
2211
2411
  const status = response.status;
2212
2412
  let _headers = {};
2213
2413
  if (response.headers && typeof response.headers === "object") {
@@ -2219,10 +2419,526 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2219
2419
  }
2220
2420
  if (status === 200) {
2221
2421
  const _responseText = response.data;
2222
- let result200 = null;
2223
- let resultData200 = _responseText;
2224
- result200 = JSON.parse(resultData200);
2225
- return Promise.resolve(result200);
2422
+ let result200 = null;
2423
+ let resultData200 = _responseText;
2424
+ result200 = JSON.parse(resultData200);
2425
+ return Promise.resolve(result200);
2426
+ }
2427
+ else if (status === 409) {
2428
+ const _responseText = response.data;
2429
+ let result409 = null;
2430
+ let resultData409 = _responseText;
2431
+ result409 = JSON.parse(resultData409);
2432
+ return throwException("Conflict", status, _responseText, _headers, result409);
2433
+ }
2434
+ else if (status === 401) {
2435
+ const _responseText = response.data;
2436
+ return throwException("Unauthorized", status, _responseText, _headers);
2437
+ }
2438
+ else if (status === 403) {
2439
+ const _responseText = response.data;
2440
+ return throwException("Forbidden", status, _responseText, _headers);
2441
+ }
2442
+ else if (status !== 200 && status !== 204) {
2443
+ const _responseText = response.data;
2444
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2445
+ }
2446
+ return Promise.resolve(null);
2447
+ }
2448
+ /**
2449
+ * Renders a preview of an image with the specified parameters and saves rendering result as resource.
2450
+ * @param tenantId (optional) Tenant identifier
2451
+ * @param body (optional) Render model with preview parameters.
2452
+ * @return Success
2453
+ */
2454
+ renderImagePreviewToResource(tenantId, body, cancelToken) {
2455
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
2456
+ if (tenantId === null)
2457
+ throw new Error("The parameter 'tenantId' cannot be null.");
2458
+ else if (tenantId !== undefined)
2459
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2460
+ url_ = url_.replace(/[?&]$/, "");
2461
+ const content_ = JSON.stringify(body);
2462
+ let options_ = {
2463
+ data: content_,
2464
+ method: "POST",
2465
+ url: url_,
2466
+ headers: {
2467
+ "Content-Type": "application/json",
2468
+ "Accept": "application/json"
2469
+ },
2470
+ cancelToken
2471
+ };
2472
+ return this.transformOptions(options_).then(transformedOptions_ => {
2473
+ return this.instance.request(transformedOptions_);
2474
+ }).catch((_error) => {
2475
+ if (isAxiosError(_error) && _error.response) {
2476
+ return _error.response;
2477
+ }
2478
+ else {
2479
+ throw _error;
2480
+ }
2481
+ }).then((_response) => {
2482
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
2483
+ });
2484
+ }
2485
+ processRenderImagePreviewToResource(response) {
2486
+ const status = response.status;
2487
+ let _headers = {};
2488
+ if (response.headers && typeof response.headers === "object") {
2489
+ for (let k in response.headers) {
2490
+ if (response.headers.hasOwnProperty(k)) {
2491
+ _headers[k] = response.headers[k];
2492
+ }
2493
+ }
2494
+ }
2495
+ if (status === 200) {
2496
+ const _responseText = response.data;
2497
+ let result200 = null;
2498
+ let resultData200 = _responseText;
2499
+ result200 = JSON.parse(resultData200);
2500
+ return Promise.resolve(result200);
2501
+ }
2502
+ else if (status === 409) {
2503
+ const _responseText = response.data;
2504
+ let result409 = null;
2505
+ let resultData409 = _responseText;
2506
+ result409 = JSON.parse(resultData409);
2507
+ return throwException("Conflict", status, _responseText, _headers, result409);
2508
+ }
2509
+ else if (status === 401) {
2510
+ const _responseText = response.data;
2511
+ return throwException("Unauthorized", status, _responseText, _headers);
2512
+ }
2513
+ else if (status === 403) {
2514
+ const _responseText = response.data;
2515
+ return throwException("Forbidden", status, _responseText, _headers);
2516
+ }
2517
+ else if (status !== 200 && status !== 204) {
2518
+ const _responseText = response.data;
2519
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2520
+ }
2521
+ return Promise.resolve(null);
2522
+ }
2523
+ }
2524
+ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2525
+ instance;
2526
+ baseUrl;
2527
+ jsonParseReviver = undefined;
2528
+ constructor(configuration, baseUrl, instance) {
2529
+ super(configuration);
2530
+ this.instance = instance ? instance : axios.create();
2531
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2532
+ }
2533
+ /**
2534
+ * Returns a 3D-Mockup attributes.
2535
+ * @param id 3D-Mockup identifier.
2536
+ * @param ownerId (optional) Private mockup owner identifier.
2537
+ * @param tenantId (optional) Tenant identifier
2538
+ * @return Success
2539
+ */
2540
+ getAttributes(id, ownerId, tenantId, cancelToken) {
2541
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
2542
+ if (id === undefined || id === null)
2543
+ throw new Error("The parameter 'id' must be defined.");
2544
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2545
+ if (ownerId !== undefined && ownerId !== null)
2546
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2547
+ if (tenantId === null)
2548
+ throw new Error("The parameter 'tenantId' cannot be null.");
2549
+ else if (tenantId !== undefined)
2550
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2551
+ url_ = url_.replace(/[?&]$/, "");
2552
+ let options_ = {
2553
+ method: "GET",
2554
+ url: url_,
2555
+ headers: {
2556
+ "Accept": "application/json"
2557
+ },
2558
+ cancelToken
2559
+ };
2560
+ return this.transformOptions(options_).then(transformedOptions_ => {
2561
+ return this.instance.request(transformedOptions_);
2562
+ }).catch((_error) => {
2563
+ if (isAxiosError(_error) && _error.response) {
2564
+ return _error.response;
2565
+ }
2566
+ else {
2567
+ throw _error;
2568
+ }
2569
+ }).then((_response) => {
2570
+ return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
2571
+ });
2572
+ }
2573
+ processGetAttributes(response) {
2574
+ const status = response.status;
2575
+ let _headers = {};
2576
+ if (response.headers && typeof response.headers === "object") {
2577
+ for (let k in response.headers) {
2578
+ if (response.headers.hasOwnProperty(k)) {
2579
+ _headers[k] = response.headers[k];
2580
+ }
2581
+ }
2582
+ }
2583
+ if (status === 200) {
2584
+ const _responseText = response.data;
2585
+ let result200 = null;
2586
+ let resultData200 = _responseText;
2587
+ result200 = JSON.parse(resultData200);
2588
+ return Promise.resolve(result200);
2589
+ }
2590
+ else if (status === 404) {
2591
+ const _responseText = response.data;
2592
+ let result404 = null;
2593
+ let resultData404 = _responseText;
2594
+ result404 = JSON.parse(resultData404);
2595
+ return throwException("Not Found", status, _responseText, _headers, result404);
2596
+ }
2597
+ else if (status === 422) {
2598
+ const _responseText = response.data;
2599
+ let result422 = null;
2600
+ let resultData422 = _responseText;
2601
+ result422 = JSON.parse(resultData422);
2602
+ return throwException("Client Error", status, _responseText, _headers, result422);
2603
+ }
2604
+ else if (status === 401) {
2605
+ const _responseText = response.data;
2606
+ return throwException("Unauthorized", status, _responseText, _headers);
2607
+ }
2608
+ else if (status === 403) {
2609
+ const _responseText = response.data;
2610
+ return throwException("Forbidden", status, _responseText, _headers);
2611
+ }
2612
+ else if (status !== 200 && status !== 204) {
2613
+ const _responseText = response.data;
2614
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2615
+ }
2616
+ return Promise.resolve(null);
2617
+ }
2618
+ /**
2619
+ * Returns a 3D-Mockup content as protobuf binary stream.
2620
+ * @param id 3D-Mockup identifier.
2621
+ * @param ownerId (optional) Private mockup owner identifier.
2622
+ * @param tenantId (optional) Tenant identifier
2623
+ * @return Success
2624
+ */
2625
+ getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
2626
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
2627
+ if (id === undefined || id === null)
2628
+ throw new Error("The parameter 'id' must be defined.");
2629
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2630
+ if (ownerId !== undefined && ownerId !== null)
2631
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2632
+ if (tenantId === null)
2633
+ throw new Error("The parameter 'tenantId' cannot be null.");
2634
+ else if (tenantId !== undefined)
2635
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2636
+ url_ = url_.replace(/[?&]$/, "");
2637
+ let options_ = {
2638
+ responseType: "blob",
2639
+ method: "GET",
2640
+ url: url_,
2641
+ headers: {
2642
+ "Accept": "application/json"
2643
+ },
2644
+ cancelToken
2645
+ };
2646
+ return this.transformOptions(options_).then(transformedOptions_ => {
2647
+ return this.instance.request(transformedOptions_);
2648
+ }).catch((_error) => {
2649
+ if (isAxiosError(_error) && _error.response) {
2650
+ return _error.response;
2651
+ }
2652
+ else {
2653
+ throw _error;
2654
+ }
2655
+ }).then((_response) => {
2656
+ return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
2657
+ });
2658
+ }
2659
+ processGetContentAsProtobuf(response) {
2660
+ const status = response.status;
2661
+ let _headers = {};
2662
+ if (response.headers && typeof response.headers === "object") {
2663
+ for (let k in response.headers) {
2664
+ if (response.headers.hasOwnProperty(k)) {
2665
+ _headers[k] = response.headers[k];
2666
+ }
2667
+ }
2668
+ }
2669
+ if (status === 200 || status === 206) {
2670
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2671
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2672
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2673
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2674
+ }
2675
+ else if (status === 404) {
2676
+ const _responseText = response.data;
2677
+ let result404 = null;
2678
+ let resultData404 = _responseText;
2679
+ result404 = JSON.parse(resultData404);
2680
+ return throwException("Not Found", status, _responseText, _headers, result404);
2681
+ }
2682
+ else if (status === 422) {
2683
+ const _responseText = response.data;
2684
+ let result422 = null;
2685
+ let resultData422 = _responseText;
2686
+ result422 = JSON.parse(resultData422);
2687
+ return throwException("Client Error", status, _responseText, _headers, result422);
2688
+ }
2689
+ else if (status === 401) {
2690
+ const _responseText = response.data;
2691
+ return throwException("Unauthorized", status, _responseText, _headers);
2692
+ }
2693
+ else if (status === 403) {
2694
+ const _responseText = response.data;
2695
+ return throwException("Forbidden", status, _responseText, _headers);
2696
+ }
2697
+ else if (status !== 200 && status !== 204) {
2698
+ const _responseText = response.data;
2699
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2700
+ }
2701
+ return Promise.resolve(null);
2702
+ }
2703
+ /**
2704
+ * Returns a 3D-Mockup geometry as binary stream.
2705
+ * @param id 3D-Mockup identifier.
2706
+ * @param ownerId (optional) Private mockup owner identifier.
2707
+ * @param tenantId (optional) Tenant identifier
2708
+ * @return Success
2709
+ */
2710
+ getGeometryFile(id, ownerId, tenantId, cancelToken) {
2711
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
2712
+ if (id === undefined || id === null)
2713
+ throw new Error("The parameter 'id' must be defined.");
2714
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2715
+ if (ownerId !== undefined && ownerId !== null)
2716
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2717
+ if (tenantId === null)
2718
+ throw new Error("The parameter 'tenantId' cannot be null.");
2719
+ else if (tenantId !== undefined)
2720
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2721
+ url_ = url_.replace(/[?&]$/, "");
2722
+ let options_ = {
2723
+ responseType: "blob",
2724
+ method: "GET",
2725
+ url: url_,
2726
+ headers: {
2727
+ "Accept": "application/json"
2728
+ },
2729
+ cancelToken
2730
+ };
2731
+ return this.transformOptions(options_).then(transformedOptions_ => {
2732
+ return this.instance.request(transformedOptions_);
2733
+ }).catch((_error) => {
2734
+ if (isAxiosError(_error) && _error.response) {
2735
+ return _error.response;
2736
+ }
2737
+ else {
2738
+ throw _error;
2739
+ }
2740
+ }).then((_response) => {
2741
+ return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
2742
+ });
2743
+ }
2744
+ processGetGeometryFile(response) {
2745
+ const status = response.status;
2746
+ let _headers = {};
2747
+ if (response.headers && typeof response.headers === "object") {
2748
+ for (let k in response.headers) {
2749
+ if (response.headers.hasOwnProperty(k)) {
2750
+ _headers[k] = response.headers[k];
2751
+ }
2752
+ }
2753
+ }
2754
+ if (status === 200 || status === 206) {
2755
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2756
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2757
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2758
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2759
+ }
2760
+ else if (status === 404) {
2761
+ const _responseText = response.data;
2762
+ let result404 = null;
2763
+ let resultData404 = _responseText;
2764
+ result404 = JSON.parse(resultData404);
2765
+ return throwException("Not Found", status, _responseText, _headers, result404);
2766
+ }
2767
+ else if (status === 422) {
2768
+ const _responseText = response.data;
2769
+ let result422 = null;
2770
+ let resultData422 = _responseText;
2771
+ result422 = JSON.parse(resultData422);
2772
+ return throwException("Client Error", status, _responseText, _headers, result422);
2773
+ }
2774
+ else if (status === 401) {
2775
+ const _responseText = response.data;
2776
+ return throwException("Unauthorized", status, _responseText, _headers);
2777
+ }
2778
+ else if (status === 403) {
2779
+ const _responseText = response.data;
2780
+ return throwException("Forbidden", status, _responseText, _headers);
2781
+ }
2782
+ else if (status !== 200 && status !== 204) {
2783
+ const _responseText = response.data;
2784
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2785
+ }
2786
+ return Promise.resolve(null);
2787
+ }
2788
+ }
2789
+ export class DesignAtomsServiceApiClient extends ApiClientBase {
2790
+ instance;
2791
+ baseUrl;
2792
+ jsonParseReviver = undefined;
2793
+ constructor(configuration, baseUrl, instance) {
2794
+ super(configuration);
2795
+ this.instance = instance ? instance : axios.create();
2796
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2797
+ }
2798
+ /**
2799
+ * Creates new design file with specified parameters and saves it in storage.
2800
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2801
+ * @param tenantId (optional) Tenant identifier
2802
+ * @param body (optional) Design creation parameters.
2803
+ * @return Created
2804
+ */
2805
+ createDesign(privateStorageOwner, tenantId, body, cancelToken) {
2806
+ let url_ = this.baseUrl + "/api/atoms/v1/designs?";
2807
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2808
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2809
+ if (tenantId === null)
2810
+ throw new Error("The parameter 'tenantId' cannot be null.");
2811
+ else if (tenantId !== undefined)
2812
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2813
+ url_ = url_.replace(/[?&]$/, "");
2814
+ const content_ = JSON.stringify(body);
2815
+ let options_ = {
2816
+ data: content_,
2817
+ method: "POST",
2818
+ url: url_,
2819
+ headers: {
2820
+ "Content-Type": "application/json",
2821
+ "Accept": "application/json"
2822
+ },
2823
+ cancelToken
2824
+ };
2825
+ return this.transformOptions(options_).then(transformedOptions_ => {
2826
+ return this.instance.request(transformedOptions_);
2827
+ }).catch((_error) => {
2828
+ if (isAxiosError(_error) && _error.response) {
2829
+ return _error.response;
2830
+ }
2831
+ else {
2832
+ throw _error;
2833
+ }
2834
+ }).then((_response) => {
2835
+ return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
2836
+ });
2837
+ }
2838
+ processCreateDesign(response) {
2839
+ const status = response.status;
2840
+ let _headers = {};
2841
+ if (response.headers && typeof response.headers === "object") {
2842
+ for (let k in response.headers) {
2843
+ if (response.headers.hasOwnProperty(k)) {
2844
+ _headers[k] = response.headers[k];
2845
+ }
2846
+ }
2847
+ }
2848
+ if (status === 201) {
2849
+ const _responseText = response.data;
2850
+ let result201 = null;
2851
+ let resultData201 = _responseText;
2852
+ result201 = JSON.parse(resultData201);
2853
+ return Promise.resolve(result201);
2854
+ }
2855
+ else if (status === 401) {
2856
+ const _responseText = response.data;
2857
+ return throwException("Unauthorized", status, _responseText, _headers);
2858
+ }
2859
+ else if (status === 403) {
2860
+ const _responseText = response.data;
2861
+ return throwException("Forbidden", status, _responseText, _headers);
2862
+ }
2863
+ else if (status !== 200 && status !== 204) {
2864
+ const _responseText = response.data;
2865
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2866
+ }
2867
+ return Promise.resolve(null);
2868
+ }
2869
+ /**
2870
+ * Returns content of the background.
2871
+ * @param id Design identifier.
2872
+ * @param surfaceIndex (optional) Surface index.
2873
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2874
+ * @param tenantId (optional) Tenant identifier
2875
+ * @return Success
2876
+ */
2877
+ extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
2878
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
2879
+ if (id === undefined || id === null)
2880
+ throw new Error("The parameter 'id' must be defined.");
2881
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2882
+ if (surfaceIndex !== undefined && surfaceIndex !== null)
2883
+ url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
2884
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2885
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2886
+ if (tenantId === null)
2887
+ throw new Error("The parameter 'tenantId' cannot be null.");
2888
+ else if (tenantId !== undefined)
2889
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2890
+ url_ = url_.replace(/[?&]$/, "");
2891
+ let options_ = {
2892
+ responseType: "blob",
2893
+ method: "GET",
2894
+ url: url_,
2895
+ headers: {
2896
+ "Accept": "application/octet-stream"
2897
+ },
2898
+ cancelToken
2899
+ };
2900
+ return this.transformOptions(options_).then(transformedOptions_ => {
2901
+ return this.instance.request(transformedOptions_);
2902
+ }).catch((_error) => {
2903
+ if (isAxiosError(_error) && _error.response) {
2904
+ return _error.response;
2905
+ }
2906
+ else {
2907
+ throw _error;
2908
+ }
2909
+ }).then((_response) => {
2910
+ return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
2911
+ });
2912
+ }
2913
+ processExtractBackground(response) {
2914
+ const status = response.status;
2915
+ let _headers = {};
2916
+ if (response.headers && typeof response.headers === "object") {
2917
+ for (let k in response.headers) {
2918
+ if (response.headers.hasOwnProperty(k)) {
2919
+ _headers[k] = response.headers[k];
2920
+ }
2921
+ }
2922
+ }
2923
+ if (status === 200 || status === 206) {
2924
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2925
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2926
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2927
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2928
+ }
2929
+ else if (status === 404) {
2930
+ const _responseText = response.data;
2931
+ let result404 = null;
2932
+ let resultData404 = _responseText;
2933
+ result404 = JSON.parse(resultData404);
2934
+ return throwException("Not Found", status, _responseText, _headers, result404);
2935
+ }
2936
+ else if (status === 422) {
2937
+ const _responseText = response.data;
2938
+ let result422 = null;
2939
+ let resultData422 = _responseText;
2940
+ result422 = JSON.parse(resultData422);
2941
+ return throwException("Client Error", status, _responseText, _headers, result422);
2226
2942
  }
2227
2943
  else if (status === 401) {
2228
2944
  const _responseText = response.data;
@@ -2238,32 +2954,20 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2238
2954
  }
2239
2955
  return Promise.resolve(null);
2240
2956
  }
2241
- }
2242
- export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2243
- instance;
2244
- baseUrl;
2245
- jsonParseReviver = undefined;
2246
- constructor(configuration, baseUrl, instance) {
2247
- super(configuration);
2248
- this.instance = instance ? instance : axios.create();
2249
- this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2250
- }
2251
2957
  /**
2252
- * Returns a 3D-Mockup attributes.
2253
- * @param id 3D-Mockup identifier.
2254
- * @param ownerId (optional) Private mockup owner identifier.
2958
+ * Loads product (design model) from design file taken from storage.
2959
+ * @param id Design identifier.
2960
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2255
2961
  * @param tenantId (optional) Tenant identifier
2256
2962
  * @return Success
2257
2963
  */
2258
- getAttributes(id, ownerId, tenantId, cancelToken) {
2259
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
2964
+ loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
2965
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
2260
2966
  if (id === undefined || id === null)
2261
2967
  throw new Error("The parameter 'id' must be defined.");
2262
2968
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2263
- if (ownerId === null)
2264
- throw new Error("The parameter 'ownerId' cannot be null.");
2265
- else if (ownerId !== undefined)
2266
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2969
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2970
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2267
2971
  if (tenantId === null)
2268
2972
  throw new Error("The parameter 'tenantId' cannot be null.");
2269
2973
  else if (tenantId !== undefined)
@@ -2287,10 +2991,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2287
2991
  throw _error;
2288
2992
  }
2289
2993
  }).then((_response) => {
2290
- return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
2994
+ return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
2291
2995
  });
2292
2996
  }
2293
- processGetAttributes(response) {
2997
+ processLoadProduct(response) {
2294
2998
  const status = response.status;
2295
2999
  let _headers = {};
2296
3000
  if (response.headers && typeof response.headers === "object") {
@@ -2314,13 +3018,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2314
3018
  result404 = JSON.parse(resultData404);
2315
3019
  return throwException("Not Found", status, _responseText, _headers, result404);
2316
3020
  }
2317
- else if (status === 422) {
2318
- const _responseText = response.data;
2319
- let result422 = null;
2320
- let resultData422 = _responseText;
2321
- result422 = JSON.parse(resultData422);
2322
- return throwException("Client Error", status, _responseText, _headers, result422);
2323
- }
2324
3021
  else if (status === 401) {
2325
3022
  const _responseText = response.data;
2326
3023
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2336,32 +3033,32 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2336
3033
  return Promise.resolve(null);
2337
3034
  }
2338
3035
  /**
2339
- * Returns a 3D-Mockup content as protobuf binary stream.
2340
- * @param id 3D-Mockup identifier.
2341
- * @param ownerId (optional) Private mockup owner identifier.
3036
+ * Saves product (design model) to design file and updates design in storage.
3037
+ * @param id Design identifier.
3038
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2342
3039
  * @param tenantId (optional) Tenant identifier
3040
+ * @param body (optional) Serialized product description.
2343
3041
  * @return Success
2344
3042
  */
2345
- getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
2346
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
3043
+ saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
3044
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
2347
3045
  if (id === undefined || id === null)
2348
3046
  throw new Error("The parameter 'id' must be defined.");
2349
3047
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2350
- if (ownerId === null)
2351
- throw new Error("The parameter 'ownerId' cannot be null.");
2352
- else if (ownerId !== undefined)
2353
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
3048
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3049
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2354
3050
  if (tenantId === null)
2355
3051
  throw new Error("The parameter 'tenantId' cannot be null.");
2356
3052
  else if (tenantId !== undefined)
2357
3053
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2358
3054
  url_ = url_.replace(/[?&]$/, "");
3055
+ const content_ = JSON.stringify(body);
2359
3056
  let options_ = {
2360
- responseType: "blob",
2361
- method: "GET",
3057
+ data: content_,
3058
+ method: "PUT",
2362
3059
  url: url_,
2363
3060
  headers: {
2364
- "Accept": "application/json"
3061
+ "Content-Type": "application/json",
2365
3062
  },
2366
3063
  cancelToken
2367
3064
  };
@@ -2375,10 +3072,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2375
3072
  throw _error;
2376
3073
  }
2377
3074
  }).then((_response) => {
2378
- return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
3075
+ return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
2379
3076
  });
2380
3077
  }
2381
- processGetContentAsProtobuf(response) {
3078
+ processSaveProduct(response) {
2382
3079
  const status = response.status;
2383
3080
  let _headers = {};
2384
3081
  if (response.headers && typeof response.headers === "object") {
@@ -2388,11 +3085,9 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2388
3085
  }
2389
3086
  }
2390
3087
  }
2391
- if (status === 200 || status === 206) {
2392
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2393
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2394
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2395
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3088
+ if (status === 200) {
3089
+ const _responseText = response.data;
3090
+ return Promise.resolve(null);
2396
3091
  }
2397
3092
  else if (status === 404) {
2398
3093
  const _responseText = response.data;
@@ -2401,13 +3096,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2401
3096
  result404 = JSON.parse(resultData404);
2402
3097
  return throwException("Not Found", status, _responseText, _headers, result404);
2403
3098
  }
2404
- else if (status === 422) {
2405
- const _responseText = response.data;
2406
- let result422 = null;
2407
- let resultData422 = _responseText;
2408
- result422 = JSON.parse(resultData422);
2409
- return throwException("Client Error", status, _responseText, _headers, result422);
2410
- }
2411
3099
  else if (status === 401) {
2412
3100
  const _responseText = response.data;
2413
3101
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2423,33 +3111,52 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2423
3111
  return Promise.resolve(null);
2424
3112
  }
2425
3113
  /**
2426
- * Returns a 3D-Mockup geometry as binary stream.
2427
- * @param id 3D-Mockup identifier.
2428
- * @param ownerId (optional) Private mockup owner identifier.
3114
+ * Patches product (design model) in design file.
3115
+ * @param id Design identifier.
3116
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2429
3117
  * @param tenantId (optional) Tenant identifier
3118
+ * @param patchType (optional)
3119
+ * @param replaceImageItemFileInfo_itemName (optional)
3120
+ * @param replaceImageItemFileInfo_sourceFile (optional)
3121
+ * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
3122
+ * @param replacePlaceholderItemContentInfo_newContentType (optional)
3123
+ * @param replacePlaceholderItemContentInfo_sourceFile (optional)
2430
3124
  * @return Success
2431
3125
  */
2432
- getGeometryFile(id, ownerId, tenantId, cancelToken) {
2433
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
3126
+ patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
3127
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
2434
3128
  if (id === undefined || id === null)
2435
3129
  throw new Error("The parameter 'id' must be defined.");
2436
3130
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2437
- if (ownerId === null)
2438
- throw new Error("The parameter 'ownerId' cannot be null.");
2439
- else if (ownerId !== undefined)
2440
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
3131
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3132
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2441
3133
  if (tenantId === null)
2442
3134
  throw new Error("The parameter 'tenantId' cannot be null.");
2443
3135
  else if (tenantId !== undefined)
2444
3136
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2445
3137
  url_ = url_.replace(/[?&]$/, "");
3138
+ const content_ = new FormData();
3139
+ if (patchType === null || patchType === undefined)
3140
+ throw new Error("The parameter 'patchType' cannot be null.");
3141
+ else
3142
+ content_.append("patchType", patchType.toString());
3143
+ if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
3144
+ content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
3145
+ if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
3146
+ content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
3147
+ if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
3148
+ content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
3149
+ if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
3150
+ throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
3151
+ else
3152
+ content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
3153
+ if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
3154
+ content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
2446
3155
  let options_ = {
2447
- responseType: "blob",
2448
- method: "GET",
3156
+ data: content_,
3157
+ method: "PATCH",
2449
3158
  url: url_,
2450
- headers: {
2451
- "Accept": "application/json"
2452
- },
3159
+ headers: {},
2453
3160
  cancelToken
2454
3161
  };
2455
3162
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -2462,10 +3169,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2462
3169
  throw _error;
2463
3170
  }
2464
3171
  }).then((_response) => {
2465
- return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
3172
+ return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
2466
3173
  });
2467
3174
  }
2468
- processGetGeometryFile(response) {
3175
+ processPatchProduct(response) {
2469
3176
  const status = response.status;
2470
3177
  let _headers = {};
2471
3178
  if (response.headers && typeof response.headers === "object") {
@@ -2475,11 +3182,9 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2475
3182
  }
2476
3183
  }
2477
3184
  }
2478
- if (status === 200 || status === 206) {
2479
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2480
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2481
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2482
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3185
+ if (status === 200) {
3186
+ const _responseText = response.data;
3187
+ return Promise.resolve(null);
2483
3188
  }
2484
3189
  else if (status === 404) {
2485
3190
  const _responseText = response.data;
@@ -2488,13 +3193,6 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2488
3193
  result404 = JSON.parse(resultData404);
2489
3194
  return throwException("Not Found", status, _responseText, _headers, result404);
2490
3195
  }
2491
- else if (status === 422) {
2492
- const _responseText = response.data;
2493
- let result422 = null;
2494
- let resultData422 = _responseText;
2495
- result422 = JSON.parse(resultData422);
2496
- return throwException("Client Error", status, _responseText, _headers, result422);
2497
- }
2498
3196
  else if (status === 401) {
2499
3197
  const _responseText = response.data;
2500
3198
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2509,41 +3207,29 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2509
3207
  }
2510
3208
  return Promise.resolve(null);
2511
3209
  }
2512
- }
2513
- export class DesignAtomsServiceApiClient extends ApiClientBase {
2514
- instance;
2515
- baseUrl;
2516
- jsonParseReviver = undefined;
2517
- constructor(configuration, baseUrl, instance) {
2518
- super(configuration);
2519
- this.instance = instance ? instance : axios.create();
2520
- this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2521
- }
2522
3210
  /**
2523
- * Creates new design file with specified parameters and saves it in storage.
3211
+ * Returns design parameters stored in product model.
3212
+ * @param id Design identifier.
2524
3213
  * @param privateStorageOwner (optional) Private storage owner identifier.
2525
3214
  * @param tenantId (optional) Tenant identifier
2526
- * @param body (optional) Design creation parameters.
2527
- * @return Created
3215
+ * @return Success
2528
3216
  */
2529
- createDesign(privateStorageOwner, tenantId, body, cancelToken) {
2530
- let url_ = this.baseUrl + "/api/atoms/v1/designs?";
2531
- if (privateStorageOwner === null)
2532
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2533
- else if (privateStorageOwner !== undefined)
3217
+ getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
3218
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
3219
+ if (id === undefined || id === null)
3220
+ throw new Error("The parameter 'id' must be defined.");
3221
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3222
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2534
3223
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2535
3224
  if (tenantId === null)
2536
3225
  throw new Error("The parameter 'tenantId' cannot be null.");
2537
3226
  else if (tenantId !== undefined)
2538
3227
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2539
3228
  url_ = url_.replace(/[?&]$/, "");
2540
- const content_ = JSON.stringify(body);
2541
3229
  let options_ = {
2542
- data: content_,
2543
- method: "POST",
3230
+ method: "GET",
2544
3231
  url: url_,
2545
3232
  headers: {
2546
- "Content-Type": "application/json",
2547
3233
  "Accept": "application/json"
2548
3234
  },
2549
3235
  cancelToken
@@ -2558,10 +3244,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2558
3244
  throw _error;
2559
3245
  }
2560
3246
  }).then((_response) => {
2561
- return this.transformResult(url_, _response, (_response) => this.processCreateDesign(_response));
3247
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
2562
3248
  });
2563
3249
  }
2564
- processCreateDesign(response) {
3250
+ processGetDesignParameters(response) {
2565
3251
  const status = response.status;
2566
3252
  let _headers = {};
2567
3253
  if (response.headers && typeof response.headers === "object") {
@@ -2571,12 +3257,19 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2571
3257
  }
2572
3258
  }
2573
3259
  }
2574
- if (status === 201) {
3260
+ if (status === 200) {
2575
3261
  const _responseText = response.data;
2576
- let result201 = null;
2577
- let resultData201 = _responseText;
2578
- result201 = JSON.parse(resultData201);
2579
- return Promise.resolve(result201);
3262
+ let result200 = null;
3263
+ let resultData200 = _responseText;
3264
+ result200 = JSON.parse(resultData200);
3265
+ return Promise.resolve(result200);
3266
+ }
3267
+ else if (status === 404) {
3268
+ const _responseText = response.data;
3269
+ let result404 = null;
3270
+ let resultData404 = _responseText;
3271
+ result404 = JSON.parse(resultData404);
3272
+ return throwException("Not Found", status, _responseText, _headers, result404);
2580
3273
  }
2581
3274
  else if (status === 401) {
2582
3275
  const _responseText = response.data;
@@ -2593,25 +3286,18 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2593
3286
  return Promise.resolve(null);
2594
3287
  }
2595
3288
  /**
2596
- * Returns content of the background.
3289
+ * Loads data schema from design file taken from storage.
2597
3290
  * @param id Design identifier.
2598
- * @param surfaceIndex (optional) Surface index.
2599
3291
  * @param privateStorageOwner (optional) Private storage owner identifier.
2600
3292
  * @param tenantId (optional) Tenant identifier
2601
3293
  * @return Success
2602
3294
  */
2603
- extractBackground(id, surfaceIndex, privateStorageOwner, tenantId, cancelToken) {
2604
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
3295
+ loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
3296
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
2605
3297
  if (id === undefined || id === null)
2606
3298
  throw new Error("The parameter 'id' must be defined.");
2607
3299
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2608
- if (surfaceIndex === null)
2609
- throw new Error("The parameter 'surfaceIndex' cannot be null.");
2610
- else if (surfaceIndex !== undefined)
2611
- url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
2612
- if (privateStorageOwner === null)
2613
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2614
- else if (privateStorageOwner !== undefined)
3300
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2615
3301
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2616
3302
  if (tenantId === null)
2617
3303
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -2637,10 +3323,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2637
3323
  throw _error;
2638
3324
  }
2639
3325
  }).then((_response) => {
2640
- return this.transformResult(url_, _response, (_response) => this.processExtractBackground(_response));
3326
+ return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
2641
3327
  });
2642
3328
  }
2643
- processExtractBackground(response) {
3329
+ processLoadDataSchema(response) {
2644
3330
  const status = response.status;
2645
3331
  let _headers = {};
2646
3332
  if (response.headers && typeof response.headers === "object") {
@@ -2663,12 +3349,12 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2663
3349
  result404 = JSON.parse(resultData404);
2664
3350
  return throwException("Not Found", status, _responseText, _headers, result404);
2665
3351
  }
2666
- else if (status === 422) {
3352
+ else if (status === 409) {
2667
3353
  const _responseText = response.data;
2668
- let result422 = null;
2669
- let resultData422 = _responseText;
2670
- result422 = JSON.parse(resultData422);
2671
- return throwException("Client Error", status, _responseText, _headers, result422);
3354
+ let result409 = null;
3355
+ let resultData409 = _responseText;
3356
+ result409 = JSON.parse(resultData409);
3357
+ return throwException("Conflict", status, _responseText, _headers, result409);
2672
3358
  }
2673
3359
  else if (status === 401) {
2674
3360
  const _responseText = response.data;
@@ -2685,20 +3371,18 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2685
3371
  return Promise.resolve(null);
2686
3372
  }
2687
3373
  /**
2688
- * Loads product (design model) from design file taken from storage.
3374
+ * Loads a toggle set from design file taken from storage.
2689
3375
  * @param id Design identifier.
2690
3376
  * @param privateStorageOwner (optional) Private storage owner identifier.
2691
3377
  * @param tenantId (optional) Tenant identifier
2692
3378
  * @return Success
2693
3379
  */
2694
- loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
2695
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3380
+ loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
3381
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
2696
3382
  if (id === undefined || id === null)
2697
3383
  throw new Error("The parameter 'id' must be defined.");
2698
3384
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2699
- if (privateStorageOwner === null)
2700
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2701
- else if (privateStorageOwner !== undefined)
3385
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2702
3386
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2703
3387
  if (tenantId === null)
2704
3388
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -2706,10 +3390,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2706
3390
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2707
3391
  url_ = url_.replace(/[?&]$/, "");
2708
3392
  let options_ = {
3393
+ responseType: "blob",
2709
3394
  method: "GET",
2710
3395
  url: url_,
2711
3396
  headers: {
2712
- "Accept": "application/json"
3397
+ "Accept": "application/octet-stream"
2713
3398
  },
2714
3399
  cancelToken
2715
3400
  };
@@ -2723,10 +3408,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2723
3408
  throw _error;
2724
3409
  }
2725
3410
  }).then((_response) => {
2726
- return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
3411
+ return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
2727
3412
  });
2728
3413
  }
2729
- processLoadProduct(response) {
3414
+ processLoadToggleSet(response) {
2730
3415
  const status = response.status;
2731
3416
  let _headers = {};
2732
3417
  if (response.headers && typeof response.headers === "object") {
@@ -2736,12 +3421,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2736
3421
  }
2737
3422
  }
2738
3423
  }
2739
- if (status === 200) {
2740
- const _responseText = response.data;
2741
- let result200 = null;
2742
- let resultData200 = _responseText;
2743
- result200 = JSON.parse(resultData200);
2744
- return Promise.resolve(result200);
3424
+ if (status === 200 || status === 206) {
3425
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3426
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3427
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3428
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2745
3429
  }
2746
3430
  else if (status === 404) {
2747
3431
  const _responseText = response.data;
@@ -2750,6 +3434,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2750
3434
  result404 = JSON.parse(resultData404);
2751
3435
  return throwException("Not Found", status, _responseText, _headers, result404);
2752
3436
  }
3437
+ else if (status === 409) {
3438
+ const _responseText = response.data;
3439
+ let result409 = null;
3440
+ let resultData409 = _responseText;
3441
+ result409 = JSON.parse(resultData409);
3442
+ return throwException("Conflict", status, _responseText, _headers, result409);
3443
+ }
2753
3444
  else if (status === 401) {
2754
3445
  const _responseText = response.data;
2755
3446
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2765,34 +3456,29 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2765
3456
  return Promise.resolve(null);
2766
3457
  }
2767
3458
  /**
2768
- * Saves product (design model) to design file and updates design in storage.
3459
+ * Gets variable items information for design file taken from storage.
2769
3460
  * @param id Design identifier.
2770
3461
  * @param privateStorageOwner (optional) Private storage owner identifier.
2771
3462
  * @param tenantId (optional) Tenant identifier
2772
- * @param body (optional) Serialized product description.
2773
3463
  * @return Success
2774
3464
  */
2775
- saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
2776
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3465
+ getVariables(id, privateStorageOwner, tenantId, cancelToken) {
3466
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
2777
3467
  if (id === undefined || id === null)
2778
3468
  throw new Error("The parameter 'id' must be defined.");
2779
3469
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2780
- if (privateStorageOwner === null)
2781
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2782
- else if (privateStorageOwner !== undefined)
3470
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2783
3471
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2784
3472
  if (tenantId === null)
2785
3473
  throw new Error("The parameter 'tenantId' cannot be null.");
2786
3474
  else if (tenantId !== undefined)
2787
3475
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2788
3476
  url_ = url_.replace(/[?&]$/, "");
2789
- const content_ = JSON.stringify(body);
2790
- let options_ = {
2791
- data: content_,
2792
- method: "PUT",
3477
+ let options_ = {
3478
+ method: "GET",
2793
3479
  url: url_,
2794
3480
  headers: {
2795
- "Content-Type": "application/json",
3481
+ "Accept": "application/json"
2796
3482
  },
2797
3483
  cancelToken
2798
3484
  };
@@ -2806,10 +3492,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2806
3492
  throw _error;
2807
3493
  }
2808
3494
  }).then((_response) => {
2809
- return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
3495
+ return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
2810
3496
  });
2811
3497
  }
2812
- processSaveProduct(response) {
3498
+ processGetVariables(response) {
2813
3499
  const status = response.status;
2814
3500
  let _headers = {};
2815
3501
  if (response.headers && typeof response.headers === "object") {
@@ -2821,7 +3507,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2821
3507
  }
2822
3508
  if (status === 200) {
2823
3509
  const _responseText = response.data;
2824
- return Promise.resolve(null);
3510
+ let result200 = null;
3511
+ let resultData200 = _responseText;
3512
+ result200 = JSON.parse(resultData200);
3513
+ return Promise.resolve(result200);
2825
3514
  }
2826
3515
  else if (status === 404) {
2827
3516
  const _responseText = response.data;
@@ -2845,54 +3534,33 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2845
3534
  return Promise.resolve(null);
2846
3535
  }
2847
3536
  /**
2848
- * Patches product (design model) in design file.
3537
+ * Sets variable items values for design file taken from storage.
2849
3538
  * @param id Design identifier.
2850
3539
  * @param privateStorageOwner (optional) Private storage owner identifier.
2851
3540
  * @param tenantId (optional) Tenant identifier
2852
- * @param patchType (optional)
2853
- * @param replaceImageItemFileInfo_itemName (optional)
2854
- * @param replaceImageItemFileInfo_sourceFile (optional)
2855
- * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
2856
- * @param replacePlaceholderItemContentInfo_newContentType (optional)
2857
- * @param replacePlaceholderItemContentInfo_sourceFile (optional)
3541
+ * @param body (optional) Design variable values.
2858
3542
  * @return Success
2859
3543
  */
2860
- patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
2861
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3544
+ setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
3545
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
2862
3546
  if (id === undefined || id === null)
2863
3547
  throw new Error("The parameter 'id' must be defined.");
2864
3548
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2865
- if (privateStorageOwner === null)
2866
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2867
- else if (privateStorageOwner !== undefined)
3549
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2868
3550
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2869
3551
  if (tenantId === null)
2870
3552
  throw new Error("The parameter 'tenantId' cannot be null.");
2871
3553
  else if (tenantId !== undefined)
2872
3554
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2873
3555
  url_ = url_.replace(/[?&]$/, "");
2874
- const content_ = new FormData();
2875
- if (patchType === null || patchType === undefined)
2876
- throw new Error("The parameter 'patchType' cannot be null.");
2877
- else
2878
- content_.append("patchType", patchType.toString());
2879
- if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
2880
- content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
2881
- if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
2882
- content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
2883
- if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
2884
- content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
2885
- if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
2886
- throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
2887
- else
2888
- content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
2889
- if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
2890
- content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
3556
+ const content_ = JSON.stringify(body);
2891
3557
  let options_ = {
2892
3558
  data: content_,
2893
- method: "PATCH",
3559
+ method: "PUT",
2894
3560
  url: url_,
2895
- headers: {},
3561
+ headers: {
3562
+ "Content-Type": "application/json",
3563
+ },
2896
3564
  cancelToken
2897
3565
  };
2898
3566
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -2905,10 +3573,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2905
3573
  throw _error;
2906
3574
  }
2907
3575
  }).then((_response) => {
2908
- return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
3576
+ return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
2909
3577
  });
2910
3578
  }
2911
- processPatchProduct(response) {
3579
+ processSetVariables(response) {
2912
3580
  const status = response.status;
2913
3581
  let _headers = {};
2914
3582
  if (response.headers && typeof response.headers === "object") {
@@ -2929,6 +3597,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2929
3597
  result404 = JSON.parse(resultData404);
2930
3598
  return throwException("Not Found", status, _responseText, _headers, result404);
2931
3599
  }
3600
+ else if (status === 409) {
3601
+ const _responseText = response.data;
3602
+ let result409 = null;
3603
+ let resultData409 = _responseText;
3604
+ result409 = JSON.parse(resultData409);
3605
+ return throwException("Conflict", status, _responseText, _headers, result409);
3606
+ }
2932
3607
  else if (status === 401) {
2933
3608
  const _responseText = response.data;
2934
3609
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2944,20 +3619,18 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2944
3619
  return Promise.resolve(null);
2945
3620
  }
2946
3621
  /**
2947
- * Returns design parameters stored in product model.
3622
+ * Loads variable data printing information from design file taken from storage.
2948
3623
  * @param id Design identifier.
2949
3624
  * @param privateStorageOwner (optional) Private storage owner identifier.
2950
3625
  * @param tenantId (optional) Tenant identifier
2951
3626
  * @return Success
2952
3627
  */
2953
- getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
2954
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
3628
+ loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3629
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
2955
3630
  if (id === undefined || id === null)
2956
3631
  throw new Error("The parameter 'id' must be defined.");
2957
3632
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
2958
- if (privateStorageOwner === null)
2959
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
2960
- else if (privateStorageOwner !== undefined)
3633
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2961
3634
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2962
3635
  if (tenantId === null)
2963
3636
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -2982,10 +3655,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2982
3655
  throw _error;
2983
3656
  }
2984
3657
  }).then((_response) => {
2985
- return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
3658
+ return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
2986
3659
  });
2987
3660
  }
2988
- processGetDesignParameters(response) {
3661
+ processLoadVdpData(response) {
2989
3662
  const status = response.status;
2990
3663
  let _headers = {};
2991
3664
  if (response.headers && typeof response.headers === "object") {
@@ -3009,6 +3682,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3009
3682
  result404 = JSON.parse(resultData404);
3010
3683
  return throwException("Not Found", status, _responseText, _headers, result404);
3011
3684
  }
3685
+ else if (status === 409) {
3686
+ const _responseText = response.data;
3687
+ let result409 = null;
3688
+ let resultData409 = _responseText;
3689
+ result409 = JSON.parse(resultData409);
3690
+ return throwException("Conflict", status, _responseText, _headers, result409);
3691
+ }
3012
3692
  else if (status === 401) {
3013
3693
  const _responseText = response.data;
3014
3694
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3024,32 +3704,32 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3024
3704
  return Promise.resolve(null);
3025
3705
  }
3026
3706
  /**
3027
- * Loads data schema from design file taken from storage.
3707
+ * Saves variable data printing information to design file and updates design in storage.
3028
3708
  * @param id Design identifier.
3029
3709
  * @param privateStorageOwner (optional) Private storage owner identifier.
3030
3710
  * @param tenantId (optional) Tenant identifier
3711
+ * @param body (optional) Serialized vdp data.
3031
3712
  * @return Success
3032
3713
  */
3033
- loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
3034
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
3714
+ saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
3715
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3035
3716
  if (id === undefined || id === null)
3036
3717
  throw new Error("The parameter 'id' must be defined.");
3037
3718
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3038
- if (privateStorageOwner === null)
3039
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3040
- else if (privateStorageOwner !== undefined)
3719
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3041
3720
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3042
3721
  if (tenantId === null)
3043
3722
  throw new Error("The parameter 'tenantId' cannot be null.");
3044
3723
  else if (tenantId !== undefined)
3045
3724
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3046
3725
  url_ = url_.replace(/[?&]$/, "");
3726
+ const content_ = JSON.stringify(body);
3047
3727
  let options_ = {
3048
- responseType: "blob",
3049
- method: "GET",
3728
+ data: content_,
3729
+ method: "PUT",
3050
3730
  url: url_,
3051
3731
  headers: {
3052
- "Accept": "application/octet-stream"
3732
+ "Content-Type": "application/json",
3053
3733
  },
3054
3734
  cancelToken
3055
3735
  };
@@ -3063,10 +3743,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3063
3743
  throw _error;
3064
3744
  }
3065
3745
  }).then((_response) => {
3066
- return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
3746
+ return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
3067
3747
  });
3068
3748
  }
3069
- processLoadDataSchema(response) {
3749
+ processSaveVdpData(response) {
3070
3750
  const status = response.status;
3071
3751
  let _headers = {};
3072
3752
  if (response.headers && typeof response.headers === "object") {
@@ -3076,11 +3756,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3076
3756
  }
3077
3757
  }
3078
3758
  }
3079
- if (status === 200 || status === 206) {
3080
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3081
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3082
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3083
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3759
+ if (status === 200) {
3760
+ const _responseText = response.data;
3761
+ return Promise.resolve(null);
3084
3762
  }
3085
3763
  else if (status === 404) {
3086
3764
  const _responseText = response.data;
@@ -3089,13 +3767,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3089
3767
  result404 = JSON.parse(resultData404);
3090
3768
  return throwException("Not Found", status, _responseText, _headers, result404);
3091
3769
  }
3092
- else if (status === 409) {
3093
- const _responseText = response.data;
3094
- let result409 = null;
3095
- let resultData409 = _responseText;
3096
- result409 = JSON.parse(resultData409);
3097
- return throwException("Conflict", status, _responseText, _headers, result409);
3098
- }
3099
3770
  else if (status === 401) {
3100
3771
  const _responseText = response.data;
3101
3772
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3111,20 +3782,18 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3111
3782
  return Promise.resolve(null);
3112
3783
  }
3113
3784
  /**
3114
- * Loads a toggle set from design file taken from storage.
3785
+ * Deletes variable data printing information from design file and updates design in storage.
3115
3786
  * @param id Design identifier.
3116
3787
  * @param privateStorageOwner (optional) Private storage owner identifier.
3117
3788
  * @param tenantId (optional) Tenant identifier
3118
3789
  * @return Success
3119
3790
  */
3120
- loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
3121
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
3791
+ deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3792
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3122
3793
  if (id === undefined || id === null)
3123
3794
  throw new Error("The parameter 'id' must be defined.");
3124
3795
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3125
- if (privateStorageOwner === null)
3126
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3127
- else if (privateStorageOwner !== undefined)
3796
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3128
3797
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3129
3798
  if (tenantId === null)
3130
3799
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -3132,12 +3801,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3132
3801
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3133
3802
  url_ = url_.replace(/[?&]$/, "");
3134
3803
  let options_ = {
3135
- responseType: "blob",
3136
- method: "GET",
3804
+ method: "DELETE",
3137
3805
  url: url_,
3138
- headers: {
3139
- "Accept": "application/octet-stream"
3140
- },
3806
+ headers: {},
3141
3807
  cancelToken
3142
3808
  };
3143
3809
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -3150,10 +3816,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3150
3816
  throw _error;
3151
3817
  }
3152
3818
  }).then((_response) => {
3153
- return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
3819
+ return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
3154
3820
  });
3155
3821
  }
3156
- processLoadToggleSet(response) {
3822
+ processDeleteVdpData(response) {
3157
3823
  const status = response.status;
3158
3824
  let _headers = {};
3159
3825
  if (response.headers && typeof response.headers === "object") {
@@ -3163,18 +3829,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3163
3829
  }
3164
3830
  }
3165
3831
  }
3166
- if (status === 200 || status === 206) {
3167
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3168
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3169
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3170
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3171
- }
3172
- else if (status === 404) {
3832
+ if (status === 200) {
3173
3833
  const _responseText = response.data;
3174
- let result404 = null;
3175
- let resultData404 = _responseText;
3176
- result404 = JSON.parse(resultData404);
3177
- return throwException("Not Found", status, _responseText, _headers, result404);
3834
+ return Promise.resolve(null);
3178
3835
  }
3179
3836
  else if (status === 409) {
3180
3837
  const _responseText = response.data;
@@ -3198,20 +3855,18 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3198
3855
  return Promise.resolve(null);
3199
3856
  }
3200
3857
  /**
3201
- * Gets variable items information for design file taken from storage.
3202
- * @param id Design identifier.
3858
+ * Loads product (design model) from resource file taken from storage.
3859
+ * @param id Resource identifier.
3203
3860
  * @param privateStorageOwner (optional) Private storage owner identifier.
3204
3861
  * @param tenantId (optional) Tenant identifier
3205
3862
  * @return Success
3206
3863
  */
3207
- getVariables(id, privateStorageOwner, tenantId, cancelToken) {
3208
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
3864
+ loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
3865
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
3209
3866
  if (id === undefined || id === null)
3210
3867
  throw new Error("The parameter 'id' must be defined.");
3211
3868
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3212
- if (privateStorageOwner === null)
3213
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3214
- else if (privateStorageOwner !== undefined)
3869
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3215
3870
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3216
3871
  if (tenantId === null)
3217
3872
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -3236,10 +3891,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3236
3891
  throw _error;
3237
3892
  }
3238
3893
  }).then((_response) => {
3239
- return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
3894
+ return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
3240
3895
  });
3241
3896
  }
3242
- processGetVariables(response) {
3897
+ processLoadProductFromResource(response) {
3243
3898
  const status = response.status;
3244
3899
  let _headers = {};
3245
3900
  if (response.headers && typeof response.headers === "object") {
@@ -3263,6 +3918,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3263
3918
  result404 = JSON.parse(resultData404);
3264
3919
  return throwException("Not Found", status, _responseText, _headers, result404);
3265
3920
  }
3921
+ else if (status === 422) {
3922
+ const _responseText = response.data;
3923
+ let result422 = null;
3924
+ let resultData422 = _responseText;
3925
+ result422 = JSON.parse(resultData422);
3926
+ return throwException("Client Error", status, _responseText, _headers, result422);
3927
+ }
3266
3928
  else if (status === 401) {
3267
3929
  const _responseText = response.data;
3268
3930
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3278,22 +3940,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3278
3940
  return Promise.resolve(null);
3279
3941
  }
3280
3942
  /**
3281
- * Sets variable items values for design file taken from storage.
3282
- * @param id Design identifier.
3283
- * @param privateStorageOwner (optional) Private storage owner identifier.
3943
+ * Converts colors.
3284
3944
  * @param tenantId (optional) Tenant identifier
3285
- * @param body (optional) Design variable values.
3945
+ * @param body (optional) Convert colors operation parameters.
3286
3946
  * @return Success
3287
3947
  */
3288
- setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
3289
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
3290
- if (id === undefined || id === null)
3291
- throw new Error("The parameter 'id' must be defined.");
3292
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3293
- if (privateStorageOwner === null)
3294
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3295
- else if (privateStorageOwner !== undefined)
3296
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3948
+ convertColors(tenantId, body, cancelToken) {
3949
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
3297
3950
  if (tenantId === null)
3298
3951
  throw new Error("The parameter 'tenantId' cannot be null.");
3299
3952
  else if (tenantId !== undefined)
@@ -3302,10 +3955,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3302
3955
  const content_ = JSON.stringify(body);
3303
3956
  let options_ = {
3304
3957
  data: content_,
3305
- method: "PUT",
3958
+ method: "POST",
3306
3959
  url: url_,
3307
3960
  headers: {
3308
3961
  "Content-Type": "application/json",
3962
+ "Accept": "application/json"
3309
3963
  },
3310
3964
  cancelToken
3311
3965
  };
@@ -3319,10 +3973,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3319
3973
  throw _error;
3320
3974
  }
3321
3975
  }).then((_response) => {
3322
- return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
3976
+ return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
3323
3977
  });
3324
3978
  }
3325
- processSetVariables(response) {
3979
+ processConvertColors(response) {
3326
3980
  const status = response.status;
3327
3981
  let _headers = {};
3328
3982
  if (response.headers && typeof response.headers === "object") {
@@ -3334,7 +3988,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3334
3988
  }
3335
3989
  if (status === 200) {
3336
3990
  const _responseText = response.data;
3337
- return Promise.resolve(null);
3991
+ let result200 = null;
3992
+ let resultData200 = _responseText;
3993
+ result200 = JSON.parse(resultData200);
3994
+ return Promise.resolve(result200);
3338
3995
  }
3339
3996
  else if (status === 404) {
3340
3997
  const _responseText = response.data;
@@ -3343,13 +4000,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3343
4000
  result404 = JSON.parse(resultData404);
3344
4001
  return throwException("Not Found", status, _responseText, _headers, result404);
3345
4002
  }
3346
- else if (status === 409) {
3347
- const _responseText = response.data;
3348
- let result409 = null;
3349
- let resultData409 = _responseText;
3350
- result409 = JSON.parse(resultData409);
3351
- return throwException("Conflict", status, _responseText, _headers, result409);
3352
- }
3353
4003
  else if (status === 401) {
3354
4004
  const _responseText = response.data;
3355
4005
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3365,31 +4015,27 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3365
4015
  return Promise.resolve(null);
3366
4016
  }
3367
4017
  /**
3368
- * Loads variable data printing information from design file taken from storage.
3369
- * @param id Design identifier.
3370
- * @param privateStorageOwner (optional) Private storage owner identifier.
4018
+ * Extracts product item image.
3371
4019
  * @param tenantId (optional) Tenant identifier
4020
+ * @param body (optional) Extraction parameters.
3372
4021
  * @return Success
3373
4022
  */
3374
- loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3375
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3376
- if (id === undefined || id === null)
3377
- throw new Error("The parameter 'id' must be defined.");
3378
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3379
- if (privateStorageOwner === null)
3380
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3381
- else if (privateStorageOwner !== undefined)
3382
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4023
+ extractItemImage(tenantId, body, cancelToken) {
4024
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
3383
4025
  if (tenantId === null)
3384
4026
  throw new Error("The parameter 'tenantId' cannot be null.");
3385
4027
  else if (tenantId !== undefined)
3386
4028
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3387
4029
  url_ = url_.replace(/[?&]$/, "");
4030
+ const content_ = JSON.stringify(body);
3388
4031
  let options_ = {
3389
- method: "GET",
4032
+ data: content_,
4033
+ responseType: "blob",
4034
+ method: "POST",
3390
4035
  url: url_,
3391
4036
  headers: {
3392
- "Accept": "application/json"
4037
+ "Content-Type": "application/json",
4038
+ "Accept": "application/octet-stream"
3393
4039
  },
3394
4040
  cancelToken
3395
4041
  };
@@ -3403,10 +4049,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3403
4049
  throw _error;
3404
4050
  }
3405
4051
  }).then((_response) => {
3406
- return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
4052
+ return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
3407
4053
  });
3408
4054
  }
3409
- processLoadVdpData(response) {
4055
+ processExtractItemImage(response) {
3410
4056
  const status = response.status;
3411
4057
  let _headers = {};
3412
4058
  if (response.headers && typeof response.headers === "object") {
@@ -3416,26 +4062,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3416
4062
  }
3417
4063
  }
3418
4064
  }
3419
- if (status === 200) {
3420
- const _responseText = response.data;
3421
- let result200 = null;
3422
- let resultData200 = _responseText;
3423
- result200 = JSON.parse(resultData200);
3424
- return Promise.resolve(result200);
3425
- }
3426
- else if (status === 404) {
3427
- const _responseText = response.data;
3428
- let result404 = null;
3429
- let resultData404 = _responseText;
3430
- result404 = JSON.parse(resultData404);
3431
- return throwException("Not Found", status, _responseText, _headers, result404);
3432
- }
3433
- else if (status === 409) {
3434
- const _responseText = response.data;
3435
- let result409 = null;
3436
- let resultData409 = _responseText;
3437
- result409 = JSON.parse(resultData409);
3438
- return throwException("Conflict", status, _responseText, _headers, result409);
4065
+ if (status === 200 || status === 206) {
4066
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
4067
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4068
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4069
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3439
4070
  }
3440
4071
  else if (status === 401) {
3441
4072
  const _responseText = response.data;
@@ -3452,22 +4083,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3452
4083
  return Promise.resolve(null);
3453
4084
  }
3454
4085
  /**
3455
- * Saves variable data printing information to design file and updates design in storage.
3456
- * @param id Design identifier.
3457
- * @param privateStorageOwner (optional) Private storage owner identifier.
4086
+ * Flatten items.
3458
4087
  * @param tenantId (optional) Tenant identifier
3459
- * @param body (optional) Serialized vdp data.
4088
+ * @param body (optional) Items to flatten.
3460
4089
  * @return Success
3461
- */
3462
- saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
3463
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3464
- if (id === undefined || id === null)
3465
- throw new Error("The parameter 'id' must be defined.");
3466
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3467
- if (privateStorageOwner === null)
3468
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3469
- else if (privateStorageOwner !== undefined)
3470
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4090
+ */
4091
+ flattenItems(tenantId, body, cancelToken) {
4092
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
3471
4093
  if (tenantId === null)
3472
4094
  throw new Error("The parameter 'tenantId' cannot be null.");
3473
4095
  else if (tenantId !== undefined)
@@ -3476,10 +4098,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3476
4098
  const content_ = JSON.stringify(body);
3477
4099
  let options_ = {
3478
4100
  data: content_,
3479
- method: "PUT",
4101
+ method: "POST",
3480
4102
  url: url_,
3481
4103
  headers: {
3482
4104
  "Content-Type": "application/json",
4105
+ "Accept": "application/json"
3483
4106
  },
3484
4107
  cancelToken
3485
4108
  };
@@ -3493,10 +4116,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3493
4116
  throw _error;
3494
4117
  }
3495
4118
  }).then((_response) => {
3496
- return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
4119
+ return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
3497
4120
  });
3498
4121
  }
3499
- processSaveVdpData(response) {
4122
+ processFlattenItems(response) {
3500
4123
  const status = response.status;
3501
4124
  let _headers = {};
3502
4125
  if (response.headers && typeof response.headers === "object") {
@@ -3508,14 +4131,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3508
4131
  }
3509
4132
  if (status === 200) {
3510
4133
  const _responseText = response.data;
3511
- return Promise.resolve(null);
3512
- }
3513
- else if (status === 404) {
3514
- const _responseText = response.data;
3515
- let result404 = null;
3516
- let resultData404 = _responseText;
3517
- result404 = JSON.parse(resultData404);
3518
- return throwException("Not Found", status, _responseText, _headers, result404);
4134
+ let result200 = null;
4135
+ let resultData200 = _responseText;
4136
+ result200 = JSON.parse(resultData200);
4137
+ return Promise.resolve(result200);
3519
4138
  }
3520
4139
  else if (status === 401) {
3521
4140
  const _responseText = response.data;
@@ -3532,30 +4151,31 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3532
4151
  return Promise.resolve(null);
3533
4152
  }
3534
4153
  /**
3535
- * Deletes variable data printing information from design file and updates design in storage.
3536
- * @param id Design identifier.
3537
- * @param privateStorageOwner (optional) Private storage owner identifier.
4154
+ * Creates product item from input image file.
4155
+ * @param itemType (optional) Desired item type.
3538
4156
  * @param tenantId (optional) Tenant identifier
4157
+ * @param sourceFile (optional)
3539
4158
  * @return Success
3540
4159
  */
3541
- deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3542
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3543
- if (id === undefined || id === null)
3544
- throw new Error("The parameter 'id' must be defined.");
3545
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3546
- if (privateStorageOwner === null)
3547
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3548
- else if (privateStorageOwner !== undefined)
3549
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4160
+ createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
4161
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
4162
+ if (itemType !== undefined && itemType !== null)
4163
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3550
4164
  if (tenantId === null)
3551
4165
  throw new Error("The parameter 'tenantId' cannot be null.");
3552
4166
  else if (tenantId !== undefined)
3553
4167
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3554
4168
  url_ = url_.replace(/[?&]$/, "");
4169
+ const content_ = new FormData();
4170
+ if (sourceFile !== null && sourceFile !== undefined)
4171
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
3555
4172
  let options_ = {
3556
- method: "DELETE",
4173
+ data: content_,
4174
+ method: "POST",
3557
4175
  url: url_,
3558
- headers: {},
4176
+ headers: {
4177
+ "Accept": "application/json"
4178
+ },
3559
4179
  cancelToken
3560
4180
  };
3561
4181
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -3568,10 +4188,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3568
4188
  throw _error;
3569
4189
  }
3570
4190
  }).then((_response) => {
3571
- return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
4191
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
3572
4192
  });
3573
4193
  }
3574
- processDeleteVdpData(response) {
4194
+ processCreateItemFromFile(response) {
3575
4195
  const status = response.status;
3576
4196
  let _headers = {};
3577
4197
  if (response.headers && typeof response.headers === "object") {
@@ -3583,14 +4203,17 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3583
4203
  }
3584
4204
  if (status === 200) {
3585
4205
  const _responseText = response.data;
3586
- return Promise.resolve(null);
4206
+ let result200 = null;
4207
+ let resultData200 = _responseText;
4208
+ result200 = JSON.parse(resultData200);
4209
+ return Promise.resolve(result200);
3587
4210
  }
3588
- else if (status === 409) {
4211
+ else if (status === 404) {
3589
4212
  const _responseText = response.data;
3590
- let result409 = null;
3591
- let resultData409 = _responseText;
3592
- result409 = JSON.parse(resultData409);
3593
- return throwException("Conflict", status, _responseText, _headers, result409);
4213
+ let result404 = null;
4214
+ let resultData404 = _responseText;
4215
+ result404 = JSON.parse(resultData404);
4216
+ return throwException("Not Found", status, _responseText, _headers, result404);
3594
4217
  }
3595
4218
  else if (status === 401) {
3596
4219
  const _responseText = response.data;
@@ -3607,28 +4230,27 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3607
4230
  return Promise.resolve(null);
3608
4231
  }
3609
4232
  /**
3610
- * Loads product (design model) from resource file taken from storage.
3611
- * @param id Resource identifier.
3612
- * @param privateStorageOwner (optional) Private storage owner identifier.
4233
+ * Creates multiple product items from input image files.
4234
+ * @param itemType (optional) Desired items type.
3613
4235
  * @param tenantId (optional) Tenant identifier
4236
+ * @param sourceFiles (optional)
3614
4237
  * @return Success
3615
4238
  */
3616
- loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
3617
- let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
3618
- if (id === undefined || id === null)
3619
- throw new Error("The parameter 'id' must be defined.");
3620
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3621
- if (privateStorageOwner === null)
3622
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
3623
- else if (privateStorageOwner !== undefined)
3624
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4239
+ batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
4240
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
4241
+ if (itemType !== undefined && itemType !== null)
4242
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3625
4243
  if (tenantId === null)
3626
4244
  throw new Error("The parameter 'tenantId' cannot be null.");
3627
4245
  else if (tenantId !== undefined)
3628
4246
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3629
4247
  url_ = url_.replace(/[?&]$/, "");
4248
+ const content_ = new FormData();
4249
+ if (sourceFiles !== null && sourceFiles !== undefined)
4250
+ sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
3630
4251
  let options_ = {
3631
- method: "GET",
4252
+ data: content_,
4253
+ method: "POST",
3632
4254
  url: url_,
3633
4255
  headers: {
3634
4256
  "Accept": "application/json"
@@ -3645,10 +4267,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3645
4267
  throw _error;
3646
4268
  }
3647
4269
  }).then((_response) => {
3648
- return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
4270
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
3649
4271
  });
3650
4272
  }
3651
- processLoadProductFromResource(response) {
4273
+ processBatchCreateItemsFromFile(response) {
3652
4274
  const status = response.status;
3653
4275
  let _headers = {};
3654
4276
  if (response.headers && typeof response.headers === "object") {
@@ -3672,13 +4294,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3672
4294
  result404 = JSON.parse(resultData404);
3673
4295
  return throwException("Not Found", status, _responseText, _headers, result404);
3674
4296
  }
3675
- else if (status === 422) {
3676
- const _responseText = response.data;
3677
- let result422 = null;
3678
- let resultData422 = _responseText;
3679
- result422 = JSON.parse(resultData422);
3680
- return throwException("Client Error", status, _responseText, _headers, result422);
3681
- }
3682
4297
  else if (status === 401) {
3683
4298
  const _responseText = response.data;
3684
4299
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3694,13 +4309,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3694
4309
  return Promise.resolve(null);
3695
4310
  }
3696
4311
  /**
3697
- * Converts colors.
4312
+ * Creates product item from image in storage.
4313
+ * @param itemType (optional) Desired item type.
3698
4314
  * @param tenantId (optional) Tenant identifier
3699
- * @param body (optional) Convert colors operation parameters.
4315
+ * @param body (optional) Operation parameters.
3700
4316
  * @return Success
3701
4317
  */
3702
- convertColors(tenantId, body, cancelToken) {
3703
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
4318
+ createItemFromStorage(itemType, tenantId, body, cancelToken) {
4319
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
4320
+ if (itemType !== undefined && itemType !== null)
4321
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3704
4322
  if (tenantId === null)
3705
4323
  throw new Error("The parameter 'tenantId' cannot be null.");
3706
4324
  else if (tenantId !== undefined)
@@ -3727,10 +4345,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3727
4345
  throw _error;
3728
4346
  }
3729
4347
  }).then((_response) => {
3730
- return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
4348
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
3731
4349
  });
3732
4350
  }
3733
- processConvertColors(response) {
4351
+ processCreateItemFromStorage(response) {
3734
4352
  const status = response.status;
3735
4353
  let _headers = {};
3736
4354
  if (response.headers && typeof response.headers === "object") {
@@ -3769,40 +4387,28 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3769
4387
  return Promise.resolve(null);
3770
4388
  }
3771
4389
  /**
3772
- * Creates product item.
3773
- * @param itemType (optional) Desired item type.
4390
+ * Creates multiple product items from images in storage.
4391
+ * @param itemType (optional) Desired items type.
3774
4392
  * @param tenantId (optional) Tenant identifier
3775
- * @param sourceType (optional)
3776
- * @param sourceId (optional)
3777
- * @param sourceOwnerId (optional)
3778
- * @param sourceFile (optional)
4393
+ * @param body (optional) Create items operation parameters.
3779
4394
  * @return Success
3780
4395
  */
3781
- createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, sourceFile, cancelToken) {
3782
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
3783
- if (itemType === null)
3784
- throw new Error("The parameter 'itemType' cannot be null.");
3785
- else if (itemType !== undefined)
4396
+ batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
4397
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
4398
+ if (itemType !== undefined && itemType !== null)
3786
4399
  url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3787
4400
  if (tenantId === null)
3788
4401
  throw new Error("The parameter 'tenantId' cannot be null.");
3789
4402
  else if (tenantId !== undefined)
3790
4403
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3791
4404
  url_ = url_.replace(/[?&]$/, "");
3792
- const content_ = new FormData();
3793
- if (sourceType !== null && sourceType !== undefined)
3794
- content_.append("sourceType", sourceType.toString());
3795
- if (sourceId !== null && sourceId !== undefined)
3796
- content_.append("sourceId", sourceId.toString());
3797
- if (sourceOwnerId !== null && sourceOwnerId !== undefined)
3798
- content_.append("sourceOwnerId", sourceOwnerId.toString());
3799
- if (sourceFile !== null && sourceFile !== undefined)
3800
- content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4405
+ const content_ = JSON.stringify(body);
3801
4406
  let options_ = {
3802
4407
  data: content_,
3803
4408
  method: "POST",
3804
4409
  url: url_,
3805
4410
  headers: {
4411
+ "Content-Type": "application/json",
3806
4412
  "Accept": "application/json"
3807
4413
  },
3808
4414
  cancelToken
@@ -3817,10 +4423,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3817
4423
  throw _error;
3818
4424
  }
3819
4425
  }).then((_response) => {
3820
- return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
4426
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
3821
4427
  });
3822
4428
  }
3823
- processCreateItem(response) {
4429
+ processBatchCreateItemsFromStorage(response) {
3824
4430
  const status = response.status;
3825
4431
  let _headers = {};
3826
4432
  if (response.headers && typeof response.headers === "object") {
@@ -3859,13 +4465,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3859
4465
  return Promise.resolve(null);
3860
4466
  }
3861
4467
  /**
3862
- * Extracts product item image.
4468
+ * Creates product item from remote web image provided by URL.
4469
+ * @param itemType (optional) Desired item type.
3863
4470
  * @param tenantId (optional) Tenant identifier
3864
- * @param body (optional) Extraction parameters.
4471
+ * @param body (optional) Operation parameters.
3865
4472
  * @return Success
3866
4473
  */
3867
- extractItemImage(tenantId, body, cancelToken) {
3868
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
4474
+ createItemFromUrl(itemType, tenantId, body, cancelToken) {
4475
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
4476
+ if (itemType !== undefined && itemType !== null)
4477
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3869
4478
  if (tenantId === null)
3870
4479
  throw new Error("The parameter 'tenantId' cannot be null.");
3871
4480
  else if (tenantId !== undefined)
@@ -3874,12 +4483,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3874
4483
  const content_ = JSON.stringify(body);
3875
4484
  let options_ = {
3876
4485
  data: content_,
3877
- responseType: "blob",
3878
4486
  method: "POST",
3879
4487
  url: url_,
3880
4488
  headers: {
3881
4489
  "Content-Type": "application/json",
3882
- "Accept": "application/octet-stream"
4490
+ "Accept": "application/json"
3883
4491
  },
3884
4492
  cancelToken
3885
4493
  };
@@ -3893,10 +4501,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3893
4501
  throw _error;
3894
4502
  }
3895
4503
  }).then((_response) => {
3896
- return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
4504
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
3897
4505
  });
3898
4506
  }
3899
- processExtractItemImage(response) {
4507
+ processCreateItemFromUrl(response) {
3900
4508
  const status = response.status;
3901
4509
  let _headers = {};
3902
4510
  if (response.headers && typeof response.headers === "object") {
@@ -3906,11 +4514,19 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3906
4514
  }
3907
4515
  }
3908
4516
  }
3909
- if (status === 200 || status === 206) {
3910
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3911
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3912
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3913
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
4517
+ if (status === 200) {
4518
+ const _responseText = response.data;
4519
+ let result200 = null;
4520
+ let resultData200 = _responseText;
4521
+ result200 = JSON.parse(resultData200);
4522
+ return Promise.resolve(result200);
4523
+ }
4524
+ else if (status === 404) {
4525
+ const _responseText = response.data;
4526
+ let result404 = null;
4527
+ let resultData404 = _responseText;
4528
+ result404 = JSON.parse(resultData404);
4529
+ return throwException("Not Found", status, _responseText, _headers, result404);
3914
4530
  }
3915
4531
  else if (status === 401) {
3916
4532
  const _responseText = response.data;
@@ -3927,13 +4543,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3927
4543
  return Promise.resolve(null);
3928
4544
  }
3929
4545
  /**
3930
- * Flatten items.
4546
+ * Creates multiple product items from remote web images provided by URLs list.
4547
+ * @param itemType (optional) Desired items type.
3931
4548
  * @param tenantId (optional) Tenant identifier
3932
- * @param body (optional) Items to flatten.
4549
+ * @param body (optional) Operation parameters.
3933
4550
  * @return Success
3934
4551
  */
3935
- flattenItems(tenantId, body, cancelToken) {
3936
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
4552
+ batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
4553
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
4554
+ if (itemType !== undefined && itemType !== null)
4555
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
3937
4556
  if (tenantId === null)
3938
4557
  throw new Error("The parameter 'tenantId' cannot be null.");
3939
4558
  else if (tenantId !== undefined)
@@ -3960,10 +4579,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3960
4579
  throw _error;
3961
4580
  }
3962
4581
  }).then((_response) => {
3963
- return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
4582
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
3964
4583
  });
3965
4584
  }
3966
- processFlattenItems(response) {
4585
+ processBatchCreateItemsFromUrl(response) {
3967
4586
  const status = response.status;
3968
4587
  let _headers = {};
3969
4588
  if (response.headers && typeof response.headers === "object") {
@@ -3980,6 +4599,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3980
4599
  result200 = JSON.parse(resultData200);
3981
4600
  return Promise.resolve(result200);
3982
4601
  }
4602
+ else if (status === 404) {
4603
+ const _responseText = response.data;
4604
+ let result404 = null;
4605
+ let resultData404 = _responseText;
4606
+ result404 = JSON.parse(resultData404);
4607
+ return throwException("Not Found", status, _responseText, _headers, result404);
4608
+ }
3983
4609
  else if (status === 401) {
3984
4610
  const _responseText = response.data;
3985
4611
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4004,9 +4630,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4004
4630
  */
4005
4631
  renderProduct(attachment, tenantId, body, cancelToken) {
4006
4632
  let url_ = this.baseUrl + "/api/atoms/v1/designs/model/render-proof?";
4007
- if (attachment === null)
4008
- throw new Error("The parameter 'attachment' cannot be null.");
4009
- else if (attachment !== undefined)
4633
+ if (attachment !== undefined && attachment !== null)
4010
4634
  url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
4011
4635
  if (tenantId === null)
4012
4636
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -4078,9 +4702,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4078
4702
  */
4079
4703
  renderDesignPreview(attachment, tenantId, body, cancelToken) {
4080
4704
  let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
4081
- if (attachment === null)
4082
- throw new Error("The parameter 'attachment' cannot be null.");
4083
- else if (attachment !== undefined)
4705
+ if (attachment !== undefined && attachment !== null)
4084
4706
  url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
4085
4707
  if (tenantId === null)
4086
4708
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -4196,6 +4818,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4196
4818
  result200 = JSON.parse(resultData200);
4197
4819
  return Promise.resolve(result200);
4198
4820
  }
4821
+ else if (status === 409) {
4822
+ const _responseText = response.data;
4823
+ let result409 = null;
4824
+ let resultData409 = _responseText;
4825
+ result409 = JSON.parse(resultData409);
4826
+ return throwException("Conflict", status, _responseText, _headers, result409);
4827
+ }
4199
4828
  else if (status === 401) {
4200
4829
  const _responseText = response.data;
4201
4830
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4220,9 +4849,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4220
4849
  */
4221
4850
  renderDesignProof(attachment, tenantId, body, cancelToken) {
4222
4851
  let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
4223
- if (attachment === null)
4224
- throw new Error("The parameter 'attachment' cannot be null.");
4225
- else if (attachment !== undefined)
4852
+ if (attachment !== undefined && attachment !== null)
4226
4853
  url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
4227
4854
  if (tenantId === null)
4228
4855
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -4338,6 +4965,105 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4338
4965
  result200 = JSON.parse(resultData200);
4339
4966
  return Promise.resolve(result200);
4340
4967
  }
4968
+ else if (status === 409) {
4969
+ const _responseText = response.data;
4970
+ let result409 = null;
4971
+ let resultData409 = _responseText;
4972
+ result409 = JSON.parse(resultData409);
4973
+ return throwException("Conflict", status, _responseText, _headers, result409);
4974
+ }
4975
+ else if (status === 401) {
4976
+ const _responseText = response.data;
4977
+ return throwException("Unauthorized", status, _responseText, _headers);
4978
+ }
4979
+ else if (status === 403) {
4980
+ const _responseText = response.data;
4981
+ return throwException("Forbidden", status, _responseText, _headers);
4982
+ }
4983
+ else if (status !== 200 && status !== 204) {
4984
+ const _responseText = response.data;
4985
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4986
+ }
4987
+ return Promise.resolve(null);
4988
+ }
4989
+ /**
4990
+ * Creates product item.
4991
+ * @param itemType (optional) Desired item type.
4992
+ * @param tenantId (optional) Tenant identifier
4993
+ * @param sourceType (optional)
4994
+ * @param sourceId (optional)
4995
+ * @param sourceOwnerId (optional)
4996
+ * @param url (optional)
4997
+ * @param sourceFile (optional)
4998
+ * @return Success
4999
+ * @deprecated
5000
+ */
5001
+ createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
5002
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
5003
+ if (itemType !== undefined && itemType !== null)
5004
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5005
+ if (tenantId === null)
5006
+ throw new Error("The parameter 'tenantId' cannot be null.");
5007
+ else if (tenantId !== undefined)
5008
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5009
+ url_ = url_.replace(/[?&]$/, "");
5010
+ const content_ = new FormData();
5011
+ if (sourceType !== null && sourceType !== undefined)
5012
+ content_.append("sourceType", sourceType.toString());
5013
+ if (sourceId !== null && sourceId !== undefined)
5014
+ content_.append("sourceId", sourceId.toString());
5015
+ if (sourceOwnerId !== null && sourceOwnerId !== undefined)
5016
+ content_.append("sourceOwnerId", sourceOwnerId.toString());
5017
+ if (url !== null && url !== undefined)
5018
+ content_.append("url", url.toString());
5019
+ if (sourceFile !== null && sourceFile !== undefined)
5020
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
5021
+ let options_ = {
5022
+ data: content_,
5023
+ method: "POST",
5024
+ url: url_,
5025
+ headers: {
5026
+ "Accept": "application/json"
5027
+ },
5028
+ cancelToken
5029
+ };
5030
+ return this.transformOptions(options_).then(transformedOptions_ => {
5031
+ return this.instance.request(transformedOptions_);
5032
+ }).catch((_error) => {
5033
+ if (isAxiosError(_error) && _error.response) {
5034
+ return _error.response;
5035
+ }
5036
+ else {
5037
+ throw _error;
5038
+ }
5039
+ }).then((_response) => {
5040
+ return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
5041
+ });
5042
+ }
5043
+ processCreateItem(response) {
5044
+ const status = response.status;
5045
+ let _headers = {};
5046
+ if (response.headers && typeof response.headers === "object") {
5047
+ for (let k in response.headers) {
5048
+ if (response.headers.hasOwnProperty(k)) {
5049
+ _headers[k] = response.headers[k];
5050
+ }
5051
+ }
5052
+ }
5053
+ if (status === 200) {
5054
+ const _responseText = response.data;
5055
+ let result200 = null;
5056
+ let resultData200 = _responseText;
5057
+ result200 = JSON.parse(resultData200);
5058
+ return Promise.resolve(result200);
5059
+ }
5060
+ else if (status === 404) {
5061
+ const _responseText = response.data;
5062
+ let result404 = null;
5063
+ let resultData404 = _responseText;
5064
+ result404 = JSON.parse(resultData404);
5065
+ return throwException("Not Found", status, _responseText, _headers, result404);
5066
+ }
4341
5067
  else if (status === 401) {
4342
5068
  const _responseText = response.data;
4343
5069
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4363,17 +5089,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4363
5089
  */
4364
5090
  createPrivateDesignFromDesign(designId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
4365
5091
  let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-design?";
4366
- if (designId === null)
4367
- throw new Error("The parameter 'designId' cannot be null.");
4368
- else if (designId !== undefined)
5092
+ if (designId !== undefined && designId !== null)
4369
5093
  url_ += "designId=" + encodeURIComponent("" + designId) + "&";
4370
- if (privateDesignId === null)
4371
- throw new Error("The parameter 'privateDesignId' cannot be null.");
4372
- else if (privateDesignId !== undefined)
5094
+ if (privateDesignId !== undefined && privateDesignId !== null)
4373
5095
  url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
4374
- if (privateStorageOwner === null)
4375
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
4376
- else if (privateStorageOwner !== undefined)
5096
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4377
5097
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4378
5098
  if (tenantId === null)
4379
5099
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -4438,17 +5158,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4438
5158
  */
4439
5159
  createPrivateDesignFromResource(resourceId, privateDesignId, privateStorageOwner, tenantId, cancelToken) {
4440
5160
  let url_ = this.baseUrl + "/api/atoms/v1/private-designs/from-resource?";
4441
- if (resourceId === null)
4442
- throw new Error("The parameter 'resourceId' cannot be null.");
4443
- else if (resourceId !== undefined)
5161
+ if (resourceId !== undefined && resourceId !== null)
4444
5162
  url_ += "resourceId=" + encodeURIComponent("" + resourceId) + "&";
4445
- if (privateDesignId === null)
4446
- throw new Error("The parameter 'privateDesignId' cannot be null.");
4447
- else if (privateDesignId !== undefined)
5163
+ if (privateDesignId !== undefined && privateDesignId !== null)
4448
5164
  url_ += "privateDesignId=" + encodeURIComponent("" + privateDesignId) + "&";
4449
- if (privateStorageOwner === null)
4450
- throw new Error("The parameter 'privateStorageOwner' cannot be null.");
4451
- else if (privateStorageOwner !== undefined)
5165
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4452
5166
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4453
5167
  if (tenantId === null)
4454
5168
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -4793,9 +5507,7 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
4793
5507
  */
4794
5508
  getCssFont(fontKey, tenantId, cancelToken) {
4795
5509
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/GetCssFont?";
4796
- if (fontKey === null)
4797
- throw new Error("The parameter 'fontKey' cannot be null.");
4798
- else if (fontKey !== undefined)
5510
+ if (fontKey !== undefined && fontKey !== null)
4799
5511
  url_ += "fontKey=" + encodeURIComponent("" + fontKey) + "&";
4800
5512
  if (tenantId === null)
4801
5513
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -5149,77 +5861,41 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
5149
5861
  */
5150
5862
  img(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
5151
5863
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/img?";
5152
- if (f === null)
5153
- throw new Error("The parameter 'f' cannot be null.");
5154
- else if (f !== undefined)
5864
+ if (f !== undefined && f !== null)
5155
5865
  url_ += "f=" + encodeURIComponent("" + f) + "&";
5156
- if (w === null)
5157
- throw new Error("The parameter 'w' cannot be null.");
5158
- else if (w !== undefined)
5866
+ if (w !== undefined && w !== null)
5159
5867
  url_ += "w=" + encodeURIComponent("" + w) + "&";
5160
- if (h === null)
5161
- throw new Error("The parameter 'h' cannot be null.");
5162
- else if (h !== undefined)
5868
+ if (h !== undefined && h !== null)
5163
5869
  url_ += "h=" + encodeURIComponent("" + h) + "&";
5164
- if (cmyk === null)
5165
- throw new Error("The parameter 'cmyk' cannot be null.");
5166
- else if (cmyk !== undefined)
5870
+ if (cmyk !== undefined && cmyk !== null)
5167
5871
  url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
5168
- if (rgb === null)
5169
- throw new Error("The parameter 'rgb' cannot be null.");
5170
- else if (rgb !== undefined)
5872
+ if (rgb !== undefined && rgb !== null)
5171
5873
  url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
5172
- if (grayscale === null)
5173
- throw new Error("The parameter 'grayscale' cannot be null.");
5174
- else if (grayscale !== undefined)
5874
+ if (grayscale !== undefined && grayscale !== null)
5175
5875
  url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
5176
- if (target === null)
5177
- throw new Error("The parameter 'target' cannot be null.");
5178
- else if (target !== undefined)
5876
+ if (target !== undefined && target !== null)
5179
5877
  url_ += "target=" + encodeURIComponent("" + target) + "&";
5180
- if (sq === null)
5181
- throw new Error("The parameter 'sq' cannot be null.");
5182
- else if (sq !== undefined)
5878
+ if (sq !== undefined && sq !== null)
5183
5879
  url_ += "sq=" + encodeURIComponent("" + sq) + "&";
5184
- if (effect === null)
5185
- throw new Error("The parameter 'effect' cannot be null.");
5186
- else if (effect !== undefined)
5880
+ if (effect !== undefined && effect !== null)
5187
5881
  url_ += "effect=" + encodeURIComponent("" + effect) + "&";
5188
- if (kp === null)
5189
- throw new Error("The parameter 'kp' cannot be null.");
5190
- else if (kp !== undefined)
5882
+ if (kp !== undefined && kp !== null)
5191
5883
  url_ += "kp=" + encodeURIComponent("" + kp) + "&";
5192
- if (color === null)
5193
- throw new Error("The parameter 'color' cannot be null.");
5194
- else if (color !== undefined)
5884
+ if (color !== undefined && color !== null)
5195
5885
  url_ += "color=" + encodeURIComponent("" + color) + "&";
5196
- if (obm === null)
5197
- throw new Error("The parameter 'obm' cannot be null.");
5198
- else if (obm !== undefined)
5886
+ if (obm !== undefined && obm !== null)
5199
5887
  url_ += "obm=" + encodeURIComponent("" + obm) + "&";
5200
- if (oo === null)
5201
- throw new Error("The parameter 'oo' cannot be null.");
5202
- else if (oo !== undefined)
5888
+ if (oo !== undefined && oo !== null)
5203
5889
  url_ += "oo=" + encodeURIComponent("" + oo) + "&";
5204
- if (alphaMask === null)
5205
- throw new Error("The parameter 'alphaMask' cannot be null.");
5206
- else if (alphaMask !== undefined)
5890
+ if (alphaMask !== undefined && alphaMask !== null)
5207
5891
  url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
5208
- if (page === null)
5209
- throw new Error("The parameter 'page' cannot be null.");
5210
- else if (page !== undefined)
5892
+ if (page !== undefined && page !== null)
5211
5893
  url_ += "page=" + encodeURIComponent("" + page) + "&";
5212
- if (colorizeColor === null)
5213
- throw new Error("The parameter 'colorizeColor' cannot be null.");
5214
- else if (colorizeColor !== undefined)
5894
+ if (colorizeColor !== undefined && colorizeColor !== null)
5215
5895
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
5216
- if (rw === null)
5217
- throw new Error("The parameter 'rw' cannot be null.");
5218
- else if (rw !== undefined)
5896
+ if (rw !== undefined && rw !== null)
5219
5897
  url_ += "rw=" + encodeURIComponent("" + rw) + "&";
5220
- if (rh === null)
5221
- throw new Error("The parameter 'rh' cannot be null.");
5222
- else if (rh !== undefined)
5898
+ if (rh !== undefined && rh !== null)
5223
5899
  url_ += "rh=" + encodeURIComponent("" + rh) + "&";
5224
5900
  if (tenantId === null)
5225
5901
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -5359,9 +6035,7 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
5359
6035
  */
5360
6036
  pth(f, tenantId, cancelToken) {
5361
6037
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/pth?";
5362
- if (f === null)
5363
- throw new Error("The parameter 'f' cannot be null.");
5364
- else if (f !== undefined)
6038
+ if (f !== undefined && f !== null)
5365
6039
  url_ += "f=" + encodeURIComponent("" + f) + "&";
5366
6040
  if (tenantId === null)
5367
6041
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -5438,9 +6112,7 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
5438
6112
  */
5439
6113
  resource(image, tenantId, cancelToken) {
5440
6114
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/resource?";
5441
- if (image === null)
5442
- throw new Error("The parameter 'image' cannot be null.");
5443
- else if (image !== undefined)
6115
+ if (image !== undefined && image !== null)
5444
6116
  url_ += "image=" + encodeURIComponent("" + image) + "&";
5445
6117
  if (tenantId === null)
5446
6118
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -5530,77 +6202,41 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
5530
6202
  */
5531
6203
  svg(f, w, h, cmyk, rgb, grayscale, target, sq, effect, kp, color, obm, oo, alphaMask, page, colorizeColor, rw, rh, tenantId, cancelToken) {
5532
6204
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/svg?";
5533
- if (f === null)
5534
- throw new Error("The parameter 'f' cannot be null.");
5535
- else if (f !== undefined)
6205
+ if (f !== undefined && f !== null)
5536
6206
  url_ += "f=" + encodeURIComponent("" + f) + "&";
5537
- if (w === null)
5538
- throw new Error("The parameter 'w' cannot be null.");
5539
- else if (w !== undefined)
6207
+ if (w !== undefined && w !== null)
5540
6208
  url_ += "w=" + encodeURIComponent("" + w) + "&";
5541
- if (h === null)
5542
- throw new Error("The parameter 'h' cannot be null.");
5543
- else if (h !== undefined)
6209
+ if (h !== undefined && h !== null)
5544
6210
  url_ += "h=" + encodeURIComponent("" + h) + "&";
5545
- if (cmyk === null)
5546
- throw new Error("The parameter 'cmyk' cannot be null.");
5547
- else if (cmyk !== undefined)
6211
+ if (cmyk !== undefined && cmyk !== null)
5548
6212
  url_ += "cmyk=" + encodeURIComponent("" + cmyk) + "&";
5549
- if (rgb === null)
5550
- throw new Error("The parameter 'rgb' cannot be null.");
5551
- else if (rgb !== undefined)
6213
+ if (rgb !== undefined && rgb !== null)
5552
6214
  url_ += "rgb=" + encodeURIComponent("" + rgb) + "&";
5553
- if (grayscale === null)
5554
- throw new Error("The parameter 'grayscale' cannot be null.");
5555
- else if (grayscale !== undefined)
6215
+ if (grayscale !== undefined && grayscale !== null)
5556
6216
  url_ += "grayscale=" + encodeURIComponent("" + grayscale) + "&";
5557
- if (target === null)
5558
- throw new Error("The parameter 'target' cannot be null.");
5559
- else if (target !== undefined)
6217
+ if (target !== undefined && target !== null)
5560
6218
  url_ += "target=" + encodeURIComponent("" + target) + "&";
5561
- if (sq === null)
5562
- throw new Error("The parameter 'sq' cannot be null.");
5563
- else if (sq !== undefined)
6219
+ if (sq !== undefined && sq !== null)
5564
6220
  url_ += "sq=" + encodeURIComponent("" + sq) + "&";
5565
- if (effect === null)
5566
- throw new Error("The parameter 'effect' cannot be null.");
5567
- else if (effect !== undefined)
6221
+ if (effect !== undefined && effect !== null)
5568
6222
  url_ += "effect=" + encodeURIComponent("" + effect) + "&";
5569
- if (kp === null)
5570
- throw new Error("The parameter 'kp' cannot be null.");
5571
- else if (kp !== undefined)
6223
+ if (kp !== undefined && kp !== null)
5572
6224
  url_ += "kp=" + encodeURIComponent("" + kp) + "&";
5573
- if (color === null)
5574
- throw new Error("The parameter 'color' cannot be null.");
5575
- else if (color !== undefined)
6225
+ if (color !== undefined && color !== null)
5576
6226
  url_ += "color=" + encodeURIComponent("" + color) + "&";
5577
- if (obm === null)
5578
- throw new Error("The parameter 'obm' cannot be null.");
5579
- else if (obm !== undefined)
6227
+ if (obm !== undefined && obm !== null)
5580
6228
  url_ += "obm=" + encodeURIComponent("" + obm) + "&";
5581
- if (oo === null)
5582
- throw new Error("The parameter 'oo' cannot be null.");
5583
- else if (oo !== undefined)
6229
+ if (oo !== undefined && oo !== null)
5584
6230
  url_ += "oo=" + encodeURIComponent("" + oo) + "&";
5585
- if (alphaMask === null)
5586
- throw new Error("The parameter 'alphaMask' cannot be null.");
5587
- else if (alphaMask !== undefined)
6231
+ if (alphaMask !== undefined && alphaMask !== null)
5588
6232
  url_ += "alphaMask=" + encodeURIComponent("" + alphaMask) + "&";
5589
- if (page === null)
5590
- throw new Error("The parameter 'page' cannot be null.");
5591
- else if (page !== undefined)
6233
+ if (page !== undefined && page !== null)
5592
6234
  url_ += "page=" + encodeURIComponent("" + page) + "&";
5593
- if (colorizeColor === null)
5594
- throw new Error("The parameter 'colorizeColor' cannot be null.");
5595
- else if (colorizeColor !== undefined)
6235
+ if (colorizeColor !== undefined && colorizeColor !== null)
5596
6236
  url_ += "colorizeColor=" + encodeURIComponent("" + colorizeColor) + "&";
5597
- if (rw === null)
5598
- throw new Error("The parameter 'rw' cannot be null.");
5599
- else if (rw !== undefined)
6237
+ if (rw !== undefined && rw !== null)
5600
6238
  url_ += "rw=" + encodeURIComponent("" + rw) + "&";
5601
- if (rh === null)
5602
- throw new Error("The parameter 'rh' cannot be null.");
5603
- else if (rh !== undefined)
6239
+ if (rh !== undefined && rh !== null)
5604
6240
  url_ += "rh=" + encodeURIComponent("" + rh) + "&";
5605
6241
  if (tenantId === null)
5606
6242
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -5677,9 +6313,7 @@ export class DesignAtomsViewerApiClient extends ApiClientBase {
5677
6313
  */
5678
6314
  txt(f, tenantId, cancelToken) {
5679
6315
  let url_ = this.baseUrl + "/api/atoms/v1/ccviewer/txt?";
5680
- if (f === null)
5681
- throw new Error("The parameter 'f' cannot be null.");
5682
- else if (f !== undefined)
6316
+ if (f !== undefined && f !== null)
5683
6317
  url_ += "f=" + encodeURIComponent("" + f) + "&";
5684
6318
  if (tenantId === null)
5685
6319
  throw new Error("The parameter 'tenantId' cannot be null.");
@@ -6516,6 +7150,7 @@ export var ItemSourceType;
6516
7150
  ItemSourceType["File"] = "File";
6517
7151
  ItemSourceType["ImageStorage"] = "ImageStorage";
6518
7152
  ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
7153
+ ItemSourceType["Url"] = "Url";
6519
7154
  })(ItemSourceType || (ItemSourceType = {}));
6520
7155
  export var ItemType;
6521
7156
  (function (ItemType) {