@migration-planner-ui/api-client 0.0.14 → 0.0.16

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.
@@ -8,6 +8,7 @@ src/models/Agent.ts
8
8
  src/models/AgentProxy.ts
9
9
  src/models/Assessment.ts
10
10
  src/models/AssessmentForm.ts
11
+ src/models/AssessmentUpdate.ts
11
12
  src/models/Datastore.ts
12
13
  src/models/Histogram.ts
13
14
  src/models/Host.ts
@@ -19,6 +20,7 @@ src/models/ModelError.ts
19
20
  src/models/Network.ts
20
21
  src/models/OsInfo.ts
21
22
  src/models/PresignedUrl.ts
23
+ src/models/Snapshot.ts
22
24
  src/models/Source.ts
23
25
  src/models/SourceCreate.ts
24
26
  src/models/SourceUpdate.ts
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { Assessment, AssessmentForm } from '../models/index';
13
+ import type { Assessment, AssessmentForm, AssessmentUpdate } from '../models/index';
14
14
  export interface CreateAssessmentRequest {
15
15
  assessmentForm: AssessmentForm;
16
16
  }
@@ -20,6 +20,10 @@ export interface DeleteAssessmentRequest {
20
20
  export interface GetAssessmentRequest {
21
21
  id: string;
22
22
  }
23
+ export interface UpdateAssessmentRequest {
24
+ id: string;
25
+ assessmentUpdate: AssessmentUpdate;
26
+ }
23
27
  /**
24
28
  * AssessmentApi - interface
25
29
  *
@@ -74,6 +78,19 @@ export interface AssessmentApiInterface {
74
78
  * List assessments
75
79
  */
76
80
  listAssessments(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>>;
81
+ /**
82
+ * Update an assessment
83
+ * @param {string} id ID of the assessment
84
+ * @param {AssessmentUpdate} assessmentUpdate
85
+ * @param {*} [options] Override http request option.
86
+ * @throws {RequiredError}
87
+ * @memberof AssessmentApiInterface
88
+ */
89
+ updateAssessmentRaw(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Assessment>>;
90
+ /**
91
+ * Update an assessment
92
+ */
93
+ updateAssessment(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Assessment>;
77
94
  }
78
95
  /**
79
96
  *
@@ -111,4 +128,12 @@ export declare class AssessmentApi extends runtime.BaseAPI implements Assessment
111
128
  * List assessments
112
129
  */
113
130
  listAssessments(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>>;
131
+ /**
132
+ * Update an assessment
133
+ */
134
+ updateAssessmentRaw(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Assessment>>;
135
+ /**
136
+ * Update an assessment
137
+ */
138
+ updateAssessment(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Assessment>;
114
139
  }
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { AssessmentFromJSON, AssessmentFormToJSON, } from '../models/index';
24
+ import { AssessmentFromJSON, AssessmentFormToJSON, AssessmentUpdateToJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -137,4 +137,37 @@ export class AssessmentApi extends runtime.BaseAPI {
137
137
  return yield response.value();
138
138
  });
139
139
  }
140
+ /**
141
+ * Update an assessment
142
+ */
143
+ updateAssessmentRaw(requestParameters, initOverrides) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ if (requestParameters['id'] == null) {
146
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAssessment().');
147
+ }
148
+ if (requestParameters['assessmentUpdate'] == null) {
149
+ throw new runtime.RequiredError('assessmentUpdate', 'Required parameter "assessmentUpdate" was null or undefined when calling updateAssessment().');
150
+ }
151
+ const queryParameters = {};
152
+ const headerParameters = {};
153
+ headerParameters['Content-Type'] = 'application/json';
154
+ const response = yield this.request({
155
+ path: `/api/v1/assessments/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
156
+ method: 'PUT',
157
+ headers: headerParameters,
158
+ query: queryParameters,
159
+ body: AssessmentUpdateToJSON(requestParameters['assessmentUpdate']),
160
+ }, initOverrides);
161
+ return new runtime.JSONApiResponse(response, (jsonValue) => AssessmentFromJSON(jsonValue));
162
+ });
163
+ }
164
+ /**
165
+ * Update an assessment
166
+ */
167
+ updateAssessment(requestParameters, initOverrides) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ const response = yield this.updateAssessmentRaw(requestParameters, initOverrides);
170
+ return yield response.value();
171
+ });
172
+ }
140
173
  }
@@ -2,3 +2,4 @@ export { type HeadImageRequest, type ImageApiInterface, ImageApi, } from "./Imag
2
2
  export { type CreateSourceRequest, type DeleteSourceRequest, type GetSourceRequest, type ListSourcesRequest, type SourceApiInterface, SourceApi, type UpdateSourceRequest, type UpdateInventoryRequest } from "./SourceApi";
3
3
  export { type HealthApiInterface, HealthApi } from "./HealthApi";
4
4
  export { type AgentApiInterface, type DeleteAgentRequest, AgentApi } from "./AgentApi";
5
+ export { type AssessmentApiInterface, type CreateAssessmentRequest, type DeleteAssessmentRequest, type GetAssessmentRequest, type UpdateAssessmentRequest, AssessmentApi } from "./AssessmentApi";
@@ -4,3 +4,4 @@ export { ImageApi, } from "./ImageApi";
4
4
  export { SourceApi } from "./SourceApi";
5
5
  export { HealthApi } from "./HealthApi";
6
6
  export { AgentApi } from "./AgentApi";
7
+ export { AssessmentApi } from "./AssessmentApi";
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { Inventory } from './Inventory';
12
+ import type { Snapshot } from './Snapshot';
13
13
  /**
14
14
  *
15
15
  * @export
@@ -30,23 +30,38 @@ export interface Assessment {
30
30
  name: string;
31
31
  /**
32
32
  *
33
- * @type {Date}
33
+ * @type {string}
34
34
  * @memberof Assessment
35
35
  */
36
- createdAt: Date;
36
+ sourceType: AssessmentSourceTypeEnum;
37
37
  /**
38
38
  *
39
- * @type {Inventory}
39
+ * @type {string}
40
40
  * @memberof Assessment
41
41
  */
42
- inventory: Inventory;
42
+ sourceId?: string;
43
43
  /**
44
44
  *
45
- * @type {string}
45
+ * @type {Date}
46
+ * @memberof Assessment
47
+ */
48
+ createdAt: Date;
49
+ /**
50
+ *
51
+ * @type {Array<Snapshot>}
46
52
  * @memberof Assessment
47
53
  */
48
- sourceID: string;
54
+ snapshots: Array<Snapshot>;
49
55
  }
56
+ /**
57
+ * @export
58
+ */
59
+ export declare const AssessmentSourceTypeEnum: {
60
+ readonly Inventory: "inventory";
61
+ readonly Rvtools: "rvtools";
62
+ readonly Source: "source";
63
+ };
64
+ export type AssessmentSourceTypeEnum = typeof AssessmentSourceTypeEnum[keyof typeof AssessmentSourceTypeEnum];
50
65
  /**
51
66
  * Check if a given object implements the Assessment interface.
52
67
  */
@@ -11,7 +11,15 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
- import { InventoryFromJSON, InventoryToJSON, } from './Inventory';
14
+ import { SnapshotFromJSON, SnapshotToJSON, } from './Snapshot';
15
+ /**
16
+ * @export
17
+ */
18
+ export const AssessmentSourceTypeEnum = {
19
+ Inventory: 'inventory',
20
+ Rvtools: 'rvtools',
21
+ Source: 'source'
22
+ };
15
23
  /**
16
24
  * Check if a given object implements the Assessment interface.
17
25
  */
@@ -20,11 +28,11 @@ export function instanceOfAssessment(value) {
20
28
  return false;
21
29
  if (!('name' in value) || value['name'] === undefined)
22
30
  return false;
23
- if (!('createdAt' in value) || value['createdAt'] === undefined)
31
+ if (!('sourceType' in value) || value['sourceType'] === undefined)
24
32
  return false;
25
- if (!('inventory' in value) || value['inventory'] === undefined)
33
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
26
34
  return false;
27
- if (!('sourceID' in value) || value['sourceID'] === undefined)
35
+ if (!('snapshots' in value) || value['snapshots'] === undefined)
28
36
  return false;
29
37
  return true;
30
38
  }
@@ -38,9 +46,10 @@ export function AssessmentFromJSONTyped(json, ignoreDiscriminator) {
38
46
  return {
39
47
  'id': json['id'],
40
48
  'name': json['name'],
49
+ 'sourceType': json['sourceType'],
50
+ 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],
41
51
  'createdAt': (new Date(json['createdAt'])),
42
- 'inventory': InventoryFromJSON(json['inventory']),
43
- 'sourceID': json['sourceID'],
52
+ 'snapshots': (json['snapshots'].map(SnapshotFromJSON)),
44
53
  };
45
54
  }
46
55
  export function AssessmentToJSON(value) {
@@ -50,8 +59,9 @@ export function AssessmentToJSON(value) {
50
59
  return {
51
60
  'id': value['id'],
52
61
  'name': value['name'],
62
+ 'sourceType': value['sourceType'],
63
+ 'sourceId': value['sourceId'],
53
64
  'createdAt': ((value['createdAt']).toISOString()),
54
- 'inventory': InventoryToJSON(value['inventory']),
55
- 'sourceID': value['sourceID'],
65
+ 'snapshots': (value['snapshots'].map(SnapshotToJSON)),
56
66
  };
57
67
  }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { Inventory } from './Inventory';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -22,11 +23,26 @@ export interface AssessmentForm {
22
23
  */
23
24
  name: string;
24
25
  /**
26
+ * Source of the assessment data:
27
+ * * `inventory` - Manual inventory upload via JSON
28
+ * * `agent` - Collected by migration planner agent
25
29
  *
26
30
  * @type {string}
27
31
  * @memberof AssessmentForm
28
32
  */
29
- sourceID: string;
33
+ sourceType: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof AssessmentForm
38
+ */
39
+ sourceId?: string;
40
+ /**
41
+ *
42
+ * @type {Inventory}
43
+ * @memberof AssessmentForm
44
+ */
45
+ inventory?: Inventory;
30
46
  }
31
47
  /**
32
48
  * Check if a given object implements the AssessmentForm interface.
@@ -11,13 +11,14 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { InventoryFromJSON, InventoryToJSON, } from './Inventory';
14
15
  /**
15
16
  * Check if a given object implements the AssessmentForm interface.
16
17
  */
17
18
  export function instanceOfAssessmentForm(value) {
18
19
  if (!('name' in value) || value['name'] === undefined)
19
20
  return false;
20
- if (!('sourceID' in value) || value['sourceID'] === undefined)
21
+ if (!('sourceType' in value) || value['sourceType'] === undefined)
21
22
  return false;
22
23
  return true;
23
24
  }
@@ -30,7 +31,9 @@ export function AssessmentFormFromJSONTyped(json, ignoreDiscriminator) {
30
31
  }
31
32
  return {
32
33
  'name': json['name'],
33
- 'sourceID': json['sourceID'],
34
+ 'sourceType': json['sourceType'],
35
+ 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],
36
+ 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),
34
37
  };
35
38
  }
36
39
  export function AssessmentFormToJSON(value) {
@@ -39,6 +42,8 @@ export function AssessmentFormToJSON(value) {
39
42
  }
40
43
  return {
41
44
  'name': value['name'],
42
- 'sourceID': value['sourceID'],
45
+ 'sourceType': value['sourceType'],
46
+ 'sourceId': value['sourceId'],
47
+ 'inventory': InventoryToJSON(value['inventory']),
43
48
  };
44
49
  }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Migration Planner API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: undefined
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Update form of the assessment.
14
+ * @export
15
+ * @interface AssessmentUpdate
16
+ */
17
+ export interface AssessmentUpdate {
18
+ /**
19
+ * Name of the assessment
20
+ * @type {string}
21
+ * @memberof AssessmentUpdate
22
+ */
23
+ name?: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the AssessmentUpdate interface.
27
+ */
28
+ export declare function instanceOfAssessmentUpdate(value: object): value is AssessmentUpdate;
29
+ export declare function AssessmentUpdateFromJSON(json: any): AssessmentUpdate;
30
+ export declare function AssessmentUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssessmentUpdate;
31
+ export declare function AssessmentUpdateToJSON(value?: AssessmentUpdate | null): any;
@@ -0,0 +1,38 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Migration Planner API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: undefined
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.
13
+ */
14
+ /**
15
+ * Check if a given object implements the AssessmentUpdate interface.
16
+ */
17
+ export function instanceOfAssessmentUpdate(value) {
18
+ return true;
19
+ }
20
+ export function AssessmentUpdateFromJSON(json) {
21
+ return AssessmentUpdateFromJSONTyped(json, false);
22
+ }
23
+ export function AssessmentUpdateFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ return {
28
+ 'name': json['name'] == null ? undefined : json['name'],
29
+ };
30
+ }
31
+ export function AssessmentUpdateToJSON(value) {
32
+ if (value == null) {
33
+ return value;
34
+ }
35
+ return {
36
+ 'name': value['name'],
37
+ };
38
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Migration Planner API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: undefined
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Inventory } from './Inventory';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface Snapshot
17
+ */
18
+ export interface Snapshot {
19
+ /**
20
+ *
21
+ * @type {Inventory}
22
+ * @memberof Snapshot
23
+ */
24
+ inventory: Inventory;
25
+ /**
26
+ *
27
+ * @type {Date}
28
+ * @memberof Snapshot
29
+ */
30
+ createdAt: Date;
31
+ }
32
+ /**
33
+ * Check if a given object implements the Snapshot interface.
34
+ */
35
+ export declare function instanceOfSnapshot(value: object): value is Snapshot;
36
+ export declare function SnapshotFromJSON(json: any): Snapshot;
37
+ export declare function SnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Snapshot;
38
+ export declare function SnapshotToJSON(value?: Snapshot | null): any;
@@ -0,0 +1,45 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Migration Planner API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: undefined
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.
13
+ */
14
+ import { InventoryFromJSON, InventoryToJSON, } from './Inventory';
15
+ /**
16
+ * Check if a given object implements the Snapshot interface.
17
+ */
18
+ export function instanceOfSnapshot(value) {
19
+ if (!('inventory' in value) || value['inventory'] === undefined)
20
+ return false;
21
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
22
+ return false;
23
+ return true;
24
+ }
25
+ export function SnapshotFromJSON(json) {
26
+ return SnapshotFromJSONTyped(json, false);
27
+ }
28
+ export function SnapshotFromJSONTyped(json, ignoreDiscriminator) {
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'inventory': InventoryFromJSON(json['inventory']),
34
+ 'createdAt': (new Date(json['createdAt'])),
35
+ };
36
+ }
37
+ export function SnapshotToJSON(value) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'inventory': InventoryToJSON(value['inventory']),
43
+ 'createdAt': ((value['createdAt']).toISOString()),
44
+ };
45
+ }
@@ -2,7 +2,10 @@ export * from './Agent';
2
2
  export * from './AgentProxy';
3
3
  export * from './Assessment';
4
4
  export * from './AssessmentForm';
5
+ export * from './AssessmentUpdate';
5
6
  export * from './Datastore';
7
+ export * from './Event';
8
+ export * from './EventData';
6
9
  export * from './Histogram';
7
10
  export * from './Host';
8
11
  export * from './Infra';
@@ -16,7 +19,9 @@ export * from './ModelError';
16
19
  export * from './Network';
17
20
  export * from './OsInfo';
18
21
  export * from './PresignedUrl';
22
+ export * from './Snapshot';
19
23
  export * from './Source';
24
+ export * from './SourceAgentItem';
20
25
  export * from './SourceCreate';
21
26
  export * from './SourceUpdate';
22
27
  export * from './SourceUpdateOnPrem';
@@ -25,4 +30,5 @@ export * from './UpdateInventory';
25
30
  export * from './UploadRvtoolsFile200Response';
26
31
  export * from './VCenter';
27
32
  export * from './VMResourceBreakdown';
33
+ export * from './VMResourceBreakdownHistogram';
28
34
  export * from './VMs';
@@ -4,7 +4,10 @@ export * from './Agent';
4
4
  export * from './AgentProxy';
5
5
  export * from './Assessment';
6
6
  export * from './AssessmentForm';
7
+ export * from './AssessmentUpdate';
7
8
  export * from './Datastore';
9
+ export * from './Event';
10
+ export * from './EventData';
8
11
  export * from './Histogram';
9
12
  export * from './Host';
10
13
  export * from './Infra';
@@ -18,7 +21,9 @@ export * from './ModelError';
18
21
  export * from './Network';
19
22
  export * from './OsInfo';
20
23
  export * from './PresignedUrl';
24
+ export * from './Snapshot';
21
25
  export * from './Source';
26
+ export * from './SourceAgentItem';
22
27
  export * from './SourceCreate';
23
28
  export * from './SourceUpdate';
24
29
  export * from './SourceUpdateOnPrem';
@@ -27,4 +32,5 @@ export * from './UpdateInventory';
27
32
  export * from './UploadRvtoolsFile200Response';
28
33
  export * from './VCenter';
29
34
  export * from './VMResourceBreakdown';
35
+ export * from './VMResourceBreakdownHistogram';
30
36
  export * from './VMs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@migration-planner-ui/api-client",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "OpenAPI client for the Migration Planner API",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -17,12 +17,12 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  Assessment,
19
19
  AssessmentForm,
20
+ AssessmentUpdate,
20
21
  } from '../models/index';
21
22
  import {
22
23
  AssessmentFromJSON,
23
- AssessmentToJSON,
24
- AssessmentFormFromJSON,
25
24
  AssessmentFormToJSON,
25
+ AssessmentUpdateToJSON,
26
26
  } from '../models/index';
27
27
 
28
28
  export interface CreateAssessmentRequest {
@@ -37,6 +37,11 @@ export interface GetAssessmentRequest {
37
37
  id: string;
38
38
  }
39
39
 
40
+ export interface UpdateAssessmentRequest {
41
+ id: string;
42
+ assessmentUpdate: AssessmentUpdate;
43
+ }
44
+
40
45
  /**
41
46
  * AssessmentApi - interface
42
47
  *
@@ -99,6 +104,21 @@ export interface AssessmentApiInterface {
99
104
  */
100
105
  listAssessments(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Assessment>>;
101
106
 
107
+ /**
108
+ * Update an assessment
109
+ * @param {string} id ID of the assessment
110
+ * @param {AssessmentUpdate} assessmentUpdate
111
+ * @param {*} [options] Override http request option.
112
+ * @throws {RequiredError}
113
+ * @memberof AssessmentApiInterface
114
+ */
115
+ updateAssessmentRaw(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Assessment>>;
116
+
117
+ /**
118
+ * Update an assessment
119
+ */
120
+ updateAssessment(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Assessment>;
121
+
102
122
  }
103
123
 
104
124
  /**
@@ -234,4 +254,47 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
234
254
  return await response.value();
235
255
  }
236
256
 
257
+ /**
258
+ * Update an assessment
259
+ */
260
+ async updateAssessmentRaw(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Assessment>> {
261
+ if (requestParameters['id'] == null) {
262
+ throw new runtime.RequiredError(
263
+ 'id',
264
+ 'Required parameter "id" was null or undefined when calling updateAssessment().'
265
+ );
266
+ }
267
+
268
+ if (requestParameters['assessmentUpdate'] == null) {
269
+ throw new runtime.RequiredError(
270
+ 'assessmentUpdate',
271
+ 'Required parameter "assessmentUpdate" was null or undefined when calling updateAssessment().'
272
+ );
273
+ }
274
+
275
+ const queryParameters: any = {};
276
+
277
+ const headerParameters: runtime.HTTPHeaders = {};
278
+
279
+ headerParameters['Content-Type'] = 'application/json';
280
+
281
+ const response = await this.request({
282
+ path: `/api/v1/assessments/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
283
+ method: 'PUT',
284
+ headers: headerParameters,
285
+ query: queryParameters,
286
+ body: AssessmentUpdateToJSON(requestParameters['assessmentUpdate']),
287
+ }, initOverrides);
288
+
289
+ return new runtime.JSONApiResponse(response, (jsonValue) => AssessmentFromJSON(jsonValue));
290
+ }
291
+
292
+ /**
293
+ * Update an assessment
294
+ */
295
+ async updateAssessment(requestParameters: UpdateAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Assessment> {
296
+ const response = await this.updateAssessmentRaw(requestParameters, initOverrides);
297
+ return await response.value();
298
+ }
299
+
237
300
  }
package/src/apis/index.ts CHANGED
@@ -27,3 +27,13 @@ export {
27
27
  type DeleteAgentRequest,
28
28
  AgentApi
29
29
  } from "./AgentApi";
30
+
31
+ export {
32
+ type AssessmentApiInterface,
33
+ type CreateAssessmentRequest,
34
+ type DeleteAssessmentRequest,
35
+ type GetAssessmentRequest,
36
+ type UpdateAssessmentRequest,
37
+ AssessmentApi
38
+ } from "./AssessmentApi";
39
+
@@ -13,12 +13,12 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
- import type { Inventory } from './Inventory';
16
+ import type { Snapshot } from './Snapshot';
17
17
  import {
18
- InventoryFromJSON,
19
- InventoryFromJSONTyped,
20
- InventoryToJSON,
21
- } from './Inventory';
18
+ SnapshotFromJSON,
19
+ SnapshotFromJSONTyped,
20
+ SnapshotToJSON,
21
+ } from './Snapshot';
22
22
 
23
23
  /**
24
24
  *
@@ -40,33 +40,51 @@ export interface Assessment {
40
40
  name: string;
41
41
  /**
42
42
  *
43
- * @type {Date}
43
+ * @type {string}
44
44
  * @memberof Assessment
45
45
  */
46
- createdAt: Date;
46
+ sourceType: AssessmentSourceTypeEnum;
47
47
  /**
48
48
  *
49
- * @type {Inventory}
49
+ * @type {string}
50
50
  * @memberof Assessment
51
51
  */
52
- inventory: Inventory;
52
+ sourceId?: string;
53
53
  /**
54
54
  *
55
- * @type {string}
55
+ * @type {Date}
56
56
  * @memberof Assessment
57
57
  */
58
- sourceID: string;
58
+ createdAt: Date;
59
+ /**
60
+ *
61
+ * @type {Array<Snapshot>}
62
+ * @memberof Assessment
63
+ */
64
+ snapshots: Array<Snapshot>;
59
65
  }
60
66
 
67
+
68
+ /**
69
+ * @export
70
+ */
71
+ export const AssessmentSourceTypeEnum = {
72
+ Inventory: 'inventory',
73
+ Rvtools: 'rvtools',
74
+ Source: 'source'
75
+ } as const;
76
+ export type AssessmentSourceTypeEnum = typeof AssessmentSourceTypeEnum[keyof typeof AssessmentSourceTypeEnum];
77
+
78
+
61
79
  /**
62
80
  * Check if a given object implements the Assessment interface.
63
81
  */
64
82
  export function instanceOfAssessment(value: object): value is Assessment {
65
83
  if (!('id' in value) || value['id'] === undefined) return false;
66
84
  if (!('name' in value) || value['name'] === undefined) return false;
85
+ if (!('sourceType' in value) || value['sourceType'] === undefined) return false;
67
86
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
68
- if (!('inventory' in value) || value['inventory'] === undefined) return false;
69
- if (!('sourceID' in value) || value['sourceID'] === undefined) return false;
87
+ if (!('snapshots' in value) || value['snapshots'] === undefined) return false;
70
88
  return true;
71
89
  }
72
90
 
@@ -82,9 +100,10 @@ export function AssessmentFromJSONTyped(json: any, ignoreDiscriminator: boolean)
82
100
 
83
101
  'id': json['id'],
84
102
  'name': json['name'],
103
+ 'sourceType': json['sourceType'],
104
+ 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],
85
105
  'createdAt': (new Date(json['createdAt'])),
