@openshift-migration-advisor/planner-sdk 0.5.0-c546f50341aa → 0.5.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 (32) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +6 -2
  3. package/dist/apis/AssessmentApi.d.ts +38 -1
  4. package/dist/apis/AssessmentApi.js +44 -0
  5. package/dist/esm/apis/AssessmentApi.d.ts +38 -1
  6. package/dist/esm/apis/AssessmentApi.js +45 -1
  7. package/dist/esm/models/EstimationDetail.d.ts +38 -0
  8. package/dist/esm/models/EstimationDetail.js +47 -0
  9. package/dist/esm/models/MigrationEstimationRequest.d.ts +32 -0
  10. package/dist/esm/models/MigrationEstimationRequest.js +43 -0
  11. package/dist/esm/models/MigrationEstimationResponse.d.ts +41 -0
  12. package/dist/esm/models/MigrationEstimationResponse.js +49 -0
  13. package/dist/esm/models/index.d.ts +3 -0
  14. package/dist/esm/models/index.js +3 -0
  15. package/dist/models/EstimationDetail.d.ts +38 -0
  16. package/dist/models/EstimationDetail.js +54 -0
  17. package/dist/models/MigrationEstimationRequest.d.ts +32 -0
  18. package/dist/models/MigrationEstimationRequest.js +50 -0
  19. package/dist/models/MigrationEstimationResponse.d.ts +41 -0
  20. package/dist/models/MigrationEstimationResponse.js +56 -0
  21. package/dist/models/index.d.ts +3 -0
  22. package/dist/models/index.js +3 -0
  23. package/docs/AssessmentApi.md +76 -0
  24. package/docs/EstimationDetail.md +37 -0
  25. package/docs/MigrationEstimationRequest.md +35 -0
  26. package/docs/MigrationEstimationResponse.md +37 -0
  27. package/package.json +1 -1
  28. package/src/apis/AssessmentApi.ts +90 -0
  29. package/src/models/EstimationDetail.ts +75 -0
  30. package/src/models/MigrationEstimationRequest.ts +66 -0
  31. package/src/models/MigrationEstimationResponse.ts +83 -0
  32. package/src/models/index.ts +3 -0
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Migration Planner API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: undefined
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfEstimationDetail = instanceOfEstimationDetail;
17
+ exports.EstimationDetailFromJSON = EstimationDetailFromJSON;
18
+ exports.EstimationDetailFromJSONTyped = EstimationDetailFromJSONTyped;
19
+ exports.EstimationDetailToJSON = EstimationDetailToJSON;
20
+ exports.EstimationDetailToJSONTyped = EstimationDetailToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the EstimationDetail interface.
23
+ */
24
+ function instanceOfEstimationDetail(value) {
25
+ if (!('duration' in value) || value['duration'] === undefined)
26
+ return false;
27
+ if (!('reason' in value) || value['reason'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function EstimationDetailFromJSON(json) {
32
+ return EstimationDetailFromJSONTyped(json, false);
33
+ }
34
+ function EstimationDetailFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'duration': json['duration'],
40
+ 'reason': json['reason'],
41
+ };
42
+ }
43
+ function EstimationDetailToJSON(json) {
44
+ return EstimationDetailToJSONTyped(json, false);
45
+ }
46
+ function EstimationDetailToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'duration': value['duration'],
52
+ 'reason': value['reason'],
53
+ };
54
+ }
@@ -0,0 +1,32 @@
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
+ * Request payload for calculating migration time estimation
14
+ * @export
15
+ * @interface MigrationEstimationRequest
16
+ */
17
+ export interface MigrationEstimationRequest {
18
+ /**
19
+ * ID of the cluster to calculate migration estimation for
20
+ * @type {string}
21
+ * @memberof MigrationEstimationRequest
22
+ */
23
+ clusterId: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the MigrationEstimationRequest interface.
27
+ */
28
+ export declare function instanceOfMigrationEstimationRequest(value: object): value is MigrationEstimationRequest;
29
+ export declare function MigrationEstimationRequestFromJSON(json: any): MigrationEstimationRequest;
30
+ export declare function MigrationEstimationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationRequest;
31
+ export declare function MigrationEstimationRequestToJSON(json: any): MigrationEstimationRequest;
32
+ export declare function MigrationEstimationRequestToJSONTyped(value?: MigrationEstimationRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Migration Planner API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: undefined
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfMigrationEstimationRequest = instanceOfMigrationEstimationRequest;
17
+ exports.MigrationEstimationRequestFromJSON = MigrationEstimationRequestFromJSON;
18
+ exports.MigrationEstimationRequestFromJSONTyped = MigrationEstimationRequestFromJSONTyped;
19
+ exports.MigrationEstimationRequestToJSON = MigrationEstimationRequestToJSON;
20
+ exports.MigrationEstimationRequestToJSONTyped = MigrationEstimationRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the MigrationEstimationRequest interface.
23
+ */
24
+ function instanceOfMigrationEstimationRequest(value) {
25
+ if (!('clusterId' in value) || value['clusterId'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function MigrationEstimationRequestFromJSON(json) {
30
+ return MigrationEstimationRequestFromJSONTyped(json, false);
31
+ }
32
+ function MigrationEstimationRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'clusterId': json['clusterId'],
38
+ };
39
+ }
40
+ function MigrationEstimationRequestToJSON(json) {
41
+ return MigrationEstimationRequestToJSONTyped(json, false);
42
+ }
43
+ function MigrationEstimationRequestToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'clusterId': value['clusterId'],
49
+ };
50
+ }
@@ -0,0 +1,41 @@
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 { EstimationDetail } from './EstimationDetail.js';
13
+ /**
14
+ * Migration time estimation results
15
+ * @export
16
+ * @interface MigrationEstimationResponse
17
+ */
18
+ export interface MigrationEstimationResponse {
19
+ /**
20
+ * Total estimated migration duration (formatted as duration string, e.g., "2h30m")
21
+ * @type {string}
22
+ * @memberof MigrationEstimationResponse
23
+ */
24
+ totalDuration: string;
25
+ /**
26
+ * Breakdown of estimation by calculator
27
+ * @type {{ [key: string]: EstimationDetail; }}
28
+ * @memberof MigrationEstimationResponse
29
+ */
30
+ breakdown: {
31
+ [key: string]: EstimationDetail;
32
+ };
33
+ }
34
+ /**
35
+ * Check if a given object implements the MigrationEstimationResponse interface.
36
+ */
37
+ export declare function instanceOfMigrationEstimationResponse(value: object): value is MigrationEstimationResponse;
38
+ export declare function MigrationEstimationResponseFromJSON(json: any): MigrationEstimationResponse;
39
+ export declare function MigrationEstimationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MigrationEstimationResponse;
40
+ export declare function MigrationEstimationResponseToJSON(json: any): MigrationEstimationResponse;
41
+ export declare function MigrationEstimationResponseToJSONTyped(value?: MigrationEstimationResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Migration Planner API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: undefined
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfMigrationEstimationResponse = instanceOfMigrationEstimationResponse;
17
+ exports.MigrationEstimationResponseFromJSON = MigrationEstimationResponseFromJSON;
18
+ exports.MigrationEstimationResponseFromJSONTyped = MigrationEstimationResponseFromJSONTyped;
19
+ exports.MigrationEstimationResponseToJSON = MigrationEstimationResponseToJSON;
20
+ exports.MigrationEstimationResponseToJSONTyped = MigrationEstimationResponseToJSONTyped;
21
+ const runtime_js_1 = require("../runtime.js");
22
+ const EstimationDetail_js_1 = require("./EstimationDetail.js");
23
+ /**
24
+ * Check if a given object implements the MigrationEstimationResponse interface.
25
+ */
26
+ function instanceOfMigrationEstimationResponse(value) {
27
+ if (!('totalDuration' in value) || value['totalDuration'] === undefined)
28
+ return false;
29
+ if (!('breakdown' in value) || value['breakdown'] === undefined)
30
+ return false;
31
+ return true;
32
+ }
33
+ function MigrationEstimationResponseFromJSON(json) {
34
+ return MigrationEstimationResponseFromJSONTyped(json, false);
35
+ }
36
+ function MigrationEstimationResponseFromJSONTyped(json, ignoreDiscriminator) {
37
+ if (json == null) {
38
+ return json;
39
+ }
40
+ return {
41
+ 'totalDuration': json['totalDuration'],
42
+ 'breakdown': ((0, runtime_js_1.mapValues)(json['breakdown'], EstimationDetail_js_1.EstimationDetailFromJSON)),
43
+ };
44
+ }
45
+ function MigrationEstimationResponseToJSON(json) {
46
+ return MigrationEstimationResponseToJSONTyped(json, false);
47
+ }
48
+ function MigrationEstimationResponseToJSONTyped(value, ignoreDiscriminator = false) {
49
+ if (value == null) {
50
+ return value;
51
+ }
52
+ return {
53
+ 'totalDuration': value['totalDuration'],
54
+ 'breakdown': ((0, runtime_js_1.mapValues)(value['breakdown'], EstimationDetail_js_1.EstimationDetailToJSON)),
55
+ };
56
+ }
@@ -9,6 +9,7 @@ export * from './ClusterSizing.js';
9
9
  export * from './Datastore.js';
10
10
  export * from './DiskSizeTierSummary.js';
11
11
  export * from './DiskTypeSummary.js';
12
+ export * from './EstimationDetail.js';
12
13
  export * from './Histogram.js';
13
14
  export * from './Host.js';
14
15
  export * from './Info.js';
@@ -20,6 +21,8 @@ export * from './Ipv4Config.js';
20
21
  export * from './Job.js';
21
22
  export * from './JobStatus.js';
22
23
  export * from './Label.js';
24
+ export * from './MigrationEstimationRequest.js';
25
+ export * from './MigrationEstimationResponse.js';
23
26
  export * from './MigrationIssue.js';
24
27
  export * from './ModelError.js';
25
28
  export * from './Network.js';
@@ -27,6 +27,7 @@ __exportStar(require("./ClusterSizing.js"), exports);
27
27
  __exportStar(require("./Datastore.js"), exports);
28
28
  __exportStar(require("./DiskSizeTierSummary.js"), exports);
29
29
  __exportStar(require("./DiskTypeSummary.js"), exports);
30
+ __exportStar(require("./EstimationDetail.js"), exports);
30
31
  __exportStar(require("./Histogram.js"), exports);
31
32
  __exportStar(require("./Host.js"), exports);
32
33
  __exportStar(require("./Info.js"), exports);
@@ -38,6 +39,8 @@ __exportStar(require("./Ipv4Config.js"), exports);
38
39
  __exportStar(require("./Job.js"), exports);
39
40
  __exportStar(require("./JobStatus.js"), exports);
40
41
  __exportStar(require("./Label.js"), exports);
42
+ __exportStar(require("./MigrationEstimationRequest.js"), exports);
43
+ __exportStar(require("./MigrationEstimationResponse.js"), exports);
41
44
  __exportStar(require("./MigrationIssue.js"), exports);
42
45
  __exportStar(require("./ModelError.js"), exports);
43
46
  __exportStar(require("./Network.js"), exports);
@@ -5,6 +5,7 @@ All URIs are relative to *https://raw.githubusercontent.com*
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
7
  | [**calculateAssessmentClusterRequirements**](AssessmentApi.md#calculateassessmentclusterrequirements) | **POST** /api/v1/assessments/{id}/cluster-requirements | |
8
+ | [**calculateMigrationEstimation**](AssessmentApi.md#calculatemigrationestimation) | **POST** /api/v1/assessments/{id}/migration-estimation | |
8
9
  | [**createAssessment**](AssessmentApi.md#createassessment) | **POST** /api/v1/assessments | |
9
10
  | [**deleteAssessment**](AssessmentApi.md#deleteassessment) | **DELETE** /api/v1/assessments/{id} | |
10
11
  | [**getAssessment**](AssessmentApi.md#getassessment) | **GET** /api/v1/assessments/{id} | |
@@ -89,6 +90,81 @@ No authorization required
89
90
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
90
91
 
91
92
 
93
+ ## calculateMigrationEstimation
94
+
95
+ > MigrationEstimationResponse calculateMigrationEstimation(id, migrationEstimationRequest)
96
+
97
+
98
+
99
+ Calculate migration time estimation for an assessment
100
+
101
+ ### Example
102
+
103
+ ```ts
104
+ import {
105
+ Configuration,
106
+ AssessmentApi,
107
+ } from '@openshift-migration-advisor/planner-sdk';
108
+ import type { CalculateMigrationEstimationRequest } from '@openshift-migration-advisor/planner-sdk';
109
+
110
+ async function example() {
111
+ console.log("🚀 Testing @openshift-migration-advisor/planner-sdk SDK...");
112
+ const api = new AssessmentApi();
113
+
114
+ const body = {
115
+ // string | ID of the assessment
116
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
117
+ // MigrationEstimationRequest
118
+ migrationEstimationRequest: {"clusterId":"domain-c8"},
119
+ } satisfies CalculateMigrationEstimationRequest;
120
+
121
+ try {
122
+ const data = await api.calculateMigrationEstimation(body);
123
+ console.log(data);
124
+ } catch (error) {
125
+ console.error(error);
126
+ }
127
+ }
128
+
129
+ // Run the test
130
+ example().catch(console.error);
131
+ ```
132
+
133
+ ### Parameters
134
+
135
+
136
+ | Name | Type | Description | Notes |
137
+ |------------- | ------------- | ------------- | -------------|
138
+ | **id** | `string` | ID of the assessment | [Defaults to `undefined`] |
139
+ | **migrationEstimationRequest** | [MigrationEstimationRequest](MigrationEstimationRequest.md) | | |
140
+
141
+ ### Return type
142
+
143
+ [**MigrationEstimationResponse**](MigrationEstimationResponse.md)
144
+
145
+ ### Authorization
146
+
147
+ No authorization required
148
+
149
+ ### HTTP request headers
150
+
151
+ - **Content-Type**: `application/json`
152
+ - **Accept**: `application/json`
153
+
154
+
155
+ ### HTTP response details
156
+ | Status code | Description | Response headers |
157
+ |-------------|-------------|------------------|
158
+ | **200** | Migration estimation calculation successful | - |
159
+ | **400** | Bad Request | - |
160
+ | **401** | Unauthorized | - |
161
+ | **403** | Forbidden | - |
162
+ | **404** | Assessment not found | - |
163
+ | **500** | Internal error | - |
164
+
165
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
166
+
167
+
92
168
  ## createAssessment
93
169
 
94
170
  > Assessment createAssessment(assessmentForm)
@@ -0,0 +1,37 @@
1
+
2
+ # EstimationDetail
3
+
4
+ Detailed estimation result from a single calculator
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `duration` | string
11
+ `reason` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { EstimationDetail } from '@openshift-migration-advisor/planner-sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "duration": 3h40m0s,
21
+ "reason": 1000.00 GB at 110 minutes per 500GB,
22
+ } satisfies EstimationDetail
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as EstimationDetail
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -0,0 +1,35 @@
1
+
2
+ # MigrationEstimationRequest
3
+
4
+ Request payload for calculating migration time estimation
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `clusterId` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { MigrationEstimationRequest } from '@openshift-migration-advisor/planner-sdk'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "clusterId": domain-c8,
20
+ } satisfies MigrationEstimationRequest
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as MigrationEstimationRequest
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
@@ -0,0 +1,37 @@
1
+
2
+ # MigrationEstimationResponse
3
+
4
+ Migration time estimation results
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `totalDuration` | string
11
+ `breakdown` | [{ [key: string]: EstimationDetail; }](EstimationDetail.md)
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { MigrationEstimationResponse } from '@openshift-migration-advisor/planner-sdk'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "totalDuration": 4h30m0s,
21
+ "breakdown": null,
22
+ } satisfies MigrationEstimationResponse
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as MigrationEstimationResponse
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openshift-migration-advisor/planner-sdk",
3
- "version": "0.5.0-c546f50341aa",
3
+ "version": "0.5.1",
4
4
  "description": "OpenAPI client for @openshift-migration-advisor/planner-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -20,6 +20,8 @@ import type {
20
20
  AssessmentUpdate,
21
21
  ClusterRequirementsRequest,
22
22
  ClusterRequirementsResponse,
23
+ MigrationEstimationRequest,
24
+ MigrationEstimationResponse,
23
25
  } from '../models/index.js';
24
26
  import {
25
27
  AssessmentFromJSON,
@@ -32,6 +34,10 @@ import {
32
34
  ClusterRequirementsRequestToJSON,
33
35
  ClusterRequirementsResponseFromJSON,
34
36
  ClusterRequirementsResponseToJSON,
37
+ MigrationEstimationRequestFromJSON,
38
+ MigrationEstimationRequestToJSON,
39
+ MigrationEstimationResponseFromJSON,
40
+ MigrationEstimationResponseToJSON,
35
41
  } from '../models/index.js';
36
42
 
37
43
  export interface CalculateAssessmentClusterRequirementsRequest {
@@ -39,6 +45,11 @@ export interface CalculateAssessmentClusterRequirementsRequest {
39
45
  clusterRequirementsRequest: ClusterRequirementsRequest;
40
46
  }
41
47
 
48
+ export interface CalculateMigrationEstimationRequest {
49
+ id: string;
50
+ migrationEstimationRequest: MigrationEstimationRequest;
51
+ }
52
+
42
53
  export interface CreateAssessmentRequest {
43
54
  assessmentForm: AssessmentForm;
44
55
  }
@@ -91,6 +102,30 @@ export interface AssessmentApiInterface {
91
102
  */
92
103
  calculateAssessmentClusterRequirements(requestParameters: CalculateAssessmentClusterRequirementsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ClusterRequirementsResponse>;
93
104
 
105
+ /**
106
+ * Creates request options for calculateMigrationEstimation without sending the request
107
+ * @param {string} id ID of the assessment
108
+ * @param {MigrationEstimationRequest} migrationEstimationRequest
109
+ * @throws {RequiredError}
110
+ * @memberof AssessmentApiInterface
111
+ */
112
+ calculateMigrationEstimationRequestOpts(requestParameters: CalculateMigrationEstimationRequest): Promise<runtime.RequestOpts>;
113
+
114
+ /**
115
+ * Calculate migration time estimation for an assessment
116
+ * @param {string} id ID of the assessment
117
+ * @param {MigrationEstimationRequest} migrationEstimationRequest
118
+ * @param {*} [options] Override http request option.
119
+ * @throws {RequiredError}
120
+ * @memberof AssessmentApiInterface
121
+ */
122
+ calculateMigrationEstimationRaw(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MigrationEstimationResponse>>;
123
+
124
+ /**
125
+ * Calculate migration time estimation for an assessment
126
+ */
127
+ calculateMigrationEstimation(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MigrationEstimationResponse>;
128
+
94
129
  /**
95
130
  * Creates request options for createAssessment without sending the request
96
131
  * @param {AssessmentForm} assessmentForm
@@ -265,6 +300,61 @@ export class AssessmentApi extends runtime.BaseAPI implements AssessmentApiInter
265
300
  return await response.value();
266
301
  }
267
302
 
303
+ /**
304
+ * Creates request options for calculateMigrationEstimation without sending the request
305
+ */
306
+ async calculateMigrationEstimationRequestOpts(requestParameters: CalculateMigrationEstimationRequest): Promise<runtime.RequestOpts> {
307
+ if (requestParameters['id'] == null) {
308
+ throw new runtime.RequiredError(
309
+ 'id',
310
+ 'Required parameter "id" was null or undefined when calling calculateMigrationEstimation().'
311
+ );
312
+ }
313
+
314
+ if (requestParameters['migrationEstimationRequest'] == null) {
315
+ throw new runtime.RequiredError(
316
+ 'migrationEstimationRequest',
317
+ 'Required parameter "migrationEstimationRequest" was null or undefined when calling calculateMigrationEstimation().'
318
+ );
319
+ }
320
+
321
+ const queryParameters: any = {};
322
+
323
+ const headerParameters: runtime.HTTPHeaders = {};
324
+
325
+ headerParameters['Content-Type'] = 'application/json';
326
+
327
+
328
+ let urlPath = `/api/v1/assessments/{id}/migration-estimation`;
329
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
330
+
331
+ return {
332
+ path: urlPath,
333
+ method: 'POST',
334
+ headers: headerParameters,
335
+ query: queryParameters,
336
+ body: MigrationEstimationRequestToJSON(requestParameters['migrationEstimationRequest']),
337
+ };
338
+ }
339
+
340
+ /**
341
+ * Calculate migration time estimation for an assessment
342
+ */
343
+ async calculateMigrationEstimationRaw(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MigrationEstimationResponse>> {
344
+ const requestOptions = await this.calculateMigrationEstimationRequestOpts(requestParameters);
345
+ const response = await this.request(requestOptions, initOverrides);
346
+
347
+ return new runtime.JSONApiResponse(response, (jsonValue) => MigrationEstimationResponseFromJSON(jsonValue));
348
+ }
349
+
350
+ /**
351
+ * Calculate migration time estimation for an assessment
352
+ */
353
+ async calculateMigrationEstimation(requestParameters: CalculateMigrationEstimationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MigrationEstimationResponse> {
354
+ const response = await this.calculateMigrationEstimationRaw(requestParameters, initOverrides);
355
+ return await response.value();
356
+ }
357
+
268
358
  /**
269
359
  * Creates request options for createAssessment without sending the request
270
360
  */
@@ -0,0 +1,75 @@
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.js';
16
+ /**
17
+ * Detailed estimation result from a single calculator
18
+ * @export
19
+ * @interface EstimationDetail
20
+ */
21
+ export interface EstimationDetail {
22
+ /**
23
+ * Estimated duration for this component (formatted as duration string)
24
+ * @type {string}
25
+ * @memberof EstimationDetail
26
+ */
27
+ duration: string;
28
+ /**
29
+ * Explanation of how the estimation was calculated
30
+ * @type {string}
31
+ * @memberof EstimationDetail
32
+ */
33
+ reason: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the EstimationDetail interface.
38
+ */
39
+ export function instanceOfEstimationDetail(value: object): value is EstimationDetail {
40
+ if (!('duration' in value) || value['duration'] === undefined) return false;
41
+ if (!('reason' in value) || value['reason'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function EstimationDetailFromJSON(json: any): EstimationDetail {
46
+ return EstimationDetailFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function EstimationDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): EstimationDetail {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'duration': json['duration'],
56
+ 'reason': json['reason'],
57
+ };
58
+ }
59
+
60
+ export function EstimationDetailToJSON(json: any): EstimationDetail {
61
+ return EstimationDetailToJSONTyped(json, false);
62
+ }
63
+
64
+ export function EstimationDetailToJSONTyped(value?: EstimationDetail | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'duration': value['duration'],
72
+ 'reason': value['reason'],
73
+ };
74
+ }
75
+