@leonardo-ai/sdk 2.1.0 → 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.
Files changed (211) hide show
  1. package/README.md +47 -22
  2. package/dist/internal/utils/queryparams.js +3 -1
  3. package/dist/internal/utils/security.js +11 -3
  4. package/dist/sdk/dataset.js +35 -35
  5. package/dist/sdk/element.js +7 -7
  6. package/dist/sdk/generation.js +42 -42
  7. package/dist/sdk/initimage.js +21 -21
  8. package/dist/sdk/model.js +42 -42
  9. package/dist/sdk/sdk.js +4 -4
  10. package/dist/sdk/user.js +7 -7
  11. package/dist/sdk/variation.js +28 -28
  12. package/docs/{models → sdk/models}/operations/createdatasetrequestbody.md +0 -0
  13. package/docs/sdk/models/operations/createdatasetresponse.md +11 -0
  14. package/docs/sdk/models/operations/createdatasetresponsebody.md +10 -0
  15. package/docs/{models → sdk/models}/operations/creategenerationrequestbody.md +5 -5
  16. package/docs/sdk/models/operations/creategenerationresponse.md +11 -0
  17. package/docs/sdk/models/operations/creategenerationresponsebody.md +10 -0
  18. package/docs/{models → sdk/models}/operations/createmodelrequestbody.md +3 -3
  19. package/docs/sdk/models/operations/createmodelresponse.md +11 -0
  20. package/docs/sdk/models/operations/createmodelresponsebody.md +10 -0
  21. package/docs/{models → sdk/models}/operations/createvariationnobgrequestbody.md +0 -0
  22. package/docs/sdk/models/operations/createvariationnobgresponse.md +11 -0
  23. package/docs/sdk/models/operations/createvariationnobgresponsebody.md +10 -0
  24. package/docs/{models → sdk/models}/operations/createvariationupscalerequestbody.md +0 -0
  25. package/docs/sdk/models/operations/createvariationupscaleresponse.md +11 -0
  26. package/docs/sdk/models/operations/createvariationupscaleresponsebody.md +10 -0
  27. package/docs/{models → sdk/models}/operations/createvariationupscalesdupscalejoboutput.md +0 -0
  28. package/docs/{models → sdk/models}/operations/custommodels.md +0 -0
  29. package/docs/{models → sdk/models}/operations/datasetgenuploadoutput.md +0 -0
  30. package/docs/{models → sdk/models}/operations/datasetimages.md +0 -0
  31. package/docs/{models → sdk/models}/operations/datasets.md +0 -0
  32. package/docs/{models → sdk/models}/operations/datasetuploadoutput.md +0 -0
  33. package/docs/{models → sdk/models}/operations/deletedatasetbyiddatasets.md +0 -0
  34. package/docs/{models → sdk/models}/operations/deletedatasetbyidrequest.md +0 -0
  35. package/docs/sdk/models/operations/deletedatasetbyidresponse.md +11 -0
  36. package/docs/sdk/models/operations/deletedatasetbyidresponsebody.md +10 -0
  37. package/docs/{models → sdk/models}/operations/deletegenerationbyidrequest.md +0 -0
  38. package/docs/sdk/models/operations/deletegenerationbyidresponse.md +11 -0
  39. package/docs/sdk/models/operations/deletegenerationbyidresponsebody.md +10 -0
  40. package/docs/sdk/models/operations/deletegenerationstextureidrequest.md +9 -0
  41. package/docs/{models → sdk/models}/operations/deletegenerationstextureidrequestbody.md +0 -0
  42. package/docs/sdk/models/operations/deletegenerationstextureidresponse.md +11 -0
  43. package/docs/sdk/models/operations/deletegenerationstextureidresponsebody.md +10 -0
  44. package/docs/{models → sdk/models}/operations/deleteinitimagebyidrequest.md +0 -0
  45. package/docs/sdk/models/operations/deleteinitimagebyidresponse.md +11 -0
  46. package/docs/sdk/models/operations/deleteinitimagebyidresponsebody.md +10 -0
  47. package/docs/{models → sdk/models}/operations/deletemodelbyidrequest.md +0 -0
  48. package/docs/sdk/models/operations/deletemodelbyidresponse.md +11 -0
  49. package/docs/sdk/models/operations/deletemodelbyidresponsebody.md +10 -0
  50. package/docs/sdk/models/operations/deletemodels3didrequest.md +9 -0
  51. package/docs/{models → sdk/models}/operations/deletemodels3didrequestbody.md +0 -0
  52. package/docs/sdk/models/operations/deletemodels3didresponse.md +11 -0
  53. package/docs/sdk/models/operations/deletemodels3didresponsebody.md +10 -0
  54. package/docs/{models → sdk/models}/operations/elements.md +1 -1
  55. package/docs/{models → sdk/models}/operations/generatedimages.md +7 -7
  56. package/docs/sdk/models/operations/generatedimagevariationgeneric.md +14 -0
  57. package/docs/sdk/models/operations/generationelements.md +12 -0
  58. package/docs/{models → sdk/models}/operations/generations.md +0 -0
  59. package/docs/sdk/models/operations/getdatasetbyiddatasets.md +15 -0
  60. package/docs/{models → sdk/models}/operations/getdatasetbyidrequest.md +0 -0
  61. package/docs/sdk/models/operations/getdatasetbyidresponse.md +11 -0
  62. package/docs/sdk/models/operations/getdatasetbyidresponsebody.md +10 -0
  63. package/docs/sdk/models/operations/getelementsresponse.md +11 -0
  64. package/docs/sdk/models/operations/getelementsresponsebody.md +10 -0
  65. package/docs/sdk/models/operations/getgenerationbyidgeneratedimagevariationgeneric.md +13 -0
  66. package/docs/{models → sdk/models}/operations/getgenerationbyidgenerations.md +6 -6
  67. package/docs/{models → sdk/models}/operations/getgenerationbyidloras.md +1 -1
  68. package/docs/{models → sdk/models}/operations/getgenerationbyidrequest.md +0 -0
  69. package/docs/sdk/models/operations/getgenerationbyidresponse.md +11 -0
  70. package/docs/sdk/models/operations/getgenerationbyidresponsebody.md +10 -0
  71. package/docs/{models → sdk/models}/operations/getgenerationsbyuseridgeneratedimages.md +7 -7
  72. package/docs/sdk/models/operations/getgenerationsbyuseridgeneratedimagevariationgeneric.md +13 -0
  73. package/docs/sdk/models/operations/getgenerationsbyuseridgenerationelements.md +12 -0
  74. package/docs/{models → sdk/models}/operations/getgenerationsbyuseridgenerations.md +6 -6
  75. package/docs/{models → sdk/models}/operations/getgenerationsbyuseridrequest.md +0 -0
  76. package/docs/sdk/models/operations/getgenerationsbyuseridresponse.md +11 -0
  77. package/docs/sdk/models/operations/getgenerationsbyuseridresponsebody.md +10 -0
  78. package/docs/{models → sdk/models}/operations/getinitimagebyidinitimages.md +0 -0
  79. package/docs/{models → sdk/models}/operations/getinitimagebyidrequest.md +0 -0
  80. package/docs/sdk/models/operations/getinitimagebyidresponse.md +11 -0
  81. package/docs/sdk/models/operations/getinitimagebyidresponsebody.md +10 -0
  82. package/docs/{models → sdk/models}/operations/getmodelbyidcustommodels.md +3 -3
  83. package/docs/{models → sdk/models}/operations/getmodelbyidrequest.md +0 -0
  84. package/docs/sdk/models/operations/getmodelbyidresponse.md +11 -0
  85. package/docs/sdk/models/operations/getmodelbyidresponsebody.md +10 -0
  86. package/docs/sdk/models/operations/getplatformmodelscustommodels.md +15 -0
  87. package/docs/{models → sdk/models}/operations/getplatformmodelsgeneratedimages.md +0 -0
  88. package/docs/{models → sdk/models}/operations/getplatformmodelsrequest.md +0 -0
  89. package/docs/sdk/models/operations/getplatformmodelsresponse.md +11 -0
  90. package/docs/sdk/models/operations/getplatformmodelsresponsebody.md +10 -0
  91. package/docs/sdk/models/operations/getuserselfresponse.md +11 -0
  92. package/docs/sdk/models/operations/getuserselfresponsebody.md +10 -0
  93. package/docs/{models → sdk/models}/operations/getvariationbyidrequest.md +0 -0
  94. package/docs/sdk/models/operations/getvariationbyidresponse.md +11 -0
  95. package/docs/sdk/models/operations/getvariationbyidresponsebody.md +10 -0
  96. package/docs/{models → sdk/models}/operations/initimages.md +0 -0
  97. package/docs/{models → sdk/models}/operations/initimageuploadoutput.md +0 -0
  98. package/docs/{models → sdk/models}/operations/loras.md +1 -1
  99. package/docs/{models → sdk/models}/operations/modelassets.md +0 -0
  100. package/docs/{models → sdk/models}/operations/modelassettexturegenerations.md +0 -0
  101. package/docs/{models → sdk/models}/operations/modelassetuploadoutput.md +0 -0
  102. package/docs/{models → sdk/models}/operations/postgenerationstexturerequestbody.md +0 -0
  103. package/docs/sdk/models/operations/postgenerationstextureresponse.md +11 -0
  104. package/docs/sdk/models/operations/postgenerationstextureresponsebody.md +10 -0
  105. package/docs/{models → sdk/models}/operations/postmodels3duploadrequestbody.md +0 -0
  106. package/docs/sdk/models/operations/postmodels3duploadresponse.md +11 -0
  107. package/docs/sdk/models/operations/postmodels3duploadresponsebody.md +10 -0
  108. package/docs/{models → sdk/models}/operations/postvariationsunzoomrequestbody.md +0 -0
  109. package/docs/sdk/models/operations/postvariationsunzoomresponse.md +11 -0
  110. package/docs/sdk/models/operations/postvariationsunzoomresponsebody.md +10 -0
  111. package/docs/{models → sdk/models}/operations/sdgenerationoutput.md +0 -0
  112. package/docs/{models → sdk/models}/operations/sdtrainingoutput.md +0 -0
  113. package/docs/{models → sdk/models}/operations/sdunzoomoutput.md +0 -0
  114. package/docs/{models → sdk/models}/operations/sdupscalejoboutput.md +0 -0
  115. package/docs/{models → sdk/models}/operations/texturegenerationjoboutput.md +0 -0
  116. package/docs/sdk/models/operations/uploaddatasetimagefromgenrequest.md +9 -0
  117. package/docs/{models → sdk/models}/operations/uploaddatasetimagefromgenrequestbody.md +0 -0
  118. package/docs/sdk/models/operations/uploaddatasetimagefromgenresponse.md +11 -0
  119. package/docs/sdk/models/operations/uploaddatasetimagefromgenresponsebody.md +10 -0
  120. package/docs/sdk/models/operations/uploaddatasetimagerequest.md +9 -0
  121. package/docs/{models → sdk/models}/operations/uploaddatasetimagerequestbody.md +0 -0
  122. package/docs/sdk/models/operations/uploaddatasetimageresponse.md +11 -0
  123. package/docs/sdk/models/operations/uploaddatasetimageresponsebody.md +10 -0
  124. package/docs/{models → sdk/models}/operations/uploadinitimagerequestbody.md +0 -0
  125. package/docs/sdk/models/operations/uploadinitimageresponse.md +11 -0
  126. package/docs/sdk/models/operations/uploadinitimageresponsebody.md +10 -0
  127. package/docs/sdk/models/operations/userdetails.md +15 -0
  128. package/docs/{models → sdk/models}/operations/users.md +0 -0
  129. package/docs/{models → sdk/models}/shared/controlnettype.md +0 -0
  130. package/docs/{models → sdk/models}/shared/custommodeltype.md +0 -0
  131. package/docs/{models → sdk/models}/shared/elementinput.md +0 -0
  132. package/docs/{models → sdk/models}/shared/jobstatus.md +0 -0
  133. package/docs/{models → sdk/models}/shared/sdgenerationschedulers.md +0 -0
  134. package/docs/{models → sdk/models}/shared/sdgenerationstyle.md +0 -0
  135. package/docs/{models → sdk/models}/shared/sdversions.md +0 -0
  136. package/docs/{models → sdk/models}/shared/security.md +0 -0
  137. package/docs/{models → sdk/models}/shared/strength.md +0 -0
  138. package/docs/{models → sdk/models}/shared/variationtype.md +0 -0
  139. package/docs/sdks/dataset/README.md +40 -25
  140. package/docs/sdks/element/README.md +6 -3
  141. package/docs/sdks/generation/README.md +44 -26
  142. package/docs/sdks/initimage/README.md +20 -11
  143. package/docs/sdks/leonardo/README.md +0 -0
  144. package/docs/sdks/model/README.md +44 -26
  145. package/docs/sdks/user/README.md +6 -3
  146. package/docs/sdks/variation/README.md +33 -21
  147. package/package.json +1 -1
  148. package/docs/models/operations/createdatasetresponse.md +0 -11
  149. package/docs/models/operations/createdatasetresponsebody.md +0 -10
  150. package/docs/models/operations/creategenerationresponse.md +0 -11
  151. package/docs/models/operations/creategenerationresponsebody.md +0 -10
  152. package/docs/models/operations/createmodelresponse.md +0 -11
  153. package/docs/models/operations/createmodelresponsebody.md +0 -10
  154. package/docs/models/operations/createvariationnobgresponse.md +0 -11
  155. package/docs/models/operations/createvariationnobgresponsebody.md +0 -10
  156. package/docs/models/operations/createvariationupscaleresponse.md +0 -11
  157. package/docs/models/operations/createvariationupscaleresponsebody.md +0 -10
  158. package/docs/models/operations/deletedatasetbyidresponse.md +0 -11
  159. package/docs/models/operations/deletedatasetbyidresponsebody.md +0 -10
  160. package/docs/models/operations/deletegenerationbyidresponse.md +0 -11
  161. package/docs/models/operations/deletegenerationbyidresponsebody.md +0 -10
  162. package/docs/models/operations/deletegenerationstextureidrequest.md +0 -9
  163. package/docs/models/operations/deletegenerationstextureidresponse.md +0 -11
  164. package/docs/models/operations/deletegenerationstextureidresponsebody.md +0 -10
  165. package/docs/models/operations/deleteinitimagebyidresponse.md +0 -11
  166. package/docs/models/operations/deleteinitimagebyidresponsebody.md +0 -10
  167. package/docs/models/operations/deletemodelbyidresponse.md +0 -11
  168. package/docs/models/operations/deletemodelbyidresponsebody.md +0 -10
  169. package/docs/models/operations/deletemodels3didrequest.md +0 -9
  170. package/docs/models/operations/deletemodels3didresponse.md +0 -11
  171. package/docs/models/operations/deletemodels3didresponsebody.md +0 -10
  172. package/docs/models/operations/generatedimagevariationgeneric.md +0 -14
  173. package/docs/models/operations/generationelements.md +0 -12
  174. package/docs/models/operations/getdatasetbyiddatasets.md +0 -15
  175. package/docs/models/operations/getdatasetbyidresponse.md +0 -11
  176. package/docs/models/operations/getdatasetbyidresponsebody.md +0 -10
  177. package/docs/models/operations/getelementsresponse.md +0 -11
  178. package/docs/models/operations/getelementsresponsebody.md +0 -10
  179. package/docs/models/operations/getgenerationbyidgeneratedimagevariationgeneric.md +0 -13
  180. package/docs/models/operations/getgenerationbyidresponse.md +0 -11
  181. package/docs/models/operations/getgenerationbyidresponsebody.md +0 -10
  182. package/docs/models/operations/getgenerationsbyuseridgeneratedimagevariationgeneric.md +0 -13
  183. package/docs/models/operations/getgenerationsbyuseridgenerationelements.md +0 -12
  184. package/docs/models/operations/getgenerationsbyuseridresponse.md +0 -11
  185. package/docs/models/operations/getgenerationsbyuseridresponsebody.md +0 -10
  186. package/docs/models/operations/getinitimagebyidresponse.md +0 -11
  187. package/docs/models/operations/getinitimagebyidresponsebody.md +0 -10
  188. package/docs/models/operations/getmodelbyidresponse.md +0 -11
  189. package/docs/models/operations/getmodelbyidresponsebody.md +0 -10
  190. package/docs/models/operations/getplatformmodelscustommodels.md +0 -15
  191. package/docs/models/operations/getplatformmodelsresponse.md +0 -11
  192. package/docs/models/operations/getplatformmodelsresponsebody.md +0 -10
  193. package/docs/models/operations/getuserselfresponse.md +0 -11
  194. package/docs/models/operations/getuserselfresponsebody.md +0 -10
  195. package/docs/models/operations/getvariationbyidresponse.md +0 -11
  196. package/docs/models/operations/getvariationbyidresponsebody.md +0 -10
  197. package/docs/models/operations/postgenerationstextureresponse.md +0 -11
  198. package/docs/models/operations/postgenerationstextureresponsebody.md +0 -10
  199. package/docs/models/operations/postmodels3duploadresponse.md +0 -11
  200. package/docs/models/operations/postmodels3duploadresponsebody.md +0 -10
  201. package/docs/models/operations/postvariationsunzoomresponse.md +0 -11
  202. package/docs/models/operations/postvariationsunzoomresponsebody.md +0 -10
  203. package/docs/models/operations/uploaddatasetimagefromgenrequest.md +0 -9
  204. package/docs/models/operations/uploaddatasetimagefromgenresponse.md +0 -11
  205. package/docs/models/operations/uploaddatasetimagefromgenresponsebody.md +0 -10
  206. package/docs/models/operations/uploaddatasetimagerequest.md +0 -9
  207. package/docs/models/operations/uploaddatasetimageresponse.md +0 -11
  208. package/docs/models/operations/uploaddatasetimageresponsebody.md +0 -10
  209. package/docs/models/operations/uploadinitimageresponse.md +0 -11
  210. package/docs/models/operations/uploadinitimageresponsebody.md +0 -10
  211. package/docs/models/operations/userdetails.md +0 -15