86
- 'inventory': InventoryFromJSON(json['inventory']),
87
- 'sourceID': json['sourceID'],
106
+ 'snapshots': ((json['snapshots'] as Array<any>).map(SnapshotFromJSON)),
88
107
  };
89
108
  }
90
109
 
@@ -96,9 +115,10 @@ export function AssessmentToJSON(value?: Assessment | null): any {
96
115
 
97
116
  'id': value['id'],
98
117
  'name': value['name'],
118
+ 'sourceType': value['sourceType'],
119
+ 'sourceId': value['sourceId'],
99
120
  'createdAt': ((value['createdAt']).toISOString()),
100
- 'inventory': InventoryToJSON(value['inventory']),
101
- 'sourceID': value['sourceID'],
121
+ 'snapshots': ((value['snapshots'] as Array<any>).map(SnapshotToJSON)),
102
122
  };
103
123
  }
104
124
 
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { Inventory } from './Inventory';
17
+ import {
18
+ InventoryFromJSON,
19
+ InventoryFromJSONTyped,
20
+ InventoryToJSON,
21
+ } from './Inventory';
22
+
16
23
  /**
17
24
  *
18
25
  * @export
@@ -25,12 +32,27 @@ export interface AssessmentForm {
25
32
  * @memberof AssessmentForm
26
33
  */
