@migration-planner-ui/api-client 0.0.27 → 0.0.29

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.
@@ -15,6 +15,7 @@ import { mapValues } from '../runtime';
15
15
  import { MigrationIssueFromJSON, MigrationIssueToJSON, } from './MigrationIssue';
16
16
  import { OsInfoFromJSON, OsInfoToJSON, } from './OsInfo';
17
17
  import { DiskSizeTierSummaryFromJSON, DiskSizeTierSummaryToJSON, } from './DiskSizeTierSummary';
18
+ import { DiskTypeSummaryFromJSON, DiskTypeSummaryToJSON, } from './DiskTypeSummary';
18
19
  import { VMResourceBreakdownFromJSON, VMResourceBreakdownToJSON, } from './VMResourceBreakdown';
19
20
  /**
20
21
  * Check if a given object implements the VMs interface.
@@ -34,8 +35,6 @@ export function instanceOfVMs(value) {
34
35
  return false;
35
36
  if (!('powerStates' in value) || value['powerStates'] === undefined)
36
37
  return false;
37
- if (!('os' in value) || value['os'] === undefined)
38
- return false;
39
38
  if (!('notMigratableReasons' in value) || value['notMigratableReasons'] === undefined)
40
39
  return false;
41
40
  if (!('migrationWarnings' in value) || value['migrationWarnings'] === undefined)
@@ -55,12 +54,13 @@ export function VMsFromJSONTyped(json, ignoreDiscriminator) {
55
54
  'totalMigratableWithWarnings': json['totalMigratableWithWarnings'] == null ? undefined : json['totalMigratableWithWarnings'],
56
55
  'cpuCores': VMResourceBreakdownFromJSON(json['cpuCores']),
57
56
  'diskSizeTier': json['diskSizeTier'] == null ? undefined : (mapValues(json['diskSizeTier'], DiskSizeTierSummaryFromJSON)),
57
+ 'diskTypes': json['diskTypes'] == null ? undefined : (mapValues(json['diskTypes'], DiskTypeSummaryFromJSON)),
58
58
  'ramGB': VMResourceBreakdownFromJSON(json['ramGB']),
59
59
  'diskGB': VMResourceBreakdownFromJSON(json['diskGB']),
60
60
  'diskCount': VMResourceBreakdownFromJSON(json['diskCount']),
61
61
  'nicCount': json['nicCount'] == null ? undefined : VMResourceBreakdownFromJSON(json['nicCount']),
62
62
  'powerStates': json['powerStates'],
63
- 'os': json['os'],
63
+ 'os': json['os'] == null ? undefined : json['os'],
64
64
  'osInfo': json['osInfo'] == null ? undefined : (mapValues(json['osInfo'], OsInfoFromJSON)),
65
65
  'notMigratableReasons': json['notMigratableReasons'] == null ? undefined : (json['notMigratableReasons'].map(MigrationIssueFromJSON)),
66
66
  'migrationWarnings': json['migrationWarnings'] == null ? undefined : (json['migrationWarnings'].map(MigrationIssueFromJSON)),
@@ -76,6 +76,7 @@ export function VMsToJSON(value) {
76
76
  'totalMigratableWithWarnings': value['totalMigratableWithWarnings'],
77
77
  'cpuCores': VMResourceBreakdownToJSON(value['cpuCores']),
78
78
  'diskSizeTier': value['diskSizeTier'] == null ? undefined : (mapValues(value['diskSizeTier'], DiskSizeTierSummaryToJSON)),
79
+ 'diskTypes': value['diskTypes'] == null ? undefined : (mapValues(value['diskTypes'], DiskTypeSummaryToJSON)),
79
80
  'ramGB': VMResourceBreakdownToJSON(value['ramGB']),
80
81
  'diskGB': VMResourceBreakdownToJSON(value['diskGB']),
81
82
  'diskCount': VMResourceBreakdownToJSON(value['diskCount']),
@@ -5,6 +5,7 @@ export * from './AssessmentForm';
5
5
  export * from './AssessmentUpdate';
6
6
  export * from './Datastore';
7
7
  export * from './DiskSizeTierSummary';
8
+ export * from './DiskTypeSummary';
8
9
  export * from './Histogram';
9
10
  export * from './Host';
10
11
  export * from './Info';
@@ -12,6 +13,8 @@ export * from './Infra';
12
13
  export * from './Inventory';
13
14
  export * from './InventoryData';
14
15
  export * from './Ipv4Config';
16
+ export * from './Job';
17
+ export * from './JobStatus';
15
18
  export * from './Label';
16
19
  export * from './MigrationIssue';
17
20
  export * from './ModelError';
@@ -7,6 +7,7 @@ export * from './AssessmentForm';
7
7
  export * from './AssessmentUpdate';
8
8
  export * from './Datastore';
9
9
  export * from './DiskSizeTierSummary';
10
+ export * from './DiskTypeSummary';
10
11
  export * from './Histogram';
11
12
  export * from './Host';
12
13
  export * from './Info';
@@ -14,6 +15,8 @@ export * from './Infra';
14
15
  export * from './Inventory';
15
16
  export * from './InventoryData';
16
17
  export * from './Ipv4Config';
18
+ export * from './Job';
19
+ export * from './JobStatus';
17
20
  export * from './Label';
18
21
  export * from './MigrationIssue';
19
22
  export * from './ModelError';
package/dist/runtime.js CHANGED
@@ -20,7 +20,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  step((generator = generator.apply(thisArg, _arguments || [])).next());
21
21
  });
22
22
  };
23
- export const BASE_PATH = "https://raw.githubusercontent.com".replace(/\/+$/, "");
23
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
24
24
  export class Configuration {
25
25
  constructor(configuration = {}) {
26
26
  this.configuration = configuration;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@migration-planner-ui/api-client",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "OpenAPI client for the Migration Planner API",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -21,7 +21,10 @@ import type {
21
21
  } from '../models/index';
22
22
  import {
23
23
  AssessmentFromJSON,
24
+ AssessmentToJSON,
25
+ AssessmentFormFromJSON,
24
26
  AssessmentFormToJSON,
27
+ AssessmentUpdateFromJSON,
25
28
  AssessmentUpdateToJSON,
26
29
  } from '../models/index';
27
30
 
@@ -0,0 +1,226 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ Job,
19
+ } from '../models/index';
20
+ import {
21
+ JobFromJSON,
22
+ JobToJSON,
23
+ } from '../models/index';
24
+
25
+ export interface CancelJobRequest {
26
+ id: number;
27
+ }
28
+
29
+ export interface CreateRVToolsAssessmentRequest {
30
+ name: string;
31
+ file: Blob;
32
+ }
33
+
34
+ export interface GetJobRequest {
35
+ id: number;
36
+ }
37
+
38
+ /**
39
+ * JobApi - interface
40
+ *
41
+ * @export
42
+ * @interface JobApiInterface
43
+ */
44
+ export interface JobApiInterface {
45
+ /**
46
+ * Cancel a job
47
+ * @param {number} id ID of the job
48
+ * @param {*} [options] Override http request option.
49
+ * @throws {RequiredError}
50
+ * @memberof JobApiInterface
51
+ */
52
+ cancelJobRaw(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>>;
53
+
54
+ /**
55
+ * Cancel a job
56
+ */
57
+ cancelJob(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job>;
58
+
59
+ /**
60
+ * Create an assessment from RVTools file asynchronously
61
+ * @param {string} name Name of the assessment
62
+ * @param {Blob} file File upload for assessment data
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ * @memberof JobApiInterface
66
+ */
67
+ createRVToolsAssessmentRaw(requestParameters: CreateRVToolsAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>>;
68
+
69
+ /**
70
+ * Create an assessment from RVTools file asynchronously
71
+ */
72
+ createRVToolsAssessment(requestParameters: CreateRVToolsAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job>;
73
+
74
+ /**
75
+ * Get job status
76
+ * @param {number} id ID of the job
77
+ * @param {*} [options] Override http request option.
78
+ * @throws {RequiredError}
79
+ * @memberof JobApiInterface
80
+ */
81
+ getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>>;
82
+
83
+ /**
84
+ * Get job status
85
+ */
86
+ getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job>;
87
+
88
+ }
89
+
90
+ /**
91
+ *
92
+ */
93
+ export class JobApi extends runtime.BaseAPI implements JobApiInterface {
94
+
95
+ /**
96
+ * Cancel a job
97
+ */
98
+ async cancelJobRaw(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
99
+ if (requestParameters['id'] == null) {
100
+ throw new runtime.RequiredError(
101
+ 'id',
102
+ 'Required parameter "id" was null or undefined when calling cancelJob().'
103
+ );
104
+ }
105
+
106
+ const queryParameters: any = {};
107
+
108
+ const headerParameters: runtime.HTTPHeaders = {};
109
+
110
+ const response = await this.request({
111
+ path: `/api/v1/assessments/jobs/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
112
+ method: 'DELETE',
113
+ headers: headerParameters,
114
+ query: queryParameters,
115
+ }, initOverrides);
116
+
117
+ return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
118
+ }
119
+
120
+ /**
121
+ * Cancel a job
122
+ */
123
+ async cancelJob(requestParameters: CancelJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
124
+ const response = await this.cancelJobRaw(requestParameters, initOverrides);
125
+ return await response.value();
126
+ }
127
+
128
+ /**
129
+ * Create an assessment from RVTools file asynchronously
130
+ */
131
+ async createRVToolsAssessmentRaw(requestParameters: CreateRVToolsAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
132
+ if (requestParameters['name'] == null) {
133
+ throw new runtime.RequiredError(
134
+ 'name',
135
+ 'Required parameter "name" was null or undefined when calling createRVToolsAssessment().'
136
+ );
137
+ }
138
+
139
+ if (requestParameters['file'] == null) {
140
+ throw new runtime.RequiredError(
141
+ 'file',
142
+ 'Required parameter "file" was null or undefined when calling createRVToolsAssessment().'
143
+ );
144
+ }
145
+
146
+ const queryParameters: any = {};
147
+
148
+ const headerParameters: runtime.HTTPHeaders = {};
149
+
150
+ const consumes: runtime.Consume[] = [
151
+ { contentType: 'multipart/form-data' },
152
+ ];
153
+ // @ts-ignore: canConsumeForm may be unused
154
+ const canConsumeForm = runtime.canConsumeForm(consumes);
155
+
156
+ let formParams: { append(param: string, value: any): any };
157
+ let useForm = false;
158
+ // use FormData to transmit files using content-type "multipart/form-data"
159
+ useForm = canConsumeForm;
160
+ if (useForm) {
161
+ formParams = new FormData();
162
+ } else {
163
+ formParams = new URLSearchParams();
164
+ }
165
+
166
+ if (requestParameters['name'] != null) {
167
+ formParams.append('name', requestParameters['name'] as any);
168
+ }
169
+
170
+ if (requestParameters['file'] != null) {
171
+ formParams.append('file', requestParameters['file'] as any);
172
+ }
173
+
174
+ const response = await this.request({
175
+ path: `/api/v1/assessments/rvtools`,
176
+ method: 'POST',
177
+ headers: headerParameters,
178
+ query: queryParameters,
179
+ body: formParams,
180
+ }, initOverrides);
181
+
182
+ return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
183
+ }
184
+
185
+ /**
186
+ * Create an assessment from RVTools file asynchronously
187
+ */
188
+ async createRVToolsAssessment(requestParameters: CreateRVToolsAssessmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
189
+ const response = await this.createRVToolsAssessmentRaw(requestParameters, initOverrides);
190
+ return await response.value();
191
+ }
192
+
193
+ /**
194
+ * Get job status
195
+ */
196
+ async getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Job>> {
197
+ if (requestParameters['id'] == null) {
198
+ throw new runtime.RequiredError(
199
+ 'id',
200
+ 'Required parameter "id" was null or undefined when calling getJob().'
201
+ );
202
+ }
203
+
204
+ const queryParameters: any = {};
205
+
206
+ const headerParameters: runtime.HTTPHeaders = {};
207
+
208
+ const response = await this.request({
209
+ path: `/api/v1/assessments/jobs/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
210
+ method: 'GET',
211
+ headers: headerParameters,
212
+ query: queryParameters,
213
+ }, initOverrides);
214
+
215
+ return new runtime.JSONApiResponse(response, (jsonValue) => JobFromJSON(jsonValue));
216
+ }
217
+
218
+ /**
219
+ * Get job status
220
+ */
221
+ async getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Job> {
222
+ const response = await this.getJobRaw(requestParameters, initOverrides);
223
+ return await response.value();
224
+ }
225
+
226
+ }
@@ -0,0 +1,70 @@
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
+ *
18
+ * @export
19
+ * @interface DiskTypeSummary
20
+ */
21
+ export interface DiskTypeSummary {
22
+ /**
23
+ * Number of VMs that have at least one disk of this type
24
+ * @type {number}
25
+ * @memberof DiskTypeSummary
26
+ */
27
+ vmCount: number;
28
+ /**
29
+ * Total disk size in TB for this disk type
30
+ * @type {number}
31
+ * @memberof DiskTypeSummary
32
+ */
33
+ totalSizeTB: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the DiskTypeSummary interface.
38
+ */
39
+ export function instanceOfDiskTypeSummary(value: object): value is DiskTypeSummary {
40
+ if (!('vmCount' in value) || value['vmCount'] === undefined) return false;
41
+ if (!('totalSizeTB' in value) || value['totalSizeTB'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function DiskTypeSummaryFromJSON(json: any): DiskTypeSummary {
46
+ return DiskTypeSummaryFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function DiskTypeSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiskTypeSummary {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'vmCount': json['vmCount'],
56
+ 'totalSizeTB': json['totalSizeTB'],
57
+ };
58
+ }
59
+
60
+ export function DiskTypeSummaryToJSON(value?: DiskTypeSummary | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'vmCount': value['vmCount'],
67
+ 'totalSizeTB': value['totalSizeTB'],
68
+ };
69
+ }
70
+
@@ -12,19 +12,23 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
+ import { mapValues } from '../runtime';
15
16
  import type { Datastore } from './Datastore';
16
17
  import {
17
18
  DatastoreFromJSON,
19
+ DatastoreFromJSONTyped,
18
20
  DatastoreToJSON,
19
21
  } from './Datastore';
20
22
  import type { Network } from './Network';
21
23
  import {
22
24
  NetworkFromJSON,
25
+ NetworkFromJSONTyped,
23
26
  NetworkToJSON,
24
27
  } from './Network';
25
28
  import type { Host } from './Host';
26
29
  import {
27
30
  HostFromJSON,
31
+ HostFromJSONTyped,
28
32
  HostToJSON,
29
33
  } from './Host';
30
34
 
@@ -50,8 +54,9 @@ export interface Infra {
50
54
  *
51
55
  * @type {number}
52
56
  * @memberof Infra
57
+ * @deprecated
53
58
  */
54
- totalClusters: number;
59
+ totalClusters?: number;
55
60
  /**
56
61
  *
57
62
  * @type {Array<number>}
@@ -74,12 +79,14 @@ export interface Infra {
74
79
  *
75
80
  * @type {Array<number>}
76
81
  * @memberof Infra
82
+ * @deprecated
77
83
  */
78
- hostsPerCluster: Array<number>;
84
+ hostsPerCluster?: Array<number>;
79
85
  /**
80
86
  *
81
87
  * @type {Array<number>}
82
88
  * @memberof Infra
89
+ * @deprecated
83
90
  */
84
91
  vmsPerCluster?: Array<number>;
85
92
  /**
@@ -107,8 +114,6 @@ export interface Infra {
107
114
  */
108
115
  export function instanceOfInfra(value: object): value is Infra {
109
116
  if (!('totalHosts' in value) || value['totalHosts'] === undefined) return false;
110
- if (!('totalClusters' in value) || value['totalClusters'] === undefined) return false;
111
- if (!('hostsPerCluster' in value) || value['hostsPerCluster'] === undefined) return false;
112
117
  if (!('hostPowerStates' in value) || value['hostPowerStates'] === undefined) return false;
113
118
  if (!('networks' in value) || value['networks'] === undefined) return false;
114
119
  if (!('datastores' in value) || value['datastores'] === undefined) return false;
@@ -127,11 +132,11 @@ export function InfraFromJSONTyped(json: any, ignoreDiscriminator: boolean): Inf
127
132
 
128
133
  'totalHosts': json['totalHosts'],
129
134
  'totalDatacenters': json['totalDatacenters'] == null ? undefined : json['totalDatacenters'],
130
- 'totalClusters': json['totalClusters'],
135
+ 'totalClusters': json['totalClusters'] == null ? undefined : json['totalClusters'],
131
136
  'clustersPerDatacenter': json['clustersPerDatacenter'] == null ? undefined : json['clustersPerDatacenter'],
132
137
  'cpuOverCommitment': json['cpuOverCommitment'] == null ? undefined : json['cpuOverCommitment'],
133
138
  'hosts': json['hosts'] == null ? undefined : ((json['hosts'] as Array<any>).map(HostFromJSON)),
134
- 'hostsPerCluster': json['hostsPerCluster'],
139
+ 'hostsPerCluster': json['hostsPerCluster'] == null ? undefined : json['hostsPerCluster'],
135
140
  'vmsPerCluster': json['vmsPerCluster'] == null ? undefined : json['vmsPerCluster'],
136
141
  'hostPowerStates': json['hostPowerStates'],
137
142
  'networks': json['networks'] == null ? undefined : ((json['networks'] as Array<any>).map(NetworkFromJSON)),
@@ -16,6 +16,7 @@ import { mapValues } from '../runtime';
16
16
  import type { InventoryData } from './InventoryData';
17
17
  import {
18
18
  InventoryDataFromJSON,
19
+ InventoryDataFromJSONTyped,
19
20
  InventoryDataToJSON,
20
21
  } from './InventoryData';
21
22
 
@@ -63,7 +64,6 @@ export function InventoryFromJSONTyped(json: any, ignoreDiscriminator: boolean):
63
64
  return json;
64
65
  }
65
66
  return {
66
-
67
67
  'vcenterId': json['vcenter_id'],
68
68
  'clusters': json['clusters'] == null ? undefined : (mapValues(json['clusters'], InventoryDataFromJSON)),
69
69
  'vcenter': json['vcenter'] == null ? undefined : InventoryDataFromJSON(json['vcenter']),
@@ -75,7 +75,6 @@ export function InventoryToJSON(value?: Inventory | null): any {
75
75
  return value;
76
76
  }
77
77
  return {
78
-
79
78
  'vcenter_id': value['vcenterId'],
80
79
  'clusters': value['clusters'] == null ? undefined : (mapValues(value['clusters'], InventoryDataToJSON)),
81
80
  'vcenter': InventoryDataToJSON(value['vcenter']),
@@ -12,19 +12,23 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
+ import { mapValues } from '../runtime';
15
16
  import type { VCenter } from './VCenter';
16
17
  import {
17
18
  VCenterFromJSON,
19
+ VCenterFromJSONTyped,
18
20
  VCenterToJSON,
19
21
  } from './VCenter';
20
22
  import type { Infra } from './Infra';
21
23
  import {
22
24
  InfraFromJSON,
25
+ InfraFromJSONTyped,
23
26
  InfraToJSON,
24
27
  } from './Infra';
25
28
  import type { VMs } from './VMs';
26
29
  import {
27
30
  VMsFromJSON,
31
+ VMsFromJSONTyped,
28
32
  VMsToJSON,
29
33
  } from './VMs';
30
34
 
@@ -0,0 +1,95 @@
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 { JobStatus } from './JobStatus';
17
+ import {
18
+ JobStatusFromJSON,
19
+ JobStatusFromJSONTyped,
20
+ JobStatusToJSON,
21
+ } from './JobStatus';
22
+
23
+ /**
24
+ * Background job for async assessment creation
25
+ * @export
26
+ * @interface Job
27
+ */
28
+ export interface Job {
29
+ /**
30
+ * Job ID
31
+ * @type {number}
32
+ * @memberof Job
33
+ */
34
+ id: number;
35
+ /**
36
+ *
37
+ * @type {JobStatus}
38
+ * @memberof Job
39
+ */
40
+ status: JobStatus;
41
+ /**
42
+ * Error message if job failed
43
+ * @type {string}
44
+ * @memberof Job
45
+ */
46
+ error?: string;
47
+ /**
48
+ * Assessment ID when job completed successfully
49
+ * @type {string}
50
+ * @memberof Job
51
+ */
52
+ assessmentId?: string;
53
+ }
54
+
55
+
56
+
57
+ /**
58
+ * Check if a given object implements the Job interface.
59
+ */
60
+ export function instanceOfJob(value: object): value is Job {
61
+ if (!('id' in value) || value['id'] === undefined) return false;
62
+ if (!('status' in value) || value['status'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function JobFromJSON(json: any): Job {
67
+ return JobFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function JobFromJSONTyped(json: any, ignoreDiscriminator: boolean): Job {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'id': json['id'],
77
+ 'status': JobStatusFromJSON(json['status']),
78
+ 'error': json['error'] == null ? undefined : json['error'],
79
+ 'assessmentId': json['assessmentId'] == null ? undefined : json['assessmentId'],
80
+ };
81
+ }
82
+
83
+ export function JobToJSON(value?: Job | null): any {
84
+ if (value == null) {
85
+ return value;
86
+ }
87
+ return {
88
+
89
+ 'id': value['id'],
90
+ 'status': JobStatusToJSON(value['status']),
91
+ 'error': value['error'],
92
+ 'assessmentId': value['assessmentId'],
93
+ };
94
+ }
95
+
@@ -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
+
16
+ /**
17
+ * Job status:
18
+ * * `pending` - Job is queued
19
+ * * `parsing` - Parsing RVTools Excel file
20
+ * * `validating` - Running OPA VM validations
21
+ * * `completed` - Assessment created successfully
22
+ * * `failed` - Job failed with error
23
+ * * `cancelled` - Job was cancelled
24
+ *
25
+ * @export
26
+ */
27
+ export const JobStatus = {
28
+ Pending: 'pending',
29
+ Parsing: 'parsing',
30
+ Validating: 'validating',
31
+ Completed: 'completed',
32
+ Failed: 'failed',
33
+ Cancelled: 'cancelled'
34
+ } as const;
35
+ export type JobStatus = typeof JobStatus[keyof typeof JobStatus];
36
+
37
+
38
+ export function instanceOfJobStatus(value: any): boolean {
39
+ for (const key in JobStatus) {
40
+ if (Object.prototype.hasOwnProperty.call(JobStatus, key)) {
41
+ if (JobStatus[key as keyof typeof JobStatus] === value) {
42
+ return true;
43
+ }
44
+ }
45
+ }
46
+ return false;
47
+ }
48
+
49
+ export function JobStatusFromJSON(json: any): JobStatus {
50
+ return JobStatusFromJSONTyped(json, false);
51
+ }
52
+
53
+ export function JobStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): JobStatus {
54
+ return json as JobStatus;
55
+ }
56
+
57
+ export function JobStatusToJSON(value?: JobStatus | null): any {
58
+ return value as any;
59
+ }
60
+