@@ -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, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
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) {
@@ -116,7 +116,7 @@ var Generation = /** @class */ (function () {
116
116
  req = new operations.CreateGenerationRequestBody(req);
117
117
  }
118
118
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
119
- url = baseURL.replace(/\/$/, "") + "/generations";
119
+ operationUrl = baseURL.replace(/\/$/, "") + "/generations";
120
120
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
121
121
  try {
122
122
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -143,26 +143,26 @@ var Generation = /** @class */ (function () {
143
143
  throw new Error("request body is required");
144
144
  headers["Accept"] = "application/json";
145
145
  headers["user-agent"] = this.sdkConfiguration.userAgent;
146
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
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, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
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:
@@ -188,7 +188,7 @@ var Generation = /** @class */ (function () {
188
188
  id: id,
189
189
  });
190
190
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
191
- url = utils.generateURL(baseURL, "/generations/{id}", req);
191
+ operationUrl = utils.generateURL(baseURL, "/generations/{id}", req);
192
192
  client = this.sdkConfiguration.defaultClient;
193
193
  globalSecurity = this.sdkConfiguration.security;
194
194
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -204,26 +204,26 @@ var Generation = /** @class */ (function () {
204
204
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
205
205
  headers["Accept"] = "application/json";
206
206
  headers["user-agent"] = this.sdkConfiguration.userAgent;
207
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
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, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
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) {
@@ -251,7 +251,7 @@ var Generation = /** @class */ (function () {
251
251
  requestBody: requestBody,
252
252
  });
253
253
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
254
- url = utils.generateURL(baseURL, "/generations-texture/{id}", req);
254
+ operationUrl = utils.generateURL(baseURL, "/generations-texture/{id}", req);
255
255
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
256
256
  try {
257
257
  _d = __read(utils.serializeRequestBody(req, "requestBody", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -276,26 +276,26 @@ var Generation = /** @class */ (function () {
276
276
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
277
277
  headers["Accept"] = "application/json";
278
278
  headers["user-agent"] = this.sdkConfiguration.userAgent;
279
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
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, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
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:
@@ -321,7 +321,7 @@ var Generation = /** @class */ (function () {
321
321
  id: id,
322
322
  });
323
323
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
324
- url = utils.generateURL(baseURL, "/generations/{id}", req);
324
+ operationUrl = utils.generateURL(baseURL, "/generations/{id}", req);
325
325
  client = this.sdkConfiguration.defaultClient;
326
326
  globalSecurity = this.sdkConfiguration.security;
327
327
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -337,26 +337,26 @@ var Generation = /** @class */ (function () {
337
337
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
338
338
  headers["Accept"] = "application/json";
339
339
  headers["user-agent"] = this.sdkConfiguration.userAgent;
340
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
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, url, client, globalSecurity, properties, headers, queryParams, httpRes, contentType, res, decodedRes;
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:
@@ -384,7 +384,7 @@ var Generation = /** @class */ (function () {
384
384
  offset: offset,
385
385
  });
386
386
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
387
- url = utils.generateURL(baseURL, "/generations/user/{userId}", req);
387
+ operationUrl = utils.generateURL(baseURL, "/generations/user/{userId}", req);
388
388
  client = this.sdkConfiguration.defaultClient;
389
389
  globalSecurity = this.sdkConfiguration.security;
390
390
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -401,26 +401,26 @@ var Generation = /** @class */ (function () {
401
401
  queryParams = utils.serializeQueryParams(req);
402
402
  headers["Accept"] = "application/json";
403
403
  headers["user-agent"] = this.sdkConfiguration.userAgent;
404
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url + queryParams, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
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, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
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) {
@@ -447,7 +447,7 @@ var Generation = /** @class */ (function () {
447
447
  req = new operations.PostGenerationsTextureRequestBody(req);
448
448
  }
449
449
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
450
- url = baseURL.replace(/\/$/, "") + "/generations-texture";
450
+ operationUrl = baseURL.replace(/\/$/, "") + "/generations-texture";
451
451
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
452
452
  try {
453
453
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -472,26 +472,26 @@ var Generation = /** @class */ (function () {
472
472
  headers = __assign(__assign(__assign({}, reqBodyHeaders), config === null || config === void 0 ? void 0 : config.headers), properties.headers);
473
473
  headers["Accept"] = "application/json";
474
474
  headers["user-agent"] = this.sdkConfiguration.userAgent;
475
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
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
- contentType = (_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 : "";
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: 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(contentType, "application/json")) {
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: " + contentType, httpRes.status, decodedRes, httpRes);
494
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
495
495
  }
496
496
  break;
497
497
  }
@@ -107,7 +107,7 @@ var InitImage = /** @class */ (function () {
107
107
  InitImage.prototype.deleteInitImageById = function (id, config) {
108
108
  var _a, _b;
109
109
  return __awaiter(this, void 0, void 0, function () {
110
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
110
+ var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
111
111
  return __generator(this, function (_c) {
112
112
  switch (_c.label) {
113
113
  case 0:
@@ -115,7 +115,7 @@ var InitImage = /** @class */ (function () {
115
115
  id: id,
116
116
  });
117
117
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
118
- url = utils.generateURL(baseURL, "/init-image/{id}", req);
118
+ operationUrl = utils.generateURL(baseURL, "/init-image/{id}", req);
119
119
  client = this.sdkConfiguration.defaultClient;
120
120
  globalSecurity = this.sdkConfiguration.security;
121
121
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -131,26 +131,26 @@ var InitImage = /** @class */ (function () {
131
131
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
132
132
  headers["Accept"] = "application/json";
133
133
  headers["user-agent"] = this.sdkConfiguration.userAgent;
134
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
134
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "delete", headers: headers, responseType: "arraybuffer" }, config))];
135
135
  case 3:
136
136
  httpRes = _c.sent();
137
- contentType = (_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 : "";
137
+ 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 : "";
138
138
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
139
139
  throw new Error("status code not found in response: ".concat(httpRes));
140
140
  }
141
141
  res = new operations.DeleteInitImageByIdResponse({
142
142
  statusCode: httpRes.status,
143
- contentType: contentType,
143
+ contentType: responseContentType,
144
144
  rawResponse: httpRes,
145
145
  });
146
146
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
147
147
  switch (true) {
148
148
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
149
- if (utils.matchContentType(contentType, "application/json")) {
149
+ if (utils.matchContentType(responseContentType, "application/json")) {
150
150
  res.object = utils.objectToClass(JSON.parse(decodedRes), operations.DeleteInitImageByIdResponseBody);
151
151
  }
152
152
  else {
153
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
153
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
154
154
  }
155
155
  break;
156
156
  }
@@ -168,7 +168,7 @@ var InitImage = /** @class */ (function () {
168
168
  InitImage.prototype.getInitImageById = function (id, config) {
169
169
  var _a, _b;
170
170
  return __awaiter(this, void 0, void 0, function () {
171
- var req, baseURL, url, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
171
+ var req, baseURL, operationUrl, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
172
172
  return __generator(this, function (_c) {
173
173
  switch (_c.label) {
174
174
  case 0:
@@ -176,7 +176,7 @@ var InitImage = /** @class */ (function () {
176
176
  id: id,
177
177
  });
178
178
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
179
- url = utils.generateURL(baseURL, "/init-image/{id}", req);
179
+ operationUrl = utils.generateURL(baseURL, "/init-image/{id}", req);
180
180
  client = this.sdkConfiguration.defaultClient;
181
181
  globalSecurity = this.sdkConfiguration.security;
182
182
  if (!(typeof globalSecurity === "function")) return [3 /*break*/, 2];
@@ -192,26 +192,26 @@ var InitImage = /** @class */ (function () {
192
192
  headers = __assign(__assign({}, config === null || config === void 0 ? void 0 : config.headers), properties.headers);
193
193
  headers["Accept"] = "application/json";
194
194
  headers["user-agent"] = this.sdkConfiguration.userAgent;
195
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
195
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "get", headers: headers, responseType: "arraybuffer" }, config))];
196
196
  case 3:
197
197
  httpRes = _c.sent();
198
- contentType = (_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 : "";
198
+ 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 : "";
199
199
  if ((httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == null) {
200
200
  throw new Error("status code not found in response: ".concat(httpRes));
201
201
  }
202
202
  res = new operations.GetInitImageByIdResponse({
203
203
  statusCode: httpRes.status,
204
- contentType: contentType,
204
+ contentType: responseContentType,
205
205
  rawResponse: httpRes,
206
206
  });
207
207
  decodedRes = new TextDecoder().decode(httpRes === null || httpRes === void 0 ? void 0 : httpRes.data);
208
208
  switch (true) {
209
209
  case (httpRes === null || httpRes === void 0 ? void 0 : httpRes.status) == 200:
210
- if (utils.matchContentType(contentType, "application/json")) {
210
+ if (utils.matchContentType(responseContentType, "application/json")) {
211
211
  res.object = utils.objectToClass(JSON.parse(decodedRes), operations.GetInitImageByIdResponseBody);
212
212
  }
213
213
  else {
214
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
214
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
215
215
  }
216
216
  break;
217
217
  }
@@ -229,7 +229,7 @@ var InitImage = /** @class */ (function () {
229
229
  InitImage.prototype.uploadInitImage = function (req, config) {
230
230
  var _a, _b;
231
231
  return __awaiter(this, void 0, void 0, function () {
232
- var baseURL, url, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, contentType, res, decodedRes;
232
+ var baseURL, operationUrl, _c, reqBodyHeaders, reqBody, client, globalSecurity, properties, headers, httpRes, responseContentType, res, decodedRes;
233
233
  var _d;
234
234
  return __generator(this, function (_e) {
235
235
  switch (_e.label) {
@@ -238,7 +238,7 @@ var InitImage = /** @class */ (function () {
238
238
  req = new operations.UploadInitImageRequestBody(req);
239
239
  }
240
240
  baseURL = utils.templateUrl(this.sdkConfiguration.serverURL, this.sdkConfiguration.serverDefaults);
241
- url = baseURL.replace(/\/$/, "") + "/init-image";
241
+ operationUrl = baseURL.replace(/\/$/, "") + "/init-image";
242
242
  _c = __read([{}, null], 2), reqBodyHeaders = _c[0], reqBody = _c[1];
243
243
  try {
244
244
  _d = __read(utils.serializeRequestBody(req, "request", "json"), 2), reqBodyHeaders = _d[0], reqBody = _d[1];
@@ -265,26 +265,26 @@ var InitImage = /** @class */ (function () {
265
265
  throw new Error("request body is required");
266
266
  headers["Accept"] = "application/json";
267
267
  headers["user-agent"] = this.sdkConfiguration.userAgent;
268
- return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: url, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
268
+ return [4 /*yield*/, client.request(__assign({ validateStatus: function () { return true; }, url: operationUrl, method: "post", headers: headers, responseType: "arraybuffer", data: reqBody }, config))];
269
269
  case 3:
270
270
  httpRes = _e.sent();
271
- contentType = (_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 : "";
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.UploadInitImageResponse({
276
276
  statusCode: httpRes.status,
277
- contentType: 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(contentType, "application/json")) {
283
+ if (utils.matchContentType(responseContentType, "application/json")) {
284
284
  res.object = utils.objectToClass(JSON.parse(decodedRes), operations.UploadInitImageResponseBody);
285
285
  }
286
286
  else {
287
- throw new errors.SDKError("unknown content-type received: " + contentType, httpRes.status, decodedRes, httpRes);
287
+ throw new errors.SDKError("unknown content-type received: " + responseContentType, httpRes.status, decodedRes, httpRes);
288
288
  }
289
289
  break;
290
290
  }