27
34
  name: string;
35
+ /**
36
+ * Source of the assessment data:
37
+ * * `inventory` - Manual inventory upload via JSON
38
+ * * `agent` - Collected by migration planner agent
39
+ *
40
+ * @type {string}
41
+ * @memberof AssessmentForm
42
+ */
43
+ sourceType: string;
28
44
  /**
29
45
  *
30
46
  * @type {string}
31
47
  * @memberof AssessmentForm
32
48
  */
33
- sourceID: string;
49
+ sourceId?: string;
50
+ /**
51
+ *
52
+ * @type {Inventory}
53
+ * @memberof AssessmentForm
54
+ */
55
+ inventory?: Inventory;
34
56
  }
35
57
 
36
58
  /**
@@ -38,7 +60,7 @@ export interface AssessmentForm {
38
60
  */
39
61
  export function instanceOfAssessmentForm(value: object): value is AssessmentForm {
40
62
  if (!('name' in value) || value['name'] === undefined) return false;
41
- if (!('sourceID' in value) || value['sourceID'] === undefined) return false;
63
+ if (!('sourceType' in value) || value['sourceType'] === undefined) return false;
42
64
  return true;
43
65
  }
44
66
 
@@ -53,7 +75,9 @@ export function AssessmentFormFromJSONTyped(json: any, ignoreDiscriminator: bool
53
75
  return {
54
76
 
55
77
  'name': json['name'],
56
- 'sourceID': json['sourceID'],
78
+ 'sourceType': json['sourceType'],
79
+ 'sourceId': json['sourceId'] == null ? undefined : json['sourceId'],
80
+ 'inventory': json['inventory'] == null ? undefined : InventoryFromJSON(json['inventory']),
57
81
  };
58
82
  }
