@migration-planner-ui/api-client 0.0.21 → 0.0.22

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.
@@ -11,6 +11,9 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import type { Assessment, AssessmentForm, AssessmentUpdate } from '../models/index';
14
+ export interface CancelAssessmentJobRequest {
15
+ id: string;
16
+ }
14
17
  export interface CreateAssessmentRequest {
15
18
  assessmentForm: AssessmentForm;
16
19
  }
@@ -31,6 +34,18 @@ export interface UpdateAssessmentRequest {
31
34
  * @interface AssessmentApiInterface
32
35
  */
33
36
  export interface AssessmentApiInterface {
37
+ /**
38
+ * Cancel the processing job for an assessment
39
+ * @param {string} id ID of the assessment
40
+ * @param {*} [options] Override http request option.
41
+ * @throws {RequiredError}
42
+ * @memberof AssessmentApiInterface
43
+ */
44
+ cancelAssessmentJobRaw(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
45
+ /**
46
+ * Cancel the processing job for an assessment
47
+ */
48
+ cancelAssessmentJob(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
34
49
  /**
35
50
  * Create an assessment
36
51
  * @param {AssessmentForm} assessmentForm
@@ -96,6 +111,14 @@ export interface AssessmentApiInterface {
96
111
  *
97
112
  */
98
113
  export declare class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInterface {
114
+ /**
115
+ * Cancel the processing job for an assessment
116
+ */
117
+ cancelAssessmentJobRaw(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
118
+ /**
119
+ * Cancel the processing job for an assessment
120
+ */
121
+ cancelAssessmentJob(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
99
122
  /**
100
123
  * Create an assessment
101
124
  */
@@ -26,6 +26,33 @@ import { AssessmentFromJSON, AssessmentFormToJSON, AssessmentUpdateToJSON, } fro
26
26
  *
27
27
  */
28
28
  export class AssessmentApi extends runtime.BaseAPI {
29
+ /**
30
+ * Cancel the processing job for an assessment
31
+ */
32
+ cancelAssessmentJobRaw(requestParameters, initOverrides) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['id'] == null) {
35
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling cancelAssessmentJob().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ const response = yield this.request({
40
+ path: `/api/v1/assessments/{id}/job`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
41
+ method: 'DELETE',
42
+ headers: headerParameters,
43
+ query: queryParameters,
44
+ }, initOverrides);
45
+ return new runtime.VoidApiResponse(response);
46
+ });
47
+ }
48
+ /**
49
+ * Cancel the processing job for an assessment
50
+ */
51
+ cancelAssessmentJob(requestParameters, initOverrides) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ yield this.cancelAssessmentJobRaw(requestParameters, initOverrides);
54
+ });
55
+ }
29
56
  /**
30
57
  * Create an assessment
31
58
  */
@@ -18,17 +18,40 @@ import type { Inventory } from './Inventory';
18
18
  export interface Snapshot {
19
19
  /**
20
20
  *
21
- * @type {Inventory}
21
+ * @type {Date}
22
+ * @memberof Snapshot
23
+ */
24
+ createdAt: Date;
25
+ /**
26
+ * Status of the snapshot processing
27
+ * @type {string}
22
28
  * @memberof Snapshot
23
29
  */
24
- inventory: Inventory;
30
+ status: SnapshotStatusEnum;
31
+ /**
32
+ * Error message if snapshot processing failed
33
+ * @type {string}
34
+ * @memberof Snapshot
35
+ */
36
+ error?: string;
25
37
  /**
26
38
  *
27
- * @type {Date}
39
+ * @type {Inventory}
28
40
  * @memberof Snapshot
29
41
  */
30
- createdAt: Date;
42
+ inventory?: Inventory;
31
43
  }
44
+ /**
45
+ * @export
46
+ */
47
+ export declare const SnapshotStatusEnum: {
48
+ readonly Pending: "pending";
49
+ readonly Parsing: "parsing";
50
+ readonly Validating: "validating";
51
+ readonly Ready: "ready";
52
+ readonly Failed: "failed";
53
+ };
54
+ export type SnapshotStatusEnum = typeof SnapshotStatusEnum[keyof typeof SnapshotStatusEnum];
32
55
  /**
33
56
  * Check if a given object implements the Snapshot interface.
34
57
  */
@@ -12,14 +12,24 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { InventoryFromJSON, InventoryToJSON, } from './Inventory';
15
+ /**
16
+ * @export
17
+ */
18
+ export const SnapshotStatusEnum = {
19
+ Pending: 'pending',
20
+ Parsing: 'parsing',
21
+ Validating: 'validating',
22
+ Ready: 'ready',
23
+ Failed: 'failed'
24
+ };
15
25
  /**
16
26
  * Check if a given object implements the Snapshot interface.
17
27
  */
18
28
  export function instanceOfSnapshot(value) {
19
- if (!('inventory' in value) || value['inventory'] === undefined)
20
- return false;
21
29
  if (!('createdAt' in value) || value['createdAt'] === undefined)
22
30
  return false;
31
+ if (!('status' in value) || value['status'] === undefined)
32
+ return false;
23
33
  return true;
24
34
  }
25
35
  export function SnapshotFromJSON(json) {
@@ -30,8 +40,10 @@ export function SnapshotFromJSONTyped(json, ignoreDiscriminator) {
30
40
  return json;
31
41
  }
32
42
  return {
33
- 'inventory': InventoryFromJSON(json['inventory']),
34
43
  'createdAt': (new Date(json['createdAt'])),
44
+ 'status': json['status'],
45
+ 'error': json['error'] == null ? undefined : json['error'],
46
+ 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),
35
47
  };
36
48
  }
37
49
  export function SnapshotToJSON(value) {
@@ -39,7 +51,9 @@ export function SnapshotToJSON(value) {
39
51
  return value;
40
52
  }
41
53
  return {
42
- 'inventory': InventoryToJSON(value['inventory']),
43
54
  'createdAt': ((value['createdAt']).toISOString()),
55
+ 'status': value['status'],
56
+ 'error': value['error'],
57
+ 'inventory': InventoryToJSON(value['inventory']),
44
58
  };
45
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@migration-planner-ui/api-client",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "OpenAPI client for the Migration Planner API",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -28,6 +28,10 @@ import {
28
28
  AssessmentUpdateToJSON,
29
29
  } from '../models/index';
30
30
 
31
+ export interface CancelAssessmentJobRequest {
32
+ id: string;
33
+ }
34
+
31
35
  export interface CreateAssessmentRequest {
32
36
  assessmentForm: AssessmentForm;
33
37
  }
@@ -52,6 +56,20 @@ export interface UpdateAssessmentRequest {
52
56
  * @interface AssessmentApiInterface
53
57
  */
54
58
  export interface AssessmentApiInterface {
59
+ /**
60
+ * Cancel the processing job for an assessment
61
+ * @param {string} id ID of the assessment
62
+ * @param {*} [options] Override http request option.
63
+ * @throws {RequiredError}
64
+ * @memberof AssessmentApiInterface
65
+ */
66
+ cancelAssessmentJobRaw(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
67
+
68
+ /**
69
+ * Cancel the processing job for an assessment
70
+ */
71
+ cancelAssessmentJob(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
72
+
55
73
  /**
56
74
  * Create an assessment
57
75
  * @param {AssessmentForm} assessmentForm
@@ -129,6 +147,38 @@ export interface AssessmentApiInterface {
129
147
  */
130
148
  export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInterface {
131
149
 
150
+ /**
151
+ * Cancel the processing job for an assessment
152
+ */
153
+ async cancelAssessmentJobRaw(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
154
+ if (requestParameters['id'] == null) {
155
+ throw new runtime.RequiredError(
156
+ 'id',
157
+ 'Required parameter "id" was null or undefined when calling cancelAssessmentJob().'
158
+ );
159
+ }
160
+
161
+ const queryParameters: any = {};
162
+
163
+ const headerParameters: runtime.HTTPHeaders = {};
164
+
165
+ const response = await this.request({
166
+ path: `/api/v1/assessments/{id}/job`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
167
+ method: 'DELETE',
168
+ headers: headerParameters,
169
+ query: queryParameters,
170
+ }, initOverrides);
171
+
172
+ return new runtime.VoidApiResponse(response);
173
+ }
174
+
175
+ /**
176
+ * Cancel the processing job for an assessment
177
+ */
178
+ async cancelAssessmentJob(requestParameters: CancelAssessmentJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
179
+ await this.cancelAssessmentJobRaw(requestParameters, initOverrides);
180
+ }
181
+
132
182
  /**
133
183
  * Create an assessment
134
184
  */
@@ -28,24 +28,50 @@ import {
28
28
  export interface Snapshot {
29
29
  /**
30
30
  *
31
- * @type {Inventory}
31
+ * @type {Date}
32
+ * @memberof Snapshot
33
+ */
34
+ createdAt: Date;
35
+ /**
36
+ * Status of the snapshot processing
37
+ * @type {string}
32
38
  * @memberof Snapshot
33
39
  */
34
- inventory: Inventory;
40
+ status: SnapshotStatusEnum;
41
+ /**
42
+ * Error message if snapshot processing failed
43
+ * @type {string}
44
+ * @memberof Snapshot
45
+ */
46
+ error?: string;
35
47
  /**
36
48
  *
37
- * @type {Date}
49
+ * @type {Inventory}
38
50
  * @memberof Snapshot
39
51
  */
40
- createdAt: Date;
52
+ inventory?: Inventory;
41
53
  }
42
54
 
55
+
56
+ /**
57
+ * @export
58
+ */
59
+ export const SnapshotStatusEnum = {
60
+ Pending: 'pending',
61
+ Parsing: 'parsing',
62
+ Validating: 'validating',
63
+ Ready: 'ready',
64
+ Failed: 'failed'
65
+ } as const;
66
+ export type SnapshotStatusEnum = typeof SnapshotStatusEnum[keyof typeof SnapshotStatusEnum];
67
+
68
+
43
69
  /**
44
70
  * Check if a given object implements the Snapshot interface.
45
71
  */
46
72
  export function instanceOfSnapshot(value: object): value is Snapshot {
47
- if (!('inventory' in value) || value['inventory'] === undefined) return false;
48
73
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
74
+ if (!('status' in value) || value['status'] === undefined) return false;
49
75
  return true;
50
76
  }
51
77
 
@@ -59,8 +85,10 @@ export function SnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean):
59
85
  }
60
86
  return {
61
87
 
62
- 'inventory': InventoryFromJSON(json['inventory']),
63
88
  'createdAt': (new Date(json['createdAt'])),
89
+ 'status': json['status'],
90
+ 'error': json['error'] == null ? undefined : json['error'],
91
+ 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),
64
92
  };
65
93
  }
66
94
 
@@ -70,8 +98,10 @@ export function SnapshotToJSON(value?: Snapshot | null): any {
70
98
  }
71
99
  return {
72
100
 
73
- 'inventory': InventoryToJSON(value['inventory']),
74
101
  'createdAt': ((value['createdAt']).toISOString()),
102
+ 'status': value['status'],
103
+ 'error': value['error'],
104
+ 'inventory': InventoryToJSON(value['inventory']),
75
105
  };
76
106
  }
77
107