@leonardo-ai/sdk 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -14
- package/dist/sdk/dataset.js +25 -25
- package/dist/sdk/element.js +5 -5
- package/dist/sdk/generation.js +30 -30
- package/dist/sdk/initimage.js +15 -15
- package/dist/sdk/model.js +30 -30
- package/dist/sdk/sdk.js +3 -3
- package/dist/sdk/user.js +5 -5
- package/dist/sdk/variation.js +20 -20
- package/docs/sdk/models/operations/createdatasetrequestbody.md +0 -0
- package/docs/sdk/models/operations/createdatasetresponse.md +0 -0
- package/docs/sdk/models/operations/createdatasetresponsebody.md +0 -0
- package/docs/sdk/models/operations/creategenerationrequestbody.md +0 -0
- package/docs/sdk/models/operations/creategenerationresponse.md +0 -0
- package/docs/sdk/models/operations/creategenerationresponsebody.md +0 -0
- package/docs/sdk/models/operations/createmodelrequestbody.md +0 -0
- package/docs/sdk/models/operations/createmodelresponse.md +0 -0
- package/docs/sdk/models/operations/createmodelresponsebody.md +0 -0
- package/docs/sdk/models/operations/createvariationnobgrequestbody.md +0 -0
- package/docs/sdk/models/operations/createvariationnobgresponse.md +0 -0
- package/docs/sdk/models/operations/createvariationnobgresponsebody.md +0 -0
- package/docs/sdk/models/operations/createvariationupscalerequestbody.md +0 -0
- package/docs/sdk/models/operations/createvariationupscaleresponse.md +0 -0
- package/docs/sdk/models/operations/createvariationupscaleresponsebody.md +0 -0
- package/docs/sdk/models/operations/createvariationupscalesdupscalejoboutput.md +0 -0
- package/docs/sdk/models/operations/custommodels.md +0 -0
- package/docs/sdk/models/operations/datasetgenuploadoutput.md +0 -0
- package/docs/sdk/models/operations/datasetimages.md +0 -0
- package/docs/sdk/models/operations/datasets.md +0 -0
- package/docs/sdk/models/operations/datasetuploadoutput.md +0 -0
- package/docs/sdk/models/operations/deletedatasetbyiddatasets.md +0 -0
- package/docs/sdk/models/operations/deletedatasetbyidrequest.md +0 -0
- package/docs/sdk/models/operations/deletedatasetbyidresponse.md +0 -0
- package/docs/sdk/models/operations/deletedatasetbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/deletegenerationbyidrequest.md +0 -0
- package/docs/sdk/models/operations/deletegenerationbyidresponse.md +0 -0
- package/docs/sdk/models/operations/deletegenerationbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/deletegenerationstextureidrequest.md +0 -0
- package/docs/sdk/models/operations/deletegenerationstextureidrequestbody.md +0 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponse.md +0 -0
- package/docs/sdk/models/operations/deletegenerationstextureidresponsebody.md +0 -0
- package/docs/sdk/models/operations/deleteinitimagebyidrequest.md +0 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponse.md +0 -0
- package/docs/sdk/models/operations/deleteinitimagebyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/deletemodelbyidrequest.md +0 -0
- package/docs/sdk/models/operations/deletemodelbyidresponse.md +0 -0
- package/docs/sdk/models/operations/deletemodelbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/deletemodels3didrequest.md +0 -0
- package/docs/sdk/models/operations/deletemodels3didrequestbody.md +0 -0
- package/docs/sdk/models/operations/deletemodels3didresponse.md +0 -0
- package/docs/sdk/models/operations/deletemodels3didresponsebody.md +0 -0
- package/docs/sdk/models/operations/elements.md +0 -0
- package/docs/sdk/models/operations/generatedimages.md +0 -0
- package/docs/sdk/models/operations/generatedimagevariationgeneric.md +0 -0
- package/docs/sdk/models/operations/generationelements.md +0 -0
- package/docs/sdk/models/operations/generations.md +0 -0
- package/docs/sdk/models/operations/getdatasetbyiddatasets.md +0 -0
- package/docs/sdk/models/operations/getdatasetbyidrequest.md +0 -0
- package/docs/sdk/models/operations/getdatasetbyidresponse.md +0 -0
- package/docs/sdk/models/operations/getdatasetbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/getelementsresponse.md +0 -0
- package/docs/sdk/models/operations/getelementsresponsebody.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidgeneratedimagevariationgeneric.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidgenerations.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidloras.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidrequest.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidresponse.md +0 -0
- package/docs/sdk/models/operations/getgenerationbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridgeneratedimages.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridgeneratedimagevariationgeneric.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridgenerationelements.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridgenerations.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridrequest.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridresponse.md +0 -0
- package/docs/sdk/models/operations/getgenerationsbyuseridresponsebody.md +0 -0
- package/docs/sdk/models/operations/getinitimagebyidinitimages.md +0 -0
- package/docs/sdk/models/operations/getinitimagebyidrequest.md +0 -0
- package/docs/sdk/models/operations/getinitimagebyidresponse.md +0 -0
- package/docs/sdk/models/operations/getinitimagebyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/getmodelbyidcustommodels.md +0 -0
- package/docs/sdk/models/operations/getmodelbyidrequest.md +0 -0
- package/docs/sdk/models/operations/getmodelbyidresponse.md +0 -0
- package/docs/sdk/models/operations/getmodelbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/getplatformmodelscustommodels.md +0 -0
- package/docs/sdk/models/operations/getplatformmodelsgeneratedimages.md +0 -0
- package/docs/sdk/models/operations/getplatformmodelsrequest.md +0 -0
- package/docs/sdk/models/operations/getplatformmodelsresponse.md +0 -0
- package/docs/sdk/models/operations/getplatformmodelsresponsebody.md +0 -0
- package/docs/sdk/models/operations/getuserselfresponse.md +0 -0
- package/docs/sdk/models/operations/getuserselfresponsebody.md +0 -0
- package/docs/sdk/models/operations/getvariationbyidrequest.md +0 -0
- package/docs/sdk/models/operations/getvariationbyidresponse.md +0 -0
- package/docs/sdk/models/operations/getvariationbyidresponsebody.md +0 -0
- package/docs/sdk/models/operations/initimages.md +0 -0
- package/docs/sdk/models/operations/initimageuploadoutput.md +0 -0
- package/docs/sdk/models/operations/loras.md +0 -0
- package/docs/sdk/models/operations/modelassets.md +0 -0
- package/docs/sdk/models/operations/modelassettexturegenerations.md +0 -0
- package/docs/sdk/models/operations/modelassetuploadoutput.md +0 -0
- package/docs/sdk/models/operations/postgenerationstexturerequestbody.md +0 -0
- package/docs/sdk/models/operations/postgenerationstextureresponse.md +0 -0
- package/docs/sdk/models/operations/postgenerationstextureresponsebody.md +0 -0
- package/docs/sdk/models/operations/postmodels3duploadrequestbody.md +0 -0
- package/docs/sdk/models/operations/postmodels3duploadresponse.md +0 -0
- package/docs/sdk/models/operations/postmodels3duploadresponsebody.md +0 -0
- package/docs/sdk/models/operations/postvariationsunzoomrequestbody.md +0 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponse.md +0 -0
- package/docs/sdk/models/operations/postvariationsunzoomresponsebody.md +0 -0
- package/docs/sdk/models/operations/sdgenerationoutput.md +0 -0
- package/docs/sdk/models/operations/sdtrainingoutput.md +0 -0
- package/docs/sdk/models/operations/sdunzoomoutput.md +0 -0
- package/docs/sdk/models/operations/sdupscalejoboutput.md +0 -0
- package/docs/sdk/models/operations/texturegenerationjoboutput.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenrequest.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenrequestbody.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenresponse.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagefromgenresponsebody.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagerequest.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimagerequestbody.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponse.md +0 -0
- package/docs/sdk/models/operations/uploaddatasetimageresponsebody.md +0 -0
- package/docs/sdk/models/operations/uploadinitimagerequestbody.md +0 -0
- package/docs/sdk/models/operations/uploadinitimageresponse.md +0 -0
- package/docs/sdk/models/operations/uploadinitimageresponsebody.md +0 -0
- package/docs/sdk/models/operations/userdetails.md +0 -0
- package/docs/sdk/models/operations/users.md +0 -0
- package/docs/sdk/models/shared/controlnettype.md +0 -0
- package/docs/sdk/models/shared/custommodeltype.md +0 -0
- package/docs/sdk/models/shared/elementinput.md +0 -0
- package/docs/sdk/models/shared/jobstatus.md +0 -0
- package/docs/sdk/models/shared/sdgenerationschedulers.md +0 -0
- package/docs/sdk/models/shared/sdgenerationstyle.md +0 -0
- package/docs/sdk/models/shared/sdversions.md +0 -0
- package/docs/sdk/models/shared/security.md +0 -0
- package/docs/sdk/models/shared/strength.md +0 -0
- package/docs/sdk/models/shared/variationtype.md +0 -0
- package/docs/sdks/dataset/README.md +0 -0
- package/docs/sdks/element/README.md +0 -0
- package/docs/sdks/generation/README.md +0 -0
- package/docs/sdks/initimage/README.md +0 -0
- package/docs/sdks/leonardo/README.md +0 -0
- package/docs/sdks/model/README.md +0 -0
- package/docs/sdks/user/README.md +0 -0
- package/docs/sdks/variation/README.md +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,8 @@ To get access to the API and fetch an API key, please sign up for [access](https
|
|
|
30
30
|
|
|
31
31
|
## SDK Example Usage
|
|
32
32
|
<!-- Start SDK Example Usage -->
|
|
33
|
+
### Example
|
|
34
|
+
|
|
33
35
|
```typescript
|
|
34
36
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
35
37
|
|
|
@@ -131,7 +133,7 @@ Here's an example of one such pagination call:
|
|
|
131
133
|
|
|
132
134
|
|
|
133
135
|
<!-- Start Error Handling -->
|
|
134
|
-
|
|
136
|
+
## Error Handling
|
|
135
137
|
|
|
136
138
|
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
137
139
|
|
|
@@ -139,8 +141,7 @@ Handling errors in this SDK should largely match your expectations. All operati
|
|
|
139
141
|
| --------------- | --------------- | --------------- |
|
|
140
142
|
| errors.SDKError | 400-600 | */* |
|
|
141
143
|
|
|
142
|
-
|
|
143
|
-
## Example
|
|
144
|
+
Example
|
|
144
145
|
|
|
145
146
|
```typescript
|
|
146
147
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
@@ -168,11 +169,10 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
168
169
|
|
|
169
170
|
|
|
170
171
|
<!-- Start Custom HTTP Client -->
|
|
171
|
-
|
|
172
|
+
## Custom HTTP Client
|
|
172
173
|
|
|
173
174
|
The Typescript SDK makes API calls using the (axios)[https://axios-http.com/docs/intro] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.
|
|
174
175
|
|
|
175
|
-
|
|
176
176
|
For example, you could specify a header for every request that your sdk makes as follows:
|
|
177
177
|
|
|
178
178
|
```typescript
|
|
@@ -183,7 +183,6 @@ const httpClient = axios.create({
|
|
|
183
183
|
headers: {'x-custom-header': 'someValue'}
|
|
184
184
|
})
|
|
185
185
|
|
|
186
|
-
|
|
187
186
|
const sdk = new Leonardo({defaultClient: httpClient});
|
|
188
187
|
```
|
|
189
188
|
<!-- End Custom HTTP Client -->
|
|
@@ -191,9 +190,9 @@ const sdk = new Leonardo({defaultClient: httpClient});
|
|
|
191
190
|
|
|
192
191
|
|
|
193
192
|
<!-- Start Server Selection -->
|
|
194
|
-
|
|
193
|
+
## Server Selection
|
|
195
194
|
|
|
196
|
-
|
|
195
|
+
### Select Server by Index
|
|
197
196
|
|
|
198
197
|
You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
|
|
199
198
|
|
|
@@ -201,7 +200,7 @@ You can override the default server globally by passing a server index to the `s
|
|
|
201
200
|
| - | ------ | --------- |
|
|
202
201
|
| 0 | `https://cloud.leonardo.ai/api/rest/v1` | None |
|
|
203
202
|
|
|
204
|
-
|
|
203
|
+
#### Example
|
|
205
204
|
|
|
206
205
|
```typescript
|
|
207
206
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
@@ -224,10 +223,9 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
224
223
|
```
|
|
225
224
|
|
|
226
225
|
|
|
227
|
-
|
|
226
|
+
### Override Server URL Per-Client
|
|
228
227
|
|
|
229
228
|
The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
|
|
230
|
-
|
|
231
229
|
```typescript
|
|
232
230
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
233
231
|
|
|
@@ -252,9 +250,9 @@ import { Leonardo } from "@leonardo-ai/sdk";
|
|
|
252
250
|
|
|
253
251
|
|
|
254
252
|
<!-- Start Authentication -->
|
|
255
|
-
|
|
253
|
+
## Authentication
|
|
256
254
|
|
|
257
|
-
|
|
255
|
+
### Per-Client Security Schemes
|
|
258
256
|
|
|
259
257
|
This SDK supports the following security scheme globally:
|
|
260
258
|
|
|
@@ -263,7 +261,6 @@ This SDK supports the following security scheme globally:
|
|
|
263
261
|
| `bearerAuth` | http | HTTP Bearer |
|
|
264
262
|
|
|
265
263
|
To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
|
|
266
|
-
|
|
267
264
|
```typescript
|
|
268
265
|
import { Leonardo } from "@leonardo-ai/sdk";
|
|
269
266
|
|
package/dist/sdk/dataset.js
CHANGED
|
@@ -107,7 +107,7 @@ var Dataset = /** @class */ (function () {
|
|
|
107
107
|
Dataset.prototype.createDataset = function (req, config) {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
110
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
111
111
|
var _d;
|
|
112
112
|
return __generator(this, function (_e) {
|
|
113
113
|
switch (_e.label) {
|
|
@@ -146,23 +146,23 @@ var Dataset = /** @class */ (function () {
|
|
|
146
146
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
147
147
|
case 3:
|
|
148
148
|
httpRes = _e.sent();
|
|
149
|
-
|
|
149
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
150
150
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
151
151
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
152
152
|
}
|
|
153
153
|
res = new operations.CreateDatasetResponse({
|
|
154
154
|
statusCode: httpRes.status,
|
|
155
|
-
contentType:
|
|
155
|
+
contentType: responseContentType,
|
|
156
156
|
rawResponse: httpRes,
|
|
157
157
|
});
|
|
158
158
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
159
159
|
switch (true) {
|
|
160
160
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
161
|
-
if (utils.matchContentType(
|
|
161
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
162
162
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.CreateDatasetResponseBody);
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
165
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
166
166
|
}
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
@@ -180,7 +180,7 @@ var Dataset = /** @class */ (function () {
|
|
|
180
180
|
Dataset.prototype.deleteDatasetById = function (id, config) {
|
|
181
181
|
var _a, _b;
|
|
182
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes,
|
|
183
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
184
184
|
return __generator(this, function (_c) {
|
|
185
185
|
switch (_c.label) {
|
|
186
186
|
case 0:
|
|
@@ -207,23 +207,23 @@ var Dataset = /** @class */ (function () {
|
|
|
207
207
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
208
208
|
case 3:
|
|
209
209
|
httpRes = _c.sent();
|
|
210
|
-
|
|
210
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
211
211
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
212
212
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
213
213
|
}
|
|
214
214
|
res = new operations.DeleteDatasetByIdResponse({
|
|
215
215
|
statusCode: httpRes.status,
|
|
216
|
-
contentType:
|
|
216
|
+
contentType: responseContentType,
|
|
217
217
|
rawResponse: httpRes,
|
|
218
218
|
});
|
|
219
219
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
220
220
|
switch (true) {
|
|
221
221
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
222
|
-
if (utils.matchContentType(
|
|
222
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
223
223
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteDatasetByIdResponseBody);
|
|
224
224
|
}
|
|
225
225
|
else {
|
|
226
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
226
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
227
227
|
}
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
@@ -241,7 +241,7 @@ var Dataset = /** @class */ (function () {
|
|
|
241
241
|
Dataset.prototype.getDatasetById = function (id, config) {
|
|
242
242
|
var _a, _b;
|
|
243
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes,
|
|
244
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
245
245
|
return __generator(this, function (_c) {
|
|
246
246
|
switch (_c.label) {
|
|
247
247
|
case 0:
|
|
@@ -268,23 +268,23 @@ var Dataset = /** @class */ (function () {
|
|
|
268
268
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
269
269
|
case 3:
|
|
270
270
|
httpRes = _c.sent();
|
|
271
|
-
|
|
271
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
272
272
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
273
273
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
274
274
|
}
|
|
275
275
|
res = new operations.GetDatasetByIdResponse({
|
|
276
276
|
statusCode: httpRes.status,
|
|
277
|
-
contentType:
|
|
277
|
+
contentType: responseContentType,
|
|
278
278
|
rawResponse: httpRes,
|
|
279
279
|
});
|
|
280
280
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
281
281
|
switch (true) {
|
|
282
282
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
283
|
-
if (utils.matchContentType(
|
|
283
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
284
284
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetDatasetByIdResponseBody);
|
|
285
285
|
}
|
|
286
286
|
else {
|
|
287
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
287
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
288
288
|
}
|
|
289
289
|
break;
|
|
290
290
|
}
|
|
@@ -302,7 +302,7 @@ var Dataset = /** @class */ (function () {
|
|
|
302
302
|
Dataset.prototype.uploadDatasetImage = function (requestBody, datasetId, config) {
|
|
303
303
|
var _a, _b;
|
|
304
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
|
-
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
305
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
306
306
|
var _d;
|
|
307
307
|
return __generator(this, function (_e) {
|
|
308
308
|
switch (_e.label) {
|
|
@@ -342,23 +342,23 @@ var Dataset = /** @class */ (function () {
|
|
|
342
342
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
343
343
|
case 3:
|
|
344
344
|
httpRes = _e.sent();
|
|
345
|
-
|
|
345
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
346
346
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
347
347
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
348
348
|
}
|
|
349
349
|
res = new operations.UploadDatasetImageResponse({
|
|
350
350
|
statusCode: httpRes.status,
|
|
351
|
-
contentType:
|
|
351
|
+
contentType: responseContentType,
|
|
352
352
|
rawResponse: httpRes,
|
|
353
353
|
});
|
|
354
354
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
355
355
|
switch (true) {
|
|
356
356
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
357
|
-
if (utils.matchContentType(
|
|
357
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
358
358
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.UploadDatasetImageResponseBody);
|
|
359
359
|
}
|
|
360
360
|
else {
|
|
361
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
361
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
362
362
|
}
|
|
363
363
|
break;
|
|
364
364
|
}
|
|
@@ -376,7 +376,7 @@ var Dataset = /** @class */ (function () {
|
|
|
376
376
|
Dataset.prototype.uploadDatasetImageFromGen = function (requestBody, datasetId, config) {
|
|
377
377
|
var _a, _b;
|
|
378
378
|
return __awaiter(this, void 0, void 0, function () {
|
|
379
|
-
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
379
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
380
380
|
var _d;
|
|
381
381
|
return __generator(this, function (_e) {
|
|
382
382
|
switch (_e.label) {
|
|
@@ -416,23 +416,23 @@ var Dataset = /** @class */ (function () {
|
|
|
416
416
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
417
417
|
case 3:
|
|
418
418
|
httpRes = _e.sent();
|
|
419
|
-
|
|
419
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
420
420
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
421
421
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
422
422
|
}
|
|
423
423
|
res = new operations.UploadDatasetImageFromGenResponse({
|
|
424
424
|
statusCode: httpRes.status,
|
|
425
|
-
contentType:
|
|
425
|
+
contentType: responseContentType,
|
|
426
426
|
rawResponse: httpRes,
|
|
427
427
|
});
|
|
428
428
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
429
429
|
switch (true) {
|
|
430
430
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
431
|
-
if (utils.matchContentType(
|
|
431
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
432
432
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.UploadDatasetImageFromGenResponseBody);
|
|
433
433
|
}
|
|
434
434
|
else {
|
|
435
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
435
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
436
436
|
}
|
|
437
437
|
break;
|
|
438
438
|
}
|
package/dist/sdk/element.js
CHANGED
|
@@ -91,7 +91,7 @@ var Element = /** @class */ (function () {
|
|
|
91
91
|
Element.prototype.getElements = function (config) {
|
|
92
92
|
var _a, _b;
|
|
93
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes,
|
|
94
|
+
var baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
95
95
|
return __generator(this, function (_c) {
|
|
96
96
|
switch (_c.label) {
|
|
97
97
|
case 0:
|
|
@@ -115,23 +115,23 @@ var Element = /** @class */ (function () {
|
|
|
115
115
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
116
116
|
case 3:
|
|
117
117
|
httpRes = _c.sent();
|
|
118
|
-
|
|
118
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
119
119
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
120
120
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
121
121
|
}
|
|
122
122
|
res = new operations.GetElementsResponse({
|
|
123
123
|
statusCode: httpRes.status,
|
|
124
|
-
contentType:
|
|
124
|
+
contentType: responseContentType,
|
|
125
125
|
rawResponse: httpRes,
|
|
126
126
|
});
|
|
127
127
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
128
128
|
switch (true) {
|
|
129
129
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
130
|
-
if (utils.matchContentType(
|
|
130
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
131
131
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetElementsResponseBody);
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
134
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
135
135
|
}
|
|
136
136
|
break;
|
|
137
137
|
}
|
package/dist/sdk/generation.js
CHANGED
|
@@ -107,7 +107,7 @@ var Generation = /** @class */ (function () {
|
|
|
107
107
|
Generation.prototype.createGeneration = function (req, config) {
|
|
108
108
|
var _a, _b;
|
|
109
109
|
return __awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
110
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
111
111
|
var _d;
|
|
112
112
|
return __generator(this, function (_e) {
|
|
113
113
|
switch (_e.label) {
|
|
@@ -146,23 +146,23 @@ var Generation = /** @class */ (function () {
|
|
|
146
146
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
147
147
|
case 3:
|
|
148
148
|
httpRes = _e.sent();
|
|
149
|
-
|
|
149
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
150
150
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
151
151
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
152
152
|
}
|
|
153
153
|
res = new operations.CreateGenerationResponse({
|
|
154
154
|
statusCode: httpRes.status,
|
|
155
|
-
contentType:
|
|
155
|
+
contentType: responseContentType,
|
|
156
156
|
rawResponse: httpRes,
|
|
157
157
|
});
|
|
158
158
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
159
159
|
switch (true) {
|
|
160
160
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
161
|
-
if (utils.matchContentType(
|
|
161
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
162
162
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.CreateGenerationResponseBody);
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
165
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
166
166
|
}
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
@@ -180,7 +180,7 @@ var Generation = /** @class */ (function () {
|
|
|
180
180
|
Generation.prototype.deleteGenerationById = function (id, config) {
|
|
181
181
|
var _a, _b;
|
|
182
182
|
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes,
|
|
183
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
184
184
|
return __generator(this, function (_c) {
|
|
185
185
|
switch (_c.label) {
|
|
186
186
|
case 0:
|
|
@@ -207,23 +207,23 @@ var Generation = /** @class */ (function () {
|
|
|
207
207
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
|
|
208
208
|
case 3:
|
|
209
209
|
httpRes = _c.sent();
|
|
210
|
-
|
|
210
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
211
211
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
212
212
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
213
213
|
}
|
|
214
214
|
res = new operations.DeleteGenerationByIdResponse({
|
|
215
215
|
statusCode: httpRes.status,
|
|
216
|
-
contentType:
|
|
216
|
+
contentType: responseContentType,
|
|
217
217
|
rawResponse: httpRes,
|
|
218
218
|
});
|
|
219
219
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
220
220
|
switch (true) {
|
|
221
221
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
222
|
-
if (utils.matchContentType(
|
|
222
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
223
223
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteGenerationByIdResponseBody);
|
|
224
224
|
}
|
|
225
225
|
else {
|
|
226
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
226
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
227
227
|
}
|
|
228
228
|
break;
|
|
229
229
|
}
|
|
@@ -241,7 +241,7 @@ var Generation = /** @class */ (function () {
|
|
|
241
241
|
Generation.prototype.deleteGenerationsTextureId = function (id, requestBody, config) {
|
|
242
242
|
var _a, _b;
|
|
243
243
|
return __awaiter(this, void 0, void 0, function () {
|
|
244
|
-
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
244
|
+
var req, baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
245
245
|
var _d;
|
|
246
246
|
return __generator(this, function (_e) {
|
|
247
247
|
switch (_e.label) {
|
|
@@ -279,23 +279,23 @@ var Generation = /** @class */ (function () {
|
|
|
279
279
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
280
280
|
case 3:
|
|
281
281
|
httpRes = _e.sent();
|
|
282
|
-
|
|
282
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
283
283
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
284
284
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
285
285
|
}
|
|
286
286
|
res = new operations.DeleteGenerationsTextureIdResponse({
|
|
287
287
|
statusCode: httpRes.status,
|
|
288
|
-
contentType:
|
|
288
|
+
contentType: responseContentType,
|
|
289
289
|
rawResponse: httpRes,
|
|
290
290
|
});
|
|
291
291
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
292
292
|
switch (true) {
|
|
293
293
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
294
|
-
if (utils.matchContentType(
|
|
294
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
295
295
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteGenerationsTextureIdResponseBody);
|
|
296
296
|
}
|
|
297
297
|
else {
|
|
298
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
298
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
299
299
|
}
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
@@ -313,7 +313,7 @@ var Generation = /** @class */ (function () {
|
|
|
313
313
|
Generation.prototype.getGenerationById = function (id, config) {
|
|
314
314
|
var _a, _b;
|
|
315
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
316
|
-
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes,
|
|
316
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
317
317
|
return __generator(this, function (_c) {
|
|
318
318
|
switch (_c.label) {
|
|
319
319
|
case 0:
|
|
@@ -340,23 +340,23 @@ var Generation = /** @class */ (function () {
|
|
|
340
340
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
341
341
|
case 3:
|
|
342
342
|
httpRes = _c.sent();
|
|
343
|
-
|
|
343
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
344
344
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
345
345
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
346
346
|
}
|
|
347
347
|
res = new operations.GetGenerationByIdResponse({
|
|
348
348
|
statusCode: httpRes.status,
|
|
349
|
-
contentType:
|
|
349
|
+
contentType: responseContentType,
|
|
350
350
|
rawResponse: httpRes,
|
|
351
351
|
});
|
|
352
352
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
353
353
|
switch (true) {
|
|
354
354
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
355
|
-
if (utils.matchContentType(
|
|
355
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
356
356
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationByIdResponseBody);
|
|
357
357
|
}
|
|
358
358
|
else {
|
|
359
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
359
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
360
360
|
}
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
@@ -374,7 +374,7 @@ var Generation = /** @class */ (function () {
|
|
|
374
374
|
Generation.prototype.getGenerationsByUserId = function (userId, limit, offset, config) {
|
|
375
375
|
var _a, _b;
|
|
376
376
|
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
-
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes,
|
|
377
|
+
var req, baseURL, operationUrl, client, globalSecurity, properties, headers, queryParams, httpRes, responseContentType, res, decodedRes;
|
|
378
378
|
return __generator(this, function (_c) {
|
|
379
379
|
switch (_c.label) {
|
|
380
380
|
case 0:
|
|
@@ -404,23 +404,23 @@ var Generation = /** @class */ (function () {
|
|
|
404
404
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
|
|
405
405
|
case 3:
|
|
406
406
|
httpRes = _c.sent();
|
|
407
|
-
|
|
407
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
408
408
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
409
409
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
410
410
|
}
|
|
411
411
|
res = new operations.GetGenerationsByUserIdResponse({
|
|
412
412
|
statusCode: httpRes.status,
|
|
413
|
-
contentType:
|
|
413
|
+
contentType: responseContentType,
|
|
414
414
|
rawResponse: httpRes,
|
|
415
415
|
});
|
|
416
416
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
417
417
|
switch (true) {
|
|
418
418
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
419
|
-
if (utils.matchContentType(
|
|
419
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
420
420
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetGenerationsByUserIdResponseBody);
|
|
421
421
|
}
|
|
422
422
|
else {
|
|
423
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
423
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
424
424
|
}
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
@@ -438,7 +438,7 @@ var Generation = /** @class */ (function () {
|
|
|
438
438
|
Generation.prototype.postGenerationsTexture = function (req, config) {
|
|
439
439
|
var _a, _b;
|
|
440
440
|
return __awaiter(this, void 0, void 0, function () {
|
|
441
|
-
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes,
|
|
441
|
+
var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
|
|
442
442
|
var _d;
|
|
443
443
|
return __generator(this, function (_e) {
|
|
444
444
|
switch (_e.label) {
|
|
@@ -475,23 +475,23 @@ var Generation = /** @class */ (function () {
|
|
|
475
475
|
return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
|
|
476
476
|
case 3:
|
|
477
477
|
httpRes = _e.sent();
|
|
478
|
-
|
|
478
|
+
responseContentType = (_b = (_a = httpRes === null || httpRes === void 0 ? void 0 : httpRes.headers) === null || _a === void 0 ? void 0 : _a["content-type"]) !== null && _b !== void 0 ? _b : "";
|
|
479
479
|
if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
|
|
480
480
|
throw new Error("status code not found in response: ".concat(httpRes));
|
|
481
481
|
}
|
|
482
482
|
res = new operations.PostGenerationsTextureResponse({
|
|
483
483
|
statusCode: httpRes.status,
|
|
484
|
-
contentType:
|
|
484
|
+
contentType: responseContentType,
|
|
485
485
|
rawResponse: httpRes,
|
|
486
486
|
});
|
|
487
487
|
decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
|
|
488
488
|
switch (true) {
|
|
489
489
|
case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
|
|
490
|
-
if (utils.matchContentType(
|
|
490
|
+
if (utils.matchContentType(responseContentType, "application/json")) {
|
|
491
491
|
res.object = utils.objectToClass(JSON.parse(decodedRes), operations.PostGenerationsTextureResponseBody);
|
|
492
492
|
}
|
|
493
493
|
else {
|
|
494
|
-
throw new errors.SDKError("unknown content-type received: " +
|
|
494
|
+
throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
|
|
495
495
|
}
|
|
496
496
|
break;
|
|
497
497
|
}
|