@product-live/api-sdk 2.4.1 → 2.8.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.
Files changed (264) hide show
  1. package/DataFactoryFileApi.md +182 -0
  2. package/JobApi.md +333 -0
  3. package/JobExecutionApi.md +185 -0
  4. package/README.md +80 -0
  5. package/TaskApi.md +375 -0
  6. package/TaskExecutionApi.md +130 -0
  7. package/VariableApi.md +315 -0
  8. package/apis/DataFactoryFileApi.ts +252 -133
  9. package/apis/JobApi.ts +412 -208
  10. package/apis/JobExecutionApi.ts +237 -121
  11. package/apis/TaskApi.ts +458 -213
  12. package/apis/TaskExecutionApi.ts +174 -90
  13. package/apis/VariableApi.ts +418 -149
  14. package/apis/baseapi.ts +37 -0
  15. package/apis/exception.ts +15 -0
  16. package/auth/auth.ts +107 -0
  17. package/configuration.ts +82 -0
  18. package/dist/apis/DataFactoryFileApi.d.ts +14 -19
  19. package/dist/apis/DataFactoryFileApi.js +340 -103
  20. package/dist/apis/DataFactoryFileApi.js.map +1 -1
  21. package/dist/apis/JobApi.d.ts +19 -31
  22. package/dist/apis/JobApi.js +524 -171
  23. package/dist/apis/JobApi.js.map +1 -1
  24. package/dist/apis/JobExecutionApi.d.ts +14 -18
  25. package/dist/apis/JobExecutionApi.js +320 -88
  26. package/dist/apis/JobExecutionApi.js.map +1 -1
  27. package/dist/apis/TaskApi.d.ts +22 -34
  28. package/dist/apis/TaskApi.js +584 -171
  29. package/dist/apis/TaskApi.js.map +1 -1
  30. package/dist/apis/TaskExecutionApi.d.ts +11 -13
  31. package/dist/apis/TaskExecutionApi.js +242 -62
  32. package/dist/apis/TaskExecutionApi.js.map +1 -1
  33. package/dist/apis/VariableApi.d.ts +20 -24
  34. package/dist/apis/VariableApi.js +508 -119
  35. package/dist/apis/VariableApi.js.map +1 -1
  36. package/dist/apis/baseapi.d.ts +18 -0
  37. package/dist/apis/baseapi.js +46 -0
  38. package/dist/apis/baseapi.js.map +1 -0
  39. package/dist/apis/exception.d.ts +10 -0
  40. package/dist/apis/exception.js +32 -0
  41. package/dist/apis/exception.js.map +1 -0
  42. package/dist/auth/auth.d.ts +42 -0
  43. package/dist/auth/auth.js +45 -0
  44. package/dist/auth/auth.js.map +1 -0
  45. package/dist/configuration.d.ts +18 -0
  46. package/dist/configuration.js +22 -0
  47. package/dist/configuration.js.map +1 -0
  48. package/dist/http/http.d.ts +82 -0
  49. package/dist/http/http.js +229 -0
  50. package/dist/http/http.js.map +1 -0
  51. package/dist/http/isomorphic-fetch.d.ts +5 -0
  52. package/dist/http/isomorphic-fetch.js +34 -0
  53. package/dist/http/isomorphic-fetch.js.map +1 -0
  54. package/dist/index.d.ts +10 -3
  55. package/dist/index.js +17 -3
  56. package/dist/index.js.map +1 -1
  57. package/dist/middleware.d.ts +16 -0
  58. package/dist/middleware.js +18 -0
  59. package/dist/middleware.js.map +1 -0
  60. package/dist/models/CreateJobDto.d.ts +27 -24
  61. package/dist/models/CreateJobDto.js +77 -62
  62. package/dist/models/CreateJobDto.js.map +1 -1
  63. package/dist/models/CreateJobExecutionDto.d.ts +18 -9
  64. package/dist/models/CreateJobExecutionDto.js +29 -38
  65. package/dist/models/CreateJobExecutionDto.js.map +1 -1
  66. package/dist/models/CreateTaskDto.d.ts +20 -10
  67. package/dist/models/CreateTaskDto.js +41 -42
  68. package/dist/models/CreateTaskDto.js.map +1 -1
  69. package/dist/models/CreateVariableDto.d.ts +21 -16
  70. package/dist/models/CreateVariableDto.js +41 -46
  71. package/dist/models/CreateVariableDto.js.map +1 -1
  72. package/dist/models/FileDto.d.ts +22 -11
  73. package/dist/models/FileDto.js +47 -45
  74. package/dist/models/FileDto.js.map +1 -1
  75. package/dist/models/FindVariablesRequest.d.ts +24 -0
  76. package/dist/models/FindVariablesRequest.js +46 -0
  77. package/dist/models/FindVariablesRequest.js.map +1 -0
  78. package/dist/models/GetFiles200Response.d.ts +21 -0
  79. package/dist/models/GetFiles200Response.js +34 -0
  80. package/dist/models/GetFiles200Response.js.map +1 -0
  81. package/dist/models/GetJobExecutionById400Response.d.ts +17 -0
  82. package/dist/models/GetJobExecutionById400Response.js +22 -0
  83. package/dist/models/GetJobExecutionById400Response.js.map +1 -0
  84. package/dist/models/GetJobExecutions200Response.d.ts +21 -0
  85. package/dist/models/GetJobExecutions200Response.js +34 -0
  86. package/dist/models/GetJobExecutions200Response.js.map +1 -0
  87. package/dist/models/GetJobs200Response.d.ts +21 -0
  88. package/dist/models/GetJobs200Response.js +34 -0
  89. package/dist/models/GetJobs200Response.js.map +1 -0
  90. package/dist/models/GetTasks200Response.d.ts +21 -0
  91. package/dist/models/GetTasks200Response.js +34 -0
  92. package/dist/models/GetTasks200Response.js.map +1 -0
  93. package/dist/models/GetVariables200Response.d.ts +21 -0
  94. package/dist/models/GetVariables200Response.js +34 -0
  95. package/dist/models/GetVariables200Response.js.map +1 -0
  96. package/dist/models/HighOrderQuery.d.ts +20 -0
  97. package/dist/models/HighOrderQuery.js +28 -0
  98. package/dist/models/HighOrderQuery.js.map +1 -0
  99. package/dist/models/JobDto.d.ts +32 -28
  100. package/dist/models/JobDto.js +101 -74
  101. package/dist/models/JobDto.js.map +1 -1
  102. package/dist/models/JobExecutionDto.d.ts +28 -33
  103. package/dist/models/JobExecutionDto.js +83 -77
  104. package/dist/models/JobExecutionDto.js.map +1 -1
  105. package/dist/models/LowOrderQuery.d.ts +22 -0
  106. package/dist/models/LowOrderQuery.js +40 -0
  107. package/dist/models/LowOrderQuery.js.map +1 -0
  108. package/dist/models/LowOrderQueryValue.d.ts +16 -0
  109. package/dist/models/LowOrderQueryValue.js +15 -0
  110. package/dist/models/LowOrderQueryValue.js.map +1 -0
  111. package/dist/models/ObjectSerializer.d.ts +34 -0
  112. package/dist/models/ObjectSerializer.js +313 -0
  113. package/dist/models/ObjectSerializer.js.map +1 -0
  114. package/dist/models/PatchTaskExecutionDto.d.ts +19 -13
  115. package/dist/models/PatchTaskExecutionDto.js +29 -40
  116. package/dist/models/PatchTaskExecutionDto.js.map +1 -1
  117. package/dist/models/Query.d.ts +18 -0
  118. package/dist/models/Query.js +22 -0
  119. package/dist/models/Query.js.map +1 -0
  120. package/dist/models/TaskDto.d.ts +25 -14
  121. package/dist/models/TaskDto.js +65 -54
  122. package/dist/models/TaskDto.js.map +1 -1
  123. package/dist/models/TaskExecutionDto.d.ts +25 -21
  124. package/dist/models/TaskExecutionDto.js +59 -58
  125. package/dist/models/TaskExecutionDto.js.map +1 -1
  126. package/dist/models/UpdateJobDto.d.ts +28 -25
  127. package/dist/models/UpdateJobDto.js +83 -65
  128. package/dist/models/UpdateJobDto.js.map +1 -1
  129. package/dist/models/UpdateTaskDto.d.ts +21 -11
  130. package/dist/models/UpdateTaskDto.js +47 -45
  131. package/dist/models/UpdateTaskDto.js.map +1 -1
  132. package/dist/models/UpdateVariableDto.d.ts +22 -17
  133. package/dist/models/UpdateVariableDto.js +47 -49
  134. package/dist/models/UpdateVariableDto.js.map +1 -1
  135. package/dist/models/VariableDto.d.ts +26 -20
  136. package/dist/models/VariableDto.js +65 -58
  137. package/dist/models/VariableDto.js.map +1 -1
  138. package/dist/models/all.d.ts +25 -0
  139. package/dist/models/all.js +42 -0
  140. package/dist/models/all.js.map +1 -0
  141. package/dist/rxjsStub.d.ts +10 -0
  142. package/dist/rxjsStub.js +33 -0
  143. package/dist/rxjsStub.js.map +1 -0
  144. package/dist/servers.d.ts +17 -0
  145. package/dist/servers.js +32 -0
  146. package/dist/servers.js.map +1 -0
  147. package/dist/types/ObjectParamAPI.d.ts +160 -0
  148. package/dist/types/ObjectParamAPI.js +129 -0
  149. package/dist/types/ObjectParamAPI.js.map +1 -0
  150. package/dist/types/ObservableAPI.d.ts +89 -0
  151. package/dist/types/ObservableAPI.js +642 -0
  152. package/dist/types/ObservableAPI.js.map +1 -0
  153. package/dist/types/PromiseAPI.d.ts +76 -0
  154. package/dist/types/PromiseAPI.js +148 -0
  155. package/dist/types/PromiseAPI.js.map +1 -0
  156. package/dist/util.d.ts +2 -0
  157. package/dist/util.js +29 -0
  158. package/dist/util.js.map +1 -0
  159. package/git_push.sh +51 -0
  160. package/http/http.ts +229 -0
  161. package/http/isomorphic-fetch.ts +32 -0
  162. package/index.ts +12 -5
  163. package/middleware.ts +66 -0
  164. package/models/CreateJobDto.ts +88 -144
  165. package/models/CreateJobExecutionDto.ts +29 -71
  166. package/models/CreateTaskDto.ts +43 -82
  167. package/models/CreateVariableDto.ts +46 -92
  168. package/models/FileDto.ts +53 -91
  169. package/models/FindVariablesRequest.ts +70 -0
  170. package/models/GetFiles200Response.ts +53 -0
  171. package/models/GetJobExecutionById400Response.ts +35 -0
  172. package/models/GetJobExecutions200Response.ts +53 -0
  173. package/models/GetJobs200Response.ts +53 -0
  174. package/models/GetTasks200Response.ts +53 -0
  175. package/models/GetVariables200Response.ts +53 -0
  176. package/models/HighOrderQuery.ts +46 -0
  177. package/models/JobDto.ts +117 -180
  178. package/models/JobExecutionDto.ts +95 -165
  179. package/models/LowOrderQuery.ts +60 -0
  180. package/models/LowOrderQueryValue.ts +29 -0
  181. package/models/ObjectSerializer.ts +324 -0
  182. package/models/PatchTaskExecutionDto.ts +36 -78
  183. package/models/Query.ts +38 -0
  184. package/models/TaskDto.ts +74 -118
  185. package/models/TaskExecutionDto.ts +68 -123
  186. package/models/UpdateJobDto.ts +95 -153
  187. package/models/UpdateTaskDto.ts +50 -91
  188. package/models/UpdateVariableDto.ts +53 -101
  189. package/models/VariableDto.ts +75 -128
  190. package/models/all.ts +25 -0
  191. package/package.json +35 -10
  192. package/rxjsStub.ts +27 -0
  193. package/servers.ts +55 -0
  194. package/types/ObjectParamAPI.ts +580 -0
  195. package/types/ObservableAPI.ts +701 -0
  196. package/types/PromiseAPI.ts +370 -0
  197. package/util.ts +37 -0
  198. package/apis/index.ts +0 -8
  199. package/dist/apis/index.d.ts +0 -6
  200. package/dist/apis/index.js +0 -23
  201. package/dist/apis/index.js.map +0 -1
  202. package/dist/models/FileControllerGetFiles200Response.d.ts +0 -14
  203. package/dist/models/FileControllerGetFiles200Response.js +0 -43
  204. package/dist/models/FileControllerGetFiles200Response.js.map +0 -1
  205. package/dist/models/JobControllerList200Response.d.ts +0 -14
  206. package/dist/models/JobControllerList200Response.js +0 -43
  207. package/dist/models/JobControllerList200Response.js.map +0 -1
  208. package/dist/models/JobDtoPeriodicityInner.d.ts +0 -8
  209. package/dist/models/JobDtoPeriodicityInner.js +0 -37
  210. package/dist/models/JobDtoPeriodicityInner.js.map +0 -1
  211. package/dist/models/JobDtoTasksInner.d.ts +0 -14
  212. package/dist/models/JobDtoTasksInner.js +0 -45
  213. package/dist/models/JobDtoTasksInner.js.map +0 -1
  214. package/dist/models/JobDtoTitleLocal.d.ts +0 -8
  215. package/dist/models/JobDtoTitleLocal.js +0 -37
  216. package/dist/models/JobDtoTitleLocal.js.map +0 -1
  217. package/dist/models/JobExecutionControllerGetOne400Response.d.ts +0 -7
  218. package/dist/models/JobExecutionControllerGetOne400Response.js +0 -35
  219. package/dist/models/JobExecutionControllerGetOne400Response.js.map +0 -1
  220. package/dist/models/JobExecutionControllerList200Response.d.ts +0 -14
  221. package/dist/models/JobExecutionControllerList200Response.js +0 -43
  222. package/dist/models/JobExecutionControllerList200Response.js.map +0 -1
  223. package/dist/models/JobExecutionDtoInfo.d.ts +0 -7
  224. package/dist/models/JobExecutionDtoInfo.js +0 -35
  225. package/dist/models/JobExecutionDtoInfo.js.map +0 -1
  226. package/dist/models/TaskControllerList200Response.d.ts +0 -14
  227. package/dist/models/TaskControllerList200Response.js +0 -43
  228. package/dist/models/TaskControllerList200Response.js.map +0 -1
  229. package/dist/models/TaskDtoInputKeysInner.d.ts +0 -8
  230. package/dist/models/TaskDtoInputKeysInner.js +0 -37
  231. package/dist/models/TaskDtoInputKeysInner.js.map +0 -1
  232. package/dist/models/VariableControllerList200Response.d.ts +0 -14
  233. package/dist/models/VariableControllerList200Response.js +0 -43
  234. package/dist/models/VariableControllerList200Response.js.map +0 -1
  235. package/dist/models/index.d.ts +0 -20
  236. package/dist/models/index.js +0 -37
  237. package/dist/models/index.js.map +0 -1
  238. package/dist/runtime.d.ts +0 -154
  239. package/dist/runtime.js +0 -306
  240. package/dist/runtime.js.map +0 -1
  241. package/models/ExecuteJob400Response.ts +0 -65
  242. package/models/ExecuteJobDto.ts +0 -97
  243. package/models/ExecuteJobDtoInfo.ts +0 -65
  244. package/models/ExecuteJobDtoJob.ts +0 -81
  245. package/models/FileControllerGetFiles200Response.ts +0 -98
  246. package/models/FileCreatedDto.ts +0 -111
  247. package/models/JobControllerList200Response.ts +0 -98
  248. package/models/JobDtoPeriodicitiesInner.ts +0 -73
  249. package/models/JobDtoPeriodicityInner.ts +0 -73
  250. package/models/JobDtoProject.ts +0 -73
  251. package/models/JobDtoTasksInner.ts +0 -105
  252. package/models/JobDtoTitleLocal.ts +0 -73
  253. package/models/JobExecutionControllerGetOne400Response.ts +0 -65
  254. package/models/JobExecutionControllerList200Response.ts +0 -98
  255. package/models/JobExecutionDtoEventsInner.ts +0 -89
  256. package/models/JobExecutionDtoInfo.ts +0 -65
  257. package/models/JobExecutionDtoJob.ts +0 -81
  258. package/models/TaskControllerList200Response.ts +0 -98
  259. package/models/TaskDtoInputKeysInner.ts +0 -73
  260. package/models/TaskInstanceDto.ts +0 -143
  261. package/models/TaskInstanceUpdateDto.ts +0 -107
  262. package/models/VariableControllerList200Response.ts +0 -98
  263. package/models/index.ts +0 -22
  264. package/runtime.ts +0 -425
