@openshift-migration-advisor/agent-sdk 0.28.0 → 0.29.0-722023a09157

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @openshift-migration-advisor/agent-sdk@0.28.0
1
+ # @openshift-migration-advisor/agent-sdk@0.29.0-722023a09157
2
2
 
3
3
  A TypeScript SDK client for the raw.githubusercontent.com API.
4
4
 
@@ -200,7 +200,7 @@ and is automatically generated by the
200
200
  [OpenAPI Generator](https://openapi-generator.tech) project:
201
201
 
202
202
  - API version: `v2`
203
- - Package version: `0.28.0`
203
+ - Package version: `0.29.0-722023a09157`
204
204
  - Generator version: `7.27.0-SNAPSHOT`
205
205
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
206
206
 
@@ -15,6 +15,12 @@
15
15
  * @interface VMFilterOptionsResponse
16
16
  */
17
17
  export interface VMFilterOptionsResponse {
18
+ /**
19
+ * Distinct metadata values grouped by key, available for VM filtering.
20
+ */
21
+ metadata: {
22
+ [key: string]: Array<string>;
23
+ };
18
24
  /**
19
25
  * Distinct cluster names
20
26
  */
@@ -15,6 +15,8 @@
15
15
  * Check if a given object implements the VMFilterOptionsResponse interface.
16
16
  */
17
17
  export function instanceOfVMFilterOptionsResponse(value) {
18
+ if (!('metadata' in value) || value['metadata'] === undefined)
19
+ return false;
18
20
  if (!('clusters' in value) || value['clusters'] === undefined)
19
21
  return false;
20
22
  if (!('datacenters' in value) || value['datacenters'] === undefined)
@@ -35,6 +37,7 @@ export function VMFilterOptionsResponseFromJSONTyped(json, ignoreDiscriminator)
35
37
  return json;
36
38
  }
37
39
  return {
40
+ 'metadata': json['metadata'],
38
41
  'clusters': json['clusters'],
39
42
  'datacenters': json['datacenters'],
40
43
  'concernLabels': json['concernLabels'],
@@ -50,6 +53,7 @@ export function VMFilterOptionsResponseToJSONTyped(value, ignoreDiscriminator =
50
53
  return value;
51
54
  }
52
55
  return {
56
+ 'metadata': value['metadata'],
53
57
  'clusters': value['clusters'],
54
58
  'datacenters': value['datacenters'],
55
59
  'concernLabels': value['concernLabels'],
@@ -128,6 +128,12 @@ export interface VirtualMachineDetail {
128
128
  * Whether Fault Tolerance is enabled
129
129
  */
130
130
  faultToleranceEnabled?: boolean;
131
+ /**
132
+ * Tags and custom attributes collected from vCenter or RVTools, grouped by tag category name, custom attribute name, or RVTools column header. Empty object when absent. vCenter tags with unresolved category names are omitted.
133
+ */
134
+ readonly metadata?: {
135
+ [key: string]: Array<string>;
136
+ };
131
137
  /**
132
138
  * Whether nested virtualization is enabled
133
139
  */
@@ -180,4 +186,4 @@ export declare function instanceOfVirtualMachineDetail(value: object): value is
180
186
  export declare function VirtualMachineDetailFromJSON(json: any): VirtualMachineDetail;
181
187
  export declare function VirtualMachineDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): VirtualMachineDetail;
182
188
  export declare function VirtualMachineDetailToJSON(json: any): VirtualMachineDetail;
183
- export declare function VirtualMachineDetailToJSONTyped(value?: VirtualMachineDetail | null, ignoreDiscriminator?: boolean): any;
189
+ export declare function VirtualMachineDetailToJSONTyped(value?: Omit<VirtualMachineDetail, 'metadata'> | null, ignoreDiscriminator?: boolean): any;
@@ -80,6 +80,7 @@ export function VirtualMachineDetailFromJSONTyped(json, ignoreDiscriminator) {
80
80
  'inspectionStatus': json['inspectionStatus'] == null ? undefined : InspectionStatusFromJSON(json['inspectionStatus']),
81
81
  'labels': json['labels'] == null ? undefined : json['labels'],
82
82
  'faultToleranceEnabled': json['faultToleranceEnabled'] == null ? undefined : json['faultToleranceEnabled'],
83
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
83
84
  'nestedHVEnabled': json['nestedHVEnabled'] == null ? undefined : json['nestedHVEnabled'],
84
85
  'toolsStatus': json['toolsStatus'] == null ? undefined : json['toolsStatus'],
85
86
  'toolsRunningStatus': json['toolsRunningStatus'] == null ? undefined : json['toolsRunningStatus'],
@@ -15,6 +15,12 @@
15
15
  * @interface VMFilterOptionsResponse
16
16
  */
17
17
  export interface VMFilterOptionsResponse {
18
+ /**
19
+ * Distinct metadata values grouped by key, available for VM filtering.
20
+ */
21
+ metadata: {
22
+ [key: string]: Array<string>;
23
+ };
18
24
  /**
19
25
  * Distinct cluster names
20
26
  */
@@ -22,6 +22,8 @@ exports.VMFilterOptionsResponseToJSONTyped = VMFilterOptionsResponseToJSONTyped;
22
22
  * Check if a given object implements the VMFilterOptionsResponse interface.
23
23
  */
24
24
  function instanceOfVMFilterOptionsResponse(value) {
25
+ if (!('metadata' in value) || value['metadata'] === undefined)
26
+ return false;
25
27
  if (!('clusters' in value) || value['clusters'] === undefined)
26
28
  return false;
27
29
  if (!('datacenters' in value) || value['datacenters'] === undefined)
@@ -42,6 +44,7 @@ function VMFilterOptionsResponseFromJSONTyped(json, ignoreDiscriminator) {
42
44
  return json;
43
45
  }
44
46
  return {
47
+ 'metadata': json['metadata'],
45
48
  'clusters': json['clusters'],
46
49
  'datacenters': json['datacenters'],
47
50
  'concernLabels': json['concernLabels'],
@@ -57,6 +60,7 @@ function VMFilterOptionsResponseToJSONTyped(value, ignoreDiscriminator = false)
57
60
  return value;
58
61
  }
59
62
  return {
63
+ 'metadata': value['metadata'],
60
64
  'clusters': value['clusters'],
61
65
  'datacenters': value['datacenters'],
62
66
  'concernLabels': value['concernLabels'],
@@ -128,6 +128,12 @@ export interface VirtualMachineDetail {
128
128
  * Whether Fault Tolerance is enabled
129
129
  */
130
130
  faultToleranceEnabled?: boolean;
131
+ /**
132
+ * Tags and custom attributes collected from vCenter or RVTools, grouped by tag category name, custom attribute name, or RVTools column header. Empty object when absent. vCenter tags with unresolved category names are omitted.
133
+ */
134
+ readonly metadata?: {
135
+ [key: string]: Array<string>;
136
+ };
131
137
  /**
132
138
  * Whether nested virtualization is enabled
133
139
  */
@@ -180,4 +186,4 @@ export declare function instanceOfVirtualMachineDetail(value: object): value is
180
186
  export declare function VirtualMachineDetailFromJSON(json: any): VirtualMachineDetail;
181
187
  export declare function VirtualMachineDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): VirtualMachineDetail;
182
188
  export declare function VirtualMachineDetailToJSON(json: any): VirtualMachineDetail;
183
- export declare function VirtualMachineDetailToJSONTyped(value?: VirtualMachineDetail | null, ignoreDiscriminator?: boolean): any;
189
+ export declare function VirtualMachineDetailToJSONTyped(value?: Omit<VirtualMachineDetail, 'metadata'> | null, ignoreDiscriminator?: boolean): any;
@@ -87,6 +87,7 @@ function VirtualMachineDetailFromJSONTyped(json, ignoreDiscriminator) {
87
87
  'inspectionStatus': json['inspectionStatus'] == null ? undefined : (0, InspectionStatus_js_1.InspectionStatusFromJSON)(json['inspectionStatus']),
88
88
  'labels': json['labels'] == null ? undefined : json['labels'],
89
89
  'faultToleranceEnabled': json['faultToleranceEnabled'] == null ? undefined : json['faultToleranceEnabled'],
90
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
90
91
  'nestedHVEnabled': json['nestedHVEnabled'] == null ? undefined : json['nestedHVEnabled'],
91
92
  'toolsStatus': json['toolsStatus'] == null ? undefined : json['toolsStatus'],
92
93
  'toolsRunningStatus': json['toolsRunningStatus'] == null ? undefined : json['toolsRunningStatus'],
@@ -6,6 +6,7 @@
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
+ `metadata` | { [key: string]: Array&lt;string&gt;; }
9
10
  `clusters` | Array&lt;string&gt;
10
11
  `datacenters` | Array&lt;string&gt;
11
12
  `concernLabels` | Array&lt;string&gt;
@@ -19,6 +20,7 @@ import type { VMFilterOptionsResponse } from '@openshift-migration-advisor/agent
19
20
 
20
21
  // TODO: Update the object below with actual values
21
22
  const example = {
23
+ "metadata": null,
22
24
  "clusters": null,
23
25
  "datacenters": null,
24
26
  "concernLabels": null,
@@ -32,6 +32,7 @@ Name | Type
32
32
  `inspectionStatus` | [InspectionStatus](InspectionStatus.md)
33
33
  `labels` | Array&lt;string&gt;
34
34
  `faultToleranceEnabled` | boolean
35
+ `metadata` | { [key: string]: Array&lt;string&gt;; }
35
36
  `nestedHVEnabled` | boolean
36
37
  `toolsStatus` | string
37
38
  `toolsRunningStatus` | string
@@ -77,6 +78,7 @@ const example = {
77
78
  "inspectionStatus": null,
78
79
  "labels": null,
79
80
  "faultToleranceEnabled": null,
81
+ "metadata": null,
80
82
  "nestedHVEnabled": null,
81
83
  "toolsStatus": null,
82
84
  "toolsRunningStatus": null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openshift-migration-advisor/agent-sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0-722023a09157",
4
4
  "description": "OpenAPI client for @openshift-migration-advisor/agent-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -19,6 +19,10 @@ import { mapValues } from '../runtime.js';
19
19
  * @interface VMFilterOptionsResponse
20
20
  */
21
21
  export interface VMFilterOptionsResponse {
22
+ /**
23
+ * Distinct metadata values grouped by key, available for VM filtering.
24
+ */
25
+ metadata: { [key: string]: Array<string>; };
22
26
  /**
23
27
  * Distinct cluster names
24
28
  */
@@ -45,6 +49,7 @@ export interface VMFilterOptionsResponse {
45
49
  * Check if a given object implements the VMFilterOptionsResponse interface.
46
50
  */
47
51
  export function instanceOfVMFilterOptionsResponse(value: object): value is VMFilterOptionsResponse {
52
+ if (!('metadata' in value) || value['metadata'] === undefined) return false;
48
53
  if (!('clusters' in value) || value['clusters'] === undefined) return false;
49
54
  if (!('datacenters' in value) || value['datacenters'] === undefined) return false;
50
55
  if (!('concernLabels' in value) || value['concernLabels'] === undefined) return false;
@@ -63,6 +68,7 @@ export function VMFilterOptionsResponseFromJSONTyped(json: any, ignoreDiscrimina
63
68
  }
64
69
  return {
65
70
 
71
+ 'metadata': json['metadata'],
66
72
  'clusters': json['clusters'],
67
73
  'datacenters': json['datacenters'],
68
74
  'concernLabels': json['concernLabels'],
@@ -82,6 +88,7 @@ export function VMFilterOptionsResponseToJSONTyped(value?: VMFilterOptionsRespon
82
88
 
83
89
  return {
84
90
 
91
+ 'metadata': value['metadata'],
85
92
  'clusters': value['clusters'],
86
93
  'datacenters': value['datacenters'],
87
94
  'concernLabels': value['concernLabels'],
@@ -187,6 +187,10 @@ export interface VirtualMachineDetail {
187
187
  * Whether Fault Tolerance is enabled
188
188
  */
189
189
  faultToleranceEnabled?: boolean;
190
+ /**
191
+ * Tags and custom attributes collected from vCenter or RVTools, grouped by tag category name, custom attribute name, or RVTools column header. Empty object when absent. vCenter tags with unresolved category names are omitted.
192
+ */
193
+ readonly metadata?: { [key: string]: Array<string>; };
190
194
  /**
191
195
  * Whether nested virtualization is enabled
192
196
  */
@@ -286,6 +290,7 @@ export function VirtualMachineDetailFromJSONTyped(json: any, ignoreDiscriminator
286
290
  'inspectionStatus': json['inspectionStatus'] == null ? undefined : InspectionStatusFromJSON(json['inspectionStatus']),
287
291
  'labels': json['labels'] == null ? undefined : json['labels'],
288
292
  'faultToleranceEnabled': json['faultToleranceEnabled'] == null ? undefined : json['faultToleranceEnabled'],
293
+ 'metadata': json['metadata'] == null ? undefined : json['metadata'],
289
294
  'nestedHVEnabled': json['nestedHVEnabled'] == null ? undefined : json['nestedHVEnabled'],
290
295
  'toolsStatus': json['toolsStatus'] == null ? undefined : json['toolsStatus'],
291
296
  'toolsRunningStatus': json['toolsRunningStatus'] == null ? undefined : json['toolsRunningStatus'],
@@ -304,7 +309,7 @@ export function VirtualMachineDetailToJSON(json: any): VirtualMachineDetail {
304
309
  return VirtualMachineDetailToJSONTyped(json, false);
305
310
  }
306
311
 
307
- export function VirtualMachineDetailToJSONTyped(value?: VirtualMachineDetail | null, ignoreDiscriminator: boolean = false): any {
312
+ export function VirtualMachineDetailToJSONTyped(value?: Omit<VirtualMachineDetail, 'metadata'> | null, ignoreDiscriminator: boolean = false): any {
308
313
  if (value == null) {
309
314
  return value;
310
315
  }
package/src/runtime.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
- export const BASE_PATH = "https://raw.githubusercontent.com/api/v2".replace(/\/+$/, "");
15
+ export const BASE_PATH: string = "https://raw.githubusercontent.com/api/v2".replace(/\/+$/, "");
16
16
 
17
17
  export interface ConfigurationParameters {
18
18
  basePath?: string; // override base path
@@ -83,7 +83,7 @@ export class Configuration {
83
83
  }
84
84
  }
85
85
 
86
- export const DefaultConfig = new Configuration();
86
+ export const DefaultConfig: Configuration = new Configuration();
87
87
 
88
88
  /**
89
89
  * This is the base class for all generated API classes.
@@ -93,22 +93,22 @@ export class BaseAPI {
93
93
  private static readonly jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
94
94
  private middleware: Middleware[];
95
95
 
96
- constructor(protected configuration = DefaultConfig) {
96
+ constructor(protected configuration: Configuration = DefaultConfig) {
97
97
  this.middleware = configuration.middleware;
98
98
  }
99
99
 
100
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
100
+ withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T {
101
101
  const next = this.clone<T>();
102
102
  next.middleware = next.middleware.concat(...middlewares);
103
103
  return next;
104
104
  }
105
105
 
106
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
106
+ withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T {
107
107
  const middlewares = preMiddlewares.map((pre) => ({ pre }));
108
108
  return this.withMiddleware<T>(...middlewares);
109
109
  }
110
110
 
111
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
111
+ withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T {
112
112
  const middlewares = postMiddlewares.map((post) => ({ post }));
113
113
  return this.withMiddleware<T>(...middlewares);
114
114
  }
@@ -354,7 +354,7 @@ function querystringSingleKey(key: string, value: string | number | null | undef
354
354
  return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
355
355
  }
356
356
 
357
- export function exists(json: any, key: string) {
357
+ export function exists(json: any, key: string): boolean {
358
358
  const value = json[key];
359
359
  return value !== null && value !== undefined;
360
360
  }
@@ -410,7 +410,7 @@ export function parseDateTime(value: any): Date {
410
410
  return new Date(value);
411
411
  }
412
412
 
413
- export function mapValues(data: any, fn: (item: any) => any) {
413
+ export function mapValues(data: any, fn: (item: any) => any): { [key: string]: any } {
414
414
  const result: { [key: string]: any } = {};
415
415
  for (const key of Object.keys(data)) {
416
416
  result[key] = fn(data[key]);