59
83
 
@@ -64,7 +88,9 @@ export function AssessmentFormToJSON(value?: AssessmentForm | null): any {
64
88
  return {
65
89
 
66
90
  'name': value['name'],
67
- 'sourceID': value['sourceID'],
91
+ 'sourceType': value['sourceType'],
92
+ 'sourceId': value['sourceId'],
93
+ 'inventory': InventoryToJSON(value['inventory']),
68
94
  };
69
95
  }
70
96
 
@@ -0,0 +1,60 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Migration Planner API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: undefined
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.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Update form of the assessment.
18
+ * @export
19
+ * @interface AssessmentUpdate
20
+ */
21
+ export interface AssessmentUpdate {
22
+ /**
23
+ * Name of the assessment
24
+ * @type {string}
25
+ * @memberof AssessmentUpdate
26
+ */
27
+ name?: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the AssessmentUpdate interface.
32
+ */
33
+ export function instanceOfAssessmentUpdate(value: object): value is AssessmentUpdate {
34
+ return true;
35
+ }
36
+
37
+ export function AssessmentUpdateFromJSON(json: any): AssessmentUpdate {
38
+ return AssessmentUpdateFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function AssessmentUpdateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AssessmentUpdate {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+
47
+ 'name': json['name'] == null ? undefined : json['name'],
48
+ };
49
+ }
50
+
51
+ export function AssessmentUpdateToJSON(value?: AssessmentUpdate | null): any {
52
+ if (value == null) {
53
+ return value;
54
+ }
55
+ return {
56
+
57
+ 'name': value['name'],
58
+ };
59
+ }
60
+
@@ -0,0 +1,77 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Migration Planner API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: undefined
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.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Inventory } from './Inventory';
17
+ import {
18
+ InventoryFromJSON,
19
+ InventoryFromJSONTyped,
20
+ InventoryToJSON,
21
+ } from './Inventory';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface Snapshot
27
+ */
28
+ export interface Snapshot {
29
+ /**
30
+ *
31
+ * @type {Inventory}
32
+ * @memberof Snapshot
33
+ */
34
+ inventory: Inventory;
35
+ /**
36
+ *
37
+ * @type {Date}
38
+ * @memberof Snapshot
39
+ */
40
+ createdAt: Date;
41
+ }
42
+
43
+ /**
44
+ * Check if a given object implements the Snapshot interface.
45
+ */
46
+ export function instanceOfSnapshot(value: object): value is Snapshot {
47
+ if (!('inventory' in value) || value['inventory'] === undefined) return false;
48
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function SnapshotFromJSON(json: any): Snapshot {
53
+ return SnapshotFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function SnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Snapshot {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'inventory': InventoryFromJSON(json['inventory']),
63
+ 'createdAt': (new Date(json['createdAt'])),
64
+ };
65
+ }
66
+
67
+ export function SnapshotToJSON(value?: Snapshot | null): any {
68
+ if (value == null) {
69
+ return value;
70
+ }
71
+ return {
72
+
73
+ 'inventory': InventoryToJSON(value['inventory']),
74
+ 'createdAt': ((value['createdAt']).toISOString()),
75
+ };
76
+ }
77
+
@@ -102,4 +102,5 @@ export function SourceCreateToJSON(value?: SourceCreate | null): any {
102
102
  'certificateChain': value['certificateChain'],
103
103
  'labels': value['labels'] == null ? undefined : ((value['labels'] as Array<any>).map(LabelToJSON)),
104
104
  };
105
- }
105
+ }
106
+
@@ -4,7 +4,10 @@ export * from './Agent';
4
4
  export * from './AgentProxy';
5
5
  export * from './Assessment';
6
6
  export * from './AssessmentForm';
7
+ export * from './AssessmentUpdate';
7
8
  export * from './Datastore';
9
+ export * from './Event';
10
+ export * from './EventData';
8
11
  export * from './Histogram';
9
12
  export * from './Host';
10
13
  export * from './Infra';
@@ -18,7 +21,9 @@ export * from './ModelError';
18
21
  export * from './Network';
19
22
  export * from './OsInfo';
20
23
  export * from './PresignedUrl';
24
+ export * from './Snapshot';
21
25
  export * from './Source';
26
+ export * from './SourceAgentItem';
22
27
  export * from './SourceCreate';
23
28
  export * from './SourceUpdate';
24
29
  export * from './SourceUpdateOnPrem';
@@ -27,4 +32,5 @@ export * from './UpdateInventory';
27
32
  export * from './UploadRvtoolsFile200Response';
28
33
  export * from './VCenter';
29
34
  export * from './VMResourceBreakdown';
35
+ export * from './VMResourceBreakdownHistogram';
30
36
  export * from './VMs';