package/apis/TaskApi.ts CHANGED
@@ -1,313 +1,558 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
1
+ // TODO: better import syntax?
2
+ import {BaseAPIRequestFactory, RequiredError, COLLECTION_FORMATS} from './baseapi';
3
+ import {Configuration} from '../configuration';
4
+ import {RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
5
+ import * as FormData from "form-data";
6
+ import { URLSearchParams } from 'url';
7
+ import {ObjectSerializer} from '../models/ObjectSerializer';
8
+ import {ApiException} from './exception';
9
+ import {canConsumeForm, isCodeInRange} from '../util';
10
+ import {SecurityAuthentication} from '../auth/auth';
11
+
12
+
13
+ import { CreateTaskDto } from '../models/CreateTaskDto';
14
+ import { GetJobExecutionById400Response } from '../models/GetJobExecutionById400Response';
15
+ import { GetTasks200Response } from '../models/GetTasks200Response';
16
+ import { TaskDto } from '../models/TaskDto';
17
+ import { TaskExecutionDto } from '../models/TaskExecutionDto';
18
+ import { UpdateTaskDto } from '../models/UpdateTaskDto';
19
+
3
20
  /**
4
- * Product-Live API
5
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- *
7
- * The version of the OpenAPI document: 2.4.1
8
- *
9
- *
10
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
- * https://openapi-generator.tech
12
- * Do not edit the class manually.
21
+ * no description
13
22
  */
23
+ export class TaskApiRequestFactory extends BaseAPIRequestFactory {
14
24
 
25
+ /**
26
+ * (Experimental) - Create a Task
27
+ * @param createTaskDto
28
+ */
29
+ public async createTask(createTaskDto: CreateTaskDto, _options?: Configuration): Promise<RequestContext> {
30
+ let _config = _options || this.configuration;
15
31
 
16
- import * as runtime from '../runtime';
17
- import type {
18
- CreateTaskDto,
19
- JobExecutionControllerGetOne400Response,
20
- TaskControllerList200Response,
21
- TaskDto,
22
- TaskExecutionDto,
23
- UpdateTaskDto,
24
- } from '../models';
25
- import {
26
- CreateTaskDtoFromJSON,
27
- CreateTaskDtoToJSON,
28
- JobExecutionControllerGetOne400ResponseFromJSON,
29
- JobExecutionControllerGetOne400ResponseToJSON,
30
- TaskControllerList200ResponseFromJSON,
31
- TaskControllerList200ResponseToJSON,
32
- TaskDtoFromJSON,
33
- TaskDtoToJSON,
34
- TaskExecutionDtoFromJSON,
35
- TaskExecutionDtoToJSON,
36
- UpdateTaskDtoFromJSON,
37
- UpdateTaskDtoToJSON,
38
- } from '../models';
39
-
40
- export interface TaskControllerCreateRequest {
41
- createTaskDto: CreateTaskDto;
42
- }
32
+ // verify required parameter 'createTaskDto' is not null or undefined
33
+ if (createTaskDto === null || createTaskDto === undefined) {
34
+ throw new RequiredError("TaskApi", "createTask", "createTaskDto");
35
+ }
43
36
 
44
- export interface TaskControllerDeleteRequest {
45
- taskId: string;
46
- }
47
37
 
48
- export interface TaskControllerGetOneRequest {
49
- id: string;
50
- }
38
+ // Path Params
39
+ const localVarPath = '/v1/data_factory/tasks';
51
40
 
52
- export interface TaskControllerListRequest {
53
- size?: number;
54
- page?: number;
55
- }
41
+ // Make Request Context
42
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
43
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
56
44
 
57
- export interface TaskControllerPollRequest {
58
- id: string;
59
- }
60
45
 
61
- export interface TaskControllerUpdateRequest {
62
- id: string;
63
- updateTaskDto: UpdateTaskDto;
64
- }
46
+ // Body Params
47
+ const contentType = ObjectSerializer.getPreferredMediaType([
48
+ "application/json"
49
+ ]);
50
+ requestContext.setHeaderParam("Content-Type", contentType);
51
+ const serializedBody = ObjectSerializer.stringify(
52
+ ObjectSerializer.serialize(createTaskDto, "CreateTaskDto", ""),
53
+ contentType
54
+ );
55
+ requestContext.setBody(serializedBody);
65
56
 
66
- /**
67
- *
68
- */
69
- export class TaskApi extends runtime.BaseAPI {
57
+ let authMethod: SecurityAuthentication | undefined;
58
+ // Apply auth methods
59
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
60
+ if (authMethod?.applySecurityAuthentication) {
61
+ await authMethod?.applySecurityAuthentication(requestContext);
62
+ }
63
+ // Apply auth methods
64
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
65
+ if (authMethod?.applySecurityAuthentication) {
66
+ await authMethod?.applySecurityAuthentication(requestContext);
67
+ }
68
+
69
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
70
+ if (defaultAuth?.applySecurityAuthentication) {
71
+ await defaultAuth?.applySecurityAuthentication(requestContext);
72
+ }
73
+
74
+ return requestContext;
75
+ }
70
76
 
71
77
  /**
72
- * (Experimental) - Create a Task
78
+ * (Experimental) - Delete a Task by id
79
+ * @param id
73
80
  */
74
- async taskControllerCreateRaw(requestParameters: TaskControllerCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskDto>> {
75
- if (requestParameters.createTaskDto === null || requestParameters.createTaskDto === undefined) {
76
- throw new runtime.RequiredError('createTaskDto','Required parameter requestParameters.createTaskDto was null or undefined when calling taskControllerCreate.');
81
+ public async deleteTask(id: string, _options?: Configuration): Promise<RequestContext> {
82
+ let _config = _options || this.configuration;
83
+
84
+ // verify required parameter 'id' is not null or undefined
85
+ if (id === null || id === undefined) {
86
+ throw new RequiredError("TaskApi", "deleteTask", "id");
77
87
  }
78
88
 
79
- const queryParameters: any = {};
80
89
 
81
- const headerParameters: runtime.HTTPHeaders = {};
90
+ // Path Params
91
+ const localVarPath = '/v1/data_factory/tasks/{id}'
92
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
82
93
 
83
- headerParameters['Content-Type'] = 'application/json';
94
+ // Make Request Context
95
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
96
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
84
97
 
85
- if (this.configuration && this.configuration.apiKey) {
86
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
87
- }
88
98
 
89
- if (this.configuration && this.configuration.apiKey) {
90
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
99
+ let authMethod: SecurityAuthentication | undefined;
100
+ // Apply auth methods
101
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
102
+ if (authMethod?.applySecurityAuthentication) {
103
+ await authMethod?.applySecurityAuthentication(requestContext);
104
+ }
105
+ // Apply auth methods
106
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
107
+ if (authMethod?.applySecurityAuthentication) {
108
+ await authMethod?.applySecurityAuthentication(requestContext);
109
+ }
110
+
111
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
112
+ if (defaultAuth?.applySecurityAuthentication) {
113
+ await defaultAuth?.applySecurityAuthentication(requestContext);
91
114
  }
92
115
 
93
- const response = await this.request({
94
- path: `/v1/data_factory/tasks`,
95
- method: 'POST',
96
- headers: headerParameters,
97
- query: queryParameters,
98
- body: CreateTaskDtoToJSON(requestParameters.createTaskDto),
99
- }, initOverrides);
100
-
101
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskDtoFromJSON(jsonValue));
116
+ return requestContext;
102
117
  }
103
118
 
104
119
  /**
105
- * (Experimental) - Create a Task
120
+ * (Experimental) - Get a Task by id
121
+ * @param id
106
122
  */
107
- async taskControllerCreate(requestParameters: TaskControllerCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskDto> {
108
- const response = await this.taskControllerCreateRaw(requestParameters, initOverrides);
109
- return await response.value();
110
- }
123
+ public async getTaskById(id: string, _options?: Configuration): Promise<RequestContext> {
124
+ let _config = _options || this.configuration;
111
125
 
112
- /**
113
- * (Experimental) - Delete a Task by id
114
- */
115
- async taskControllerDeleteRaw(requestParameters: TaskControllerDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskDto>> {
116
- if (requestParameters.taskId === null || requestParameters.taskId === undefined) {
117
- throw new runtime.RequiredError('taskId','Required parameter requestParameters.taskId was null or undefined when calling taskControllerDelete.');
126
+ // verify required parameter 'id' is not null or undefined
127
+ if (id === null || id === undefined) {
128
+ throw new RequiredError("TaskApi", "getTaskById", "id");
118
129
  }
119
130
 
120
- const queryParameters: any = {};
121
131
 
122
- const headerParameters: runtime.HTTPHeaders = {};
132
+ // Path Params
133
+ const localVarPath = '/v1/data_factory/tasks/{id}'
134
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
123
135
 
124
- if (this.configuration && this.configuration.apiKey) {
125
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
126
- }
136
+ // Make Request Context
137
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
138
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
127
139
 
128
- if (this.configuration && this.configuration.apiKey) {
129
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
130
- }
131
140
 
132
- const response = await this.request({
133
- path: `/v1/data_factory/tasks/{task_id}`.replace(`{${"task_id"}}`, encodeURIComponent(String(requestParameters.taskId))),
134
- method: 'DELETE',
135
- headers: headerParameters,
136
- query: queryParameters,
137
- }, initOverrides);
141
+ let authMethod: SecurityAuthentication | undefined;
142
+ // Apply auth methods
143
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
144
+ if (authMethod?.applySecurityAuthentication) {
145
+ await authMethod?.applySecurityAuthentication(requestContext);
146
+ }
147
+ // Apply auth methods
148
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
149
+ if (authMethod?.applySecurityAuthentication) {
150
+ await authMethod?.applySecurityAuthentication(requestContext);
151
+ }
152
+
153
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
154
+ if (defaultAuth?.applySecurityAuthentication) {
155
+ await defaultAuth?.applySecurityAuthentication(requestContext);
156
+ }
138
157
 
139
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskDtoFromJSON(jsonValue));
158
+ return requestContext;
140
159
  }
141
160
 
142
161
  /**
143
- * (Experimental) - Delete a Task by id
162
+ * (Experimental) - Get a list of Task
163
+ * @param size
164
+ * @param page
144
165
  */
145
- async taskControllerDelete(requestParameters: TaskControllerDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskDto> {
146
- const response = await this.taskControllerDeleteRaw(requestParameters, initOverrides);
147
- return await response.value();
148
- }
166
+ public async getTasks(size?: number, page?: number, _options?: Configuration): Promise<RequestContext> {
167
+ let _config = _options || this.configuration;
168
+
149
169
 
150
- /**
151
- * (Experimental) - Get a Task by id
152
- */
153
- async taskControllerGetOneRaw(requestParameters: TaskControllerGetOneRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskDto>> {
154
- if (requestParameters.id === null || requestParameters.id === undefined) {
155
- throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling taskControllerGetOne.');
156
- }
157
170
 
158
- const queryParameters: any = {};
171
+ // Path Params
172
+ const localVarPath = '/v1/data_factory/tasks';
159
173
 
160
- const headerParameters: runtime.HTTPHeaders = {};
174
+ // Make Request Context
175
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
176
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
161
177
 
162
- if (this.configuration && this.configuration.apiKey) {
163
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
178
+ // Query Params
179
+ if (size !== undefined) {
180
+ requestContext.setQueryParam("size", ObjectSerializer.serialize(size, "number", ""));
164
181
  }
165
182
 
166
- if (this.configuration && this.configuration.apiKey) {
167
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
183
+ // Query Params
184
+ if (page !== undefined) {
185
+ requestContext.setQueryParam("page", ObjectSerializer.serialize(page, "number", ""));
168
186
  }
169
187
 
170
- const response = await this.request({
171
- path: `/v1/data_factory/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
172
- method: 'GET',
173
- headers: headerParameters,
174
- query: queryParameters,
175
- }, initOverrides);
176
188
 
177
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskDtoFromJSON(jsonValue));
189
+ let authMethod: SecurityAuthentication | undefined;
190
+ // Apply auth methods
191
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
192
+ if (authMethod?.applySecurityAuthentication) {
193
+ await authMethod?.applySecurityAuthentication(requestContext);
194
+ }
195
+ // Apply auth methods
196
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
197
+ if (authMethod?.applySecurityAuthentication) {
198
+ await authMethod?.applySecurityAuthentication(requestContext);
199
+ }
200
+
201
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
202
+ if (defaultAuth?.applySecurityAuthentication) {
203
+ await defaultAuth?.applySecurityAuthentication(requestContext);
204
+ }
205
+
206
+ return requestContext;
178
207
  }
179
208
 
180
209
  /**
181
- * (Experimental) - Get a Task by id
210
+ * (Experimental) - Poll a task if there is not task to poll, the API returns a `404 Not Found` error
211
+ * @param id
182
212
  */
183
- async taskControllerGetOne(requestParameters: TaskControllerGetOneRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskDto> {
184
- const response = await this.taskControllerGetOneRaw(requestParameters, initOverrides);
185
- return await response.value();
213
+ public async pollTaskExecution(id: string, _options?: Configuration): Promise<RequestContext> {
214
+ let _config = _options || this.configuration;
215
+
216
+ // verify required parameter 'id' is not null or undefined
217
+ if (id === null || id === undefined) {
218
+ throw new RequiredError("TaskApi", "pollTaskExecution", "id");
219
+ }
220
+
221
+
222
+ // Path Params
223
+ const localVarPath = '/v1/data_factory/tasks/{id}/poll'
224
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
225
+
226
+ // Make Request Context
227
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
228
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
229
+
230
+
231
+ let authMethod: SecurityAuthentication | undefined;
232
+ // Apply auth methods
233
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
234
+ if (authMethod?.applySecurityAuthentication) {
235
+ await authMethod?.applySecurityAuthentication(requestContext);
236
+ }
237
+ // Apply auth methods
238
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
239
+ if (authMethod?.applySecurityAuthentication) {
240
+ await authMethod?.applySecurityAuthentication(requestContext);
241
+ }
242
+
243
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
244
+ if (defaultAuth?.applySecurityAuthentication) {
245
+ await defaultAuth?.applySecurityAuthentication(requestContext);
246
+ }
247
+
248
+ return requestContext;
186
249
  }
187
250
 
188
251
  /**
189
- * (Experimental) - Get a list of Task
252
+ * (Experimental) - Update a Task
253
+ * @param id
254
+ * @param updateTaskDto
190
255
  */
191
- async taskControllerListRaw(requestParameters: TaskControllerListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskControllerList200Response>> {
192
- const queryParameters: any = {};
256
+ public async updateTask(id: string, updateTaskDto: UpdateTaskDto, _options?: Configuration): Promise<RequestContext> {
257
+ let _config = _options || this.configuration;
193
258
 
194
- if (requestParameters.size !== undefined) {
195
- queryParameters['size'] = requestParameters.size;
259
+ // verify required parameter 'id' is not null or undefined
260
+ if (id === null || id === undefined) {
261
+ throw new RequiredError("TaskApi", "updateTask", "id");
196
262
  }
197
263
 
198
- if (requestParameters.page !== undefined) {
199
- queryParameters['page'] = requestParameters.page;
264
+
265
+ // verify required parameter 'updateTaskDto' is not null or undefined
266
+ if (updateTaskDto === null || updateTaskDto === undefined) {
267
+ throw new RequiredError("TaskApi", "updateTask", "updateTaskDto");
200
268
  }
201
269
 
202
- const headerParameters: runtime.HTTPHeaders = {};
203
270
 
204
- if (this.configuration && this.configuration.apiKey) {
205
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
206
- }
271
+ // Path Params
272
+ const localVarPath = '/v1/data_factory/tasks/{id}'
273
+ .replace('{' + 'id' + '}', encodeURIComponent(String(id)));
207
274
 
208
- if (this.configuration && this.configuration.apiKey) {
209
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
210
- }
275
+ // Make Request Context
276
+ const requestContext = _config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
277
+ requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
211
278
 
212
- const response = await this.request({
213
- path: `/v1/data_factory/tasks`,
214
- method: 'GET',
215
- headers: headerParameters,
216
- query: queryParameters,
217
- }, initOverrides);
218
279
 
219
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskControllerList200ResponseFromJSON(jsonValue));
220
- }
280
+ // Body Params
281
+ const contentType = ObjectSerializer.getPreferredMediaType([
282
+ "application/json"
283
+ ]);
284
+ requestContext.setHeaderParam("Content-Type", contentType);
285
+ const serializedBody = ObjectSerializer.stringify(
286
+ ObjectSerializer.serialize(updateTaskDto, "UpdateTaskDto", ""),
287
+ contentType
288
+ );
289
+ requestContext.setBody(serializedBody);
221
290
 
222
- /**
223
- * (Experimental) - Get a list of Task
224
- */
225
- async taskControllerList(requestParameters: TaskControllerListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskControllerList200Response> {
226
- const response = await this.taskControllerListRaw(requestParameters, initOverrides);
227
- return await response.value();
291
+ let authMethod: SecurityAuthentication | undefined;
292
+ // Apply auth methods
293
+ authMethod = _config.authMethods["ApiKeyAuthQuery"]
294
+ if (authMethod?.applySecurityAuthentication) {
295
+ await authMethod?.applySecurityAuthentication(requestContext);
296
+ }
297
+ // Apply auth methods
298
+ authMethod = _config.authMethods["ApiKeyAuthHeader"]
299
+ if (authMethod?.applySecurityAuthentication) {
300
+ await authMethod?.applySecurityAuthentication(requestContext);
301
+ }
302
+
303
+ const defaultAuth: SecurityAuthentication | undefined = _options?.authMethods?.default || this.configuration?.authMethods?.default
304
+ if (defaultAuth?.applySecurityAuthentication) {
305
+ await defaultAuth?.applySecurityAuthentication(requestContext);
306
+ }
307
+
308
+ return requestContext;
228
309
  }
229
310
 
311
+ }
312
+
313
+ export class TaskApiResponseProcessor {
314
+
230
315
  /**
231
- * (Experimental) - Poll a task if there is not task to poll, the API returns a `404 Not Found` error
316
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
317
+ * to the expected objects
318
+ *
319
+ * @params response Response returned by the server for a request to createTask
320
+ * @throws ApiException if the response code was not in [200, 299]
232
321
  */
233
- async taskControllerPollRaw(requestParameters: TaskControllerPollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskExecutionDto>> {
234
- if (requestParameters.id === null || requestParameters.id === undefined) {
235
- throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling taskControllerPoll.');
322
+ public async createTask(response: ResponseContext): Promise<TaskDto > {
323
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
324
+ if (isCodeInRange("201", response.httpStatusCode)) {
325
+ const body: TaskDto = ObjectSerializer.deserialize(
326
+ ObjectSerializer.parse(await response.body.text(), contentType),
327
+ "TaskDto", ""
328
+ ) as TaskDto;
329
+ return body;
330
+ }
331
+ if (isCodeInRange("400", response.httpStatusCode)) {
332
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
333
+ ObjectSerializer.parse(await response.body.text(), contentType),
334
+ "GetJobExecutionById400Response", ""
335
+ ) as GetJobExecutionById400Response;
336
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
337
+ }
338
+ if (isCodeInRange("401", response.httpStatusCode)) {
339
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
236
340
  }
237
341
 
238
- const queryParameters: any = {};
342
+ // Work around for missing responses in specification, e.g. for petstore.yaml
343
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
344
+ const body: TaskDto = ObjectSerializer.deserialize(
345
+ ObjectSerializer.parse(await response.body.text(), contentType),
346
+ "TaskDto", ""
347
+ ) as TaskDto;
348
+ return body;
349
+ }
239
350
 
240
- const headerParameters: runtime.HTTPHeaders = {};
351
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
352
+ }
241
353
 
242
- if (this.configuration && this.configuration.apiKey) {
243
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
354
+ /**
355
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
356
+ * to the expected objects
357
+ *
358
+ * @params response Response returned by the server for a request to deleteTask
359
+ * @throws ApiException if the response code was not in [200, 299]
360
+ */
361
+ public async deleteTask(response: ResponseContext): Promise<TaskDto > {
362
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
363
+ if (isCodeInRange("201", response.httpStatusCode)) {
364
+ const body: TaskDto = ObjectSerializer.deserialize(
365
+ ObjectSerializer.parse(await response.body.text(), contentType),
366
+ "TaskDto", ""
367
+ ) as TaskDto;
368
+ return body;
244
369
  }
245
-
246
- if (this.configuration && this.configuration.apiKey) {
247
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
370
+ if (isCodeInRange("400", response.httpStatusCode)) {
371
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
372
+ ObjectSerializer.parse(await response.body.text(), contentType),
373
+ "GetJobExecutionById400Response", ""
374
+ ) as GetJobExecutionById400Response;
375
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
376
+ }
377
+ if (isCodeInRange("401", response.httpStatusCode)) {
378
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
379
+ }
380
+ if (isCodeInRange("404", response.httpStatusCode)) {
381
+ throw new ApiException<undefined>(response.httpStatusCode, "Not found", undefined, response.headers);
248
382
  }
249
383
 
250
- const response = await this.request({
251
- path: `/v1/data_factory/tasks/{id}/poll`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
252
- method: 'GET',
253
- headers: headerParameters,
254
- query: queryParameters,
255
- }, initOverrides);
384
+ // Work around for missing responses in specification, e.g. for petstore.yaml
385
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
386
+ const body: TaskDto = ObjectSerializer.deserialize(
387
+ ObjectSerializer.parse(await response.body.text(), contentType),
388
+ "TaskDto", ""
389
+ ) as TaskDto;
390
+ return body;
391
+ }
256
392
 
257
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskExecutionDtoFromJSON(jsonValue));
393
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
258
394
  }
259
395
 
260
396
  /**
261
- * (Experimental) - Poll a task if there is not task to poll, the API returns a `404 Not Found` error
397
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
398
+ * to the expected objects
399
+ *
400
+ * @params response Response returned by the server for a request to getTaskById
401
+ * @throws ApiException if the response code was not in [200, 299]
262
402
  */
263
- async taskControllerPoll(requestParameters: TaskControllerPollRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskExecutionDto> {
264
- const response = await this.taskControllerPollRaw(requestParameters, initOverrides);
265
- return await response.value();
403
+ public async getTaskById(response: ResponseContext): Promise<TaskDto > {
404
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
405
+ if (isCodeInRange("200", response.httpStatusCode)) {
406
+ const body: TaskDto = ObjectSerializer.deserialize(
407
+ ObjectSerializer.parse(await response.body.text(), contentType),
408
+ "TaskDto", ""
409
+ ) as TaskDto;
410
+ return body;
411
+ }
412
+ if (isCodeInRange("400", response.httpStatusCode)) {
413
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
414
+ ObjectSerializer.parse(await response.body.text(), contentType),
415
+ "GetJobExecutionById400Response", ""
416
+ ) as GetJobExecutionById400Response;
417
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
418
+ }
419
+ if (isCodeInRange("401", response.httpStatusCode)) {
420
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
421
+ }
422
+ if (isCodeInRange("404", response.httpStatusCode)) {
423
+ throw new ApiException<undefined>(response.httpStatusCode, "Not found", undefined, response.headers);
424
+ }
425
+
426
+ // Work around for missing responses in specification, e.g. for petstore.yaml
427
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
428
+ const body: TaskDto = ObjectSerializer.deserialize(
429
+ ObjectSerializer.parse(await response.body.text(), contentType),
430
+ "TaskDto", ""
431
+ ) as TaskDto;
432
+ return body;
433
+ }
434
+
435
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
266
436
  }
267
437
 
268
438
  /**
269
- * (Experimental) - Update a Task
439
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
440
+ * to the expected objects
441
+ *
442
+ * @params response Response returned by the server for a request to getTasks
443
+ * @throws ApiException if the response code was not in [200, 299]
270
444
  */
271
- async taskControllerUpdateRaw(requestParameters: TaskControllerUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TaskDto>> {
272
- if (requestParameters.id === null || requestParameters.id === undefined) {
273
- throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling taskControllerUpdate.');
445
+ public async getTasks(response: ResponseContext): Promise<GetTasks200Response > {
446
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
447
+ if (isCodeInRange("200", response.httpStatusCode)) {
448
+ const body: GetTasks200Response = ObjectSerializer.deserialize(
449
+ ObjectSerializer.parse(await response.body.text(), contentType),
450
+ "GetTasks200Response", ""
451
+ ) as GetTasks200Response;
452
+ return body;
274
453
  }
275
-
276
- if (requestParameters.updateTaskDto === null || requestParameters.updateTaskDto === undefined) {
277
- throw new runtime.RequiredError('updateTaskDto','Required parameter requestParameters.updateTaskDto was null or undefined when calling taskControllerUpdate.');
454
+ if (isCodeInRange("400", response.httpStatusCode)) {
455
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
456
+ ObjectSerializer.parse(await response.body.text(), contentType),
457
+ "GetJobExecutionById400Response", ""
458
+ ) as GetJobExecutionById400Response;
459
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
460
+ }
461
+ if (isCodeInRange("401", response.httpStatusCode)) {
462
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
278
463
  }
279
464
 
280
- const queryParameters: any = {};
281
-
282
- const headerParameters: runtime.HTTPHeaders = {};
465
+ // Work around for missing responses in specification, e.g. for petstore.yaml
466
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
467
+ const body: GetTasks200Response = ObjectSerializer.deserialize(
468
+ ObjectSerializer.parse(await response.body.text(), contentType),
469
+ "GetTasks200Response", ""
470
+ ) as GetTasks200Response;
471
+ return body;
472
+ }
283
473
 
284
- headerParameters['Content-Type'] = 'application/json';
474
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
475
+ }
285
476
 
286
- if (this.configuration && this.configuration.apiKey) {
287
- queryParameters["api_key"] = this.configuration.apiKey("api_key"); // ApiKeyAuthQuery authentication
477
+ /**
478
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
479
+ * to the expected objects
480
+ *
481
+ * @params response Response returned by the server for a request to pollTaskExecution
482
+ * @throws ApiException if the response code was not in [200, 299]
483
+ */
484
+ public async pollTaskExecution(response: ResponseContext): Promise<TaskExecutionDto > {
485
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
486
+ if (isCodeInRange("200", response.httpStatusCode)) {
487
+ const body: TaskExecutionDto = ObjectSerializer.deserialize(
488
+ ObjectSerializer.parse(await response.body.text(), contentType),
489
+ "TaskExecutionDto", ""
490
+ ) as TaskExecutionDto;
491
+ return body;
288
492
  }
289
-
290
- if (this.configuration && this.configuration.apiKey) {
291
- headerParameters["X-Api-Key"] = this.configuration.apiKey("X-Api-Key"); // ApiKeyAuthHeader authentication
493
+ if (isCodeInRange("400", response.httpStatusCode)) {
494
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
495
+ ObjectSerializer.parse(await response.body.text(), contentType),
496
+ "GetJobExecutionById400Response", ""
497
+ ) as GetJobExecutionById400Response;
498
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
499
+ }
500
+ if (isCodeInRange("401", response.httpStatusCode)) {
501
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
502
+ }
503
+ if (isCodeInRange("404", response.httpStatusCode)) {
504
+ throw new ApiException<undefined>(response.httpStatusCode, "Not found", undefined, response.headers);
292
505
  }
293
506
 
294
- const response = await this.request({
295
- path: `/v1/data_factory/tasks/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
296
- method: 'PUT',
297
- headers: headerParameters,
298
- query: queryParameters,
299
- body: UpdateTaskDtoToJSON(requestParameters.updateTaskDto),
300
- }, initOverrides);
507
+ // Work around for missing responses in specification, e.g. for petstore.yaml
508
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
509
+ const body: TaskExecutionDto = ObjectSerializer.deserialize(
510
+ ObjectSerializer.parse(await response.body.text(), contentType),
511
+ "TaskExecutionDto", ""
512
+ ) as TaskExecutionDto;
513
+ return body;
514
+ }
301
515
 
302
- return new runtime.JSONApiResponse(response, (jsonValue) => TaskDtoFromJSON(jsonValue));
516
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
303
517
  }
304
518
 
305
519
  /**
306
- * (Experimental) - Update a Task
520
+ * Unwraps the actual response sent by the server from the response context and deserializes the response content
521
+ * to the expected objects
522
+ *
523
+ * @params response Response returned by the server for a request to updateTask
524
+ * @throws ApiException if the response code was not in [200, 299]
307
525
  */
308
- async taskControllerUpdate(requestParameters: TaskControllerUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TaskDto> {
309
- const response = await this.taskControllerUpdateRaw(requestParameters, initOverrides);
310
- return await response.value();
526
+ public async updateTask(response: ResponseContext): Promise<TaskDto > {
527
+ const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
528
+ if (isCodeInRange("201", response.httpStatusCode)) {
529
+ const body: TaskDto = ObjectSerializer.deserialize(
530
+ ObjectSerializer.parse(await response.body.text(), contentType),
531
+ "TaskDto", ""
532
+ ) as TaskDto;
533
+ return body;
534
+ }
535
+ if (isCodeInRange("400", response.httpStatusCode)) {
536
+ const body: GetJobExecutionById400Response = ObjectSerializer.deserialize(
537
+ ObjectSerializer.parse(await response.body.text(), contentType),
538
+ "GetJobExecutionById400Response", ""
539
+ ) as GetJobExecutionById400Response;
540
+ throw new ApiException<GetJobExecutionById400Response>(response.httpStatusCode, "Bad Request - Malformed syntax", body, response.headers);
541
+ }
542
+ if (isCodeInRange("401", response.httpStatusCode)) {
543
+ throw new ApiException<undefined>(response.httpStatusCode, "Unauthorized", undefined, response.headers);
544
+ }
545
+
546
+ // Work around for missing responses in specification, e.g. for petstore.yaml
547
+ if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
548
+ const body: TaskDto = ObjectSerializer.deserialize(
549
+ ObjectSerializer.parse(await response.body.text(), contentType),
550
+ "TaskDto", ""
551
+ ) as TaskDto;
552
+ return body;
553
+ }
554
+
555
+ throw new ApiException<string | Buffer | undefined>(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
311
556
  }
312
557
 
313
558
  }