@cirrobio/api-client 0.0.6-alpha → 0.0.8-alpha

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 (45) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +1 -1
  3. package/dist/apis/MetricsApi.d.ts +10 -0
  4. package/dist/apis/MetricsApi.js +52 -0
  5. package/dist/apis/ProjectsApi.d.ts +14 -1
  6. package/dist/apis/ProjectsApi.js +55 -0
  7. package/dist/models/BillingMethod.d.ts +6 -6
  8. package/dist/models/BillingMethod.js +7 -5
  9. package/dist/models/BudgetPeriod.d.ts +6 -6
  10. package/dist/models/BudgetPeriod.js +7 -5
  11. package/dist/models/CustomerType.d.ts +7 -7
  12. package/dist/models/CustomerType.js +8 -6
  13. package/dist/models/DatasetType.d.ts +5 -5
  14. package/dist/models/DatasetType.js +6 -4
  15. package/dist/models/Executor.d.ts +6 -6
  16. package/dist/models/Executor.js +7 -5
  17. package/dist/models/MetricRecord.d.ts +45 -0
  18. package/dist/models/MetricRecord.js +56 -0
  19. package/dist/models/ProjectMetrics.d.ts +5 -10
  20. package/dist/models/ProjectMetrics.js +5 -4
  21. package/dist/models/ProjectRequest.d.ts +2 -2
  22. package/dist/models/ProjectRequest.js +2 -2
  23. package/dist/models/ProjectRole.d.ts +7 -7
  24. package/dist/models/ProjectRole.js +8 -6
  25. package/dist/models/ProjectUser.d.ts +62 -0
  26. package/dist/models/ProjectUser.js +66 -0
  27. package/dist/models/Tag.d.ts +6 -0
  28. package/dist/models/Tag.js +3 -0
  29. package/dist/models/index.d.ts +2 -0
  30. package/dist/models/index.js +2 -0
  31. package/package.json +1 -1
  32. package/src/apis/MetricsApi.ts +36 -0
  33. package/src/apis/ProjectsApi.ts +47 -0
  34. package/src/models/BillingMethod.ts +6 -7
  35. package/src/models/BudgetPeriod.ts +6 -7
  36. package/src/models/CustomerType.ts +7 -8
  37. package/src/models/DatasetType.ts +5 -6
  38. package/src/models/Executor.ts +6 -7
  39. package/src/models/MetricRecord.ts +83 -0
  40. package/src/models/ProjectMetrics.ts +15 -8
  41. package/src/models/ProjectRequest.ts +4 -4
  42. package/src/models/ProjectRole.ts +7 -8
  43. package/src/models/ProjectUser.ts +118 -0
  44. package/src/models/Tag.ts +9 -0
  45. package/src/models/index.ts +2 -0
@@ -31,6 +31,7 @@ src/models/Executor.ts
31
31
  src/models/FormSchema.ts
32
32
  src/models/GetExecutionLogsResponse.ts
33
33
  src/models/LogEntry.ts
34
+ src/models/MetricRecord.ts
34
35
  src/models/NotebookInstance.ts
35
36
  src/models/OpenNotebookInstanceResponse.ts
36
37
  src/models/Process.ts
@@ -41,6 +42,7 @@ src/models/ProjectMetrics.ts
41
42
  src/models/ProjectRequest.ts
42
43
  src/models/ProjectRole.ts
43
44
  src/models/ProjectSettings.ts
45
+ src/models/ProjectUser.ts
44
46
  src/models/Reference.ts
45
47
  src/models/ReferenceType.ts
46
48
  src/models/Region.ts
package/README.md CHANGED
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @cirrobio/api-client@0.0.6-alpha --save
39
+ npm install @cirrobio/api-client@0.0.8-alpha --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -18,6 +18,16 @@ export interface GetProjectMetricsRequest {
18
18
  *
19
19
  */
20
20
  export declare class MetricsApi extends runtime.BaseAPI {
21
+ /**
22
+ * Retrieves metrics for all projects.
23
+ * Get all project metrics
24
+ */
25
+ getAllMetricsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectMetrics>>>;
26
+ /**
27
+ * Retrieves metrics for all projects.
28
+ * Get all project metrics
29
+ */
30
+ getAllMetrics(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectMetrics>>;
21
31
  /**
22
32
  * Retrieves metrics about a project.
23
33
  * Get project metrics
@@ -75,6 +75,58 @@ var MetricsApi = /** @class */ (function (_super) {
75
75
  function MetricsApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
+ /**
79
+ * Retrieves metrics for all projects.
80
+ * Get all project metrics
81
+ */
82
+ MetricsApi.prototype.getAllMetricsRaw = function (initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, token, tokenString, response;
85
+ return __generator(this, function (_a) {
86
+ switch (_a.label) {
87
+ case 0:
88
+ queryParameters = {};
89
+ headerParameters = {};
90
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
91
+ token = this.configuration.accessToken;
92
+ return [4 /*yield*/, token("accessToken", [])];
93
+ case 1:
94
+ tokenString = _a.sent();
95
+ if (tokenString) {
96
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
97
+ }
98
+ _a.label = 2;
99
+ case 2: return [4 /*yield*/, this.request({
100
+ path: "/metrics",
101
+ method: 'GET',
102
+ headers: headerParameters,
103
+ query: queryParameters,
104
+ }, initOverrides)];
105
+ case 3:
106
+ response = _a.sent();
107
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.ProjectMetricsFromJSON); })];
108
+ }
109
+ });
110
+ });
111
+ };
112
+ /**
113
+ * Retrieves metrics for all projects.
114
+ * Get all project metrics
115
+ */
116
+ MetricsApi.prototype.getAllMetrics = function (initOverrides) {
117
+ return __awaiter(this, void 0, void 0, function () {
118
+ var response;
119
+ return __generator(this, function (_a) {
120
+ switch (_a.label) {
121
+ case 0: return [4 /*yield*/, this.getAllMetricsRaw(initOverrides)];
122
+ case 1:
123
+ response = _a.sent();
124
+ return [4 /*yield*/, response.value()];
125
+ case 2: return [2 /*return*/, _a.sent()];
126
+ }
127
+ });
128
+ });
129
+ };
78
130
  /**
79
131
  * Retrieves metrics about a project.
80
132
  * Get project metrics
@@ -10,13 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreateResponse, Project, ProjectDetail, ProjectRequest, SetUserProjectRoleRequest, Tag } from '../models/index';
13
+ import type { CreateResponse, Project, ProjectDetail, ProjectRequest, ProjectUser, SetUserProjectRoleRequest, Tag } from '../models/index';
14
14
  export interface CreateProjectRequest {
15
15
  projectRequest: ProjectRequest;
16
16
  }
17
17
  export interface GetProjectRequest {
18
18
  projectId: string;
19
19
  }
20
+ export interface GetProjectUsersRequest {
21
+ projectId: string;
22
+ }
20
23
  export interface SetUserProjectRoleOperationRequest {
21
24
  projectId: string;
22
25
  username: string;
@@ -54,6 +57,16 @@ export declare class ProjectsApi extends runtime.BaseAPI {
54
57
  * Get project
55
58
  */
56
59
  getProject(requestParameters: GetProjectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProjectDetail>;
60
+ /**
61
+ * Gets users who have access to the project
62
+ * Get project permissions
63
+ */
64
+ getProjectUsersRaw(requestParameters: GetProjectUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ProjectUser>>>;
65
+ /**
66
+ * Gets users who have access to the project
67
+ * Get project permissions
68
+ */
69
+ getProjectUsers(requestParameters: GetProjectUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ProjectUser>>;
57
70
  /**
58
71
  * Retrieve a list of projects
59
72
  * Get projects
@@ -187,6 +187,61 @@ var ProjectsApi = /** @class */ (function (_super) {
187
187
  });
188
188
  });
189
189
  };
190
+ /**
191
+ * Gets users who have access to the project
192
+ * Get project permissions
193
+ */
194
+ ProjectsApi.prototype.getProjectUsersRaw = function (requestParameters, initOverrides) {
195
+ return __awaiter(this, void 0, void 0, function () {
196
+ var queryParameters, headerParameters, token, tokenString, response;
197
+ return __generator(this, function (_a) {
198
+ switch (_a.label) {
199
+ case 0:
200
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
201
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getProjectUsers.');
202
+ }
203
+ queryParameters = {};
204
+ headerParameters = {};
205
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
206
+ token = this.configuration.accessToken;
207
+ return [4 /*yield*/, token("accessToken", [])];
208
+ case 1:
209
+ tokenString = _a.sent();
210
+ if (tokenString) {
211
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
212
+ }
213
+ _a.label = 2;
214
+ case 2: return [4 /*yield*/, this.request({
215
+ path: "/projects/{projectId}/permissions".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))),
216
+ method: 'GET',
217
+ headers: headerParameters,
218
+ query: queryParameters,
219
+ }, initOverrides)];
220
+ case 3:
221
+ response = _a.sent();
222
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.ProjectUserFromJSON); })];
223
+ }
224
+ });
225
+ });
226
+ };
227
+ /**
228
+ * Gets users who have access to the project
229
+ * Get project permissions
230
+ */
231
+ ProjectsApi.prototype.getProjectUsers = function (requestParameters, initOverrides) {
232
+ return __awaiter(this, void 0, void 0, function () {
233
+ var response;
234
+ return __generator(this, function (_a) {
235
+ switch (_a.label) {
236
+ case 0: return [4 /*yield*/, this.getProjectUsersRaw(requestParameters, initOverrides)];
237
+ case 1:
238
+ response = _a.sent();
239
+ return [4 /*yield*/, response.value()];
240
+ case 2: return [2 /*return*/, _a.sent()];
241
+ }
242
+ });
243
+ });
244
+ };
190
245
  /**
191
246
  * Retrieve a list of projects
192
247
  * Get projects
@@ -12,13 +12,13 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const BillingMethod: {
17
- readonly BudgetNumber: "BUDGET_NUMBER";
18
- readonly PurchaseOrder: "PURCHASE_ORDER";
19
- readonly Credit: "CREDIT";
20
- };
21
- export type BillingMethod = typeof BillingMethod[keyof typeof BillingMethod];
17
+ export declare enum BillingMethod {
18
+ BudgetNumber = "BUDGET_NUMBER",
19
+ PurchaseOrder = "PURCHASE_ORDER",
20
+ Credit = "CREDIT"
21
+ }
22
22
  export declare function BillingMethodFromJSON(json: any): BillingMethod;
23
23
  export declare function BillingMethodFromJSONTyped(json: any, ignoreDiscriminator: boolean): BillingMethod;
24
24
  export declare function BillingMethodToJSON(value?: BillingMethod | null): any;
@@ -17,12 +17,14 @@ exports.BillingMethodToJSON = exports.BillingMethodFromJSONTyped = exports.Billi
17
17
  /**
18
18
  *
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.BillingMethod = {
22
- BudgetNumber: 'BUDGET_NUMBER',
23
- PurchaseOrder: 'PURCHASE_ORDER',
24
- Credit: 'CREDIT'
25
- };
22
+ var BillingMethod;
23
+ (function (BillingMethod) {
24
+ BillingMethod["BudgetNumber"] = "BUDGET_NUMBER";
25
+ BillingMethod["PurchaseOrder"] = "PURCHASE_ORDER";
26
+ BillingMethod["Credit"] = "CREDIT";
27
+ })(BillingMethod = exports.BillingMethod || (exports.BillingMethod = {}));
26
28
  function BillingMethodFromJSON(json) {
27
29
  return BillingMethodFromJSONTyped(json, false);
28
30
  }
@@ -12,13 +12,13 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const BudgetPeriod: {
17
- readonly Annually: "ANNUALLY";
18
- readonly Quarterly: "QUARTERLY";
19
- readonly Monthly: "MONTHLY";
20
- };
21
- export type BudgetPeriod = typeof BudgetPeriod[keyof typeof BudgetPeriod];
17
+ export declare enum BudgetPeriod {
18
+ Annually = "ANNUALLY",
19
+ Quarterly = "QUARTERLY",
20
+ Monthly = "MONTHLY"
21
+ }
22
22
  export declare function BudgetPeriodFromJSON(json: any): BudgetPeriod;
23
23
  export declare function BudgetPeriodFromJSONTyped(json: any, ignoreDiscriminator: boolean): BudgetPeriod;
24
24
  export declare function BudgetPeriodToJSON(value?: BudgetPeriod | null): any;
@@ -17,12 +17,14 @@ exports.BudgetPeriodToJSON = exports.BudgetPeriodFromJSONTyped = exports.BudgetP
17
17
  /**
18
18
  *
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.BudgetPeriod = {
22
- Annually: 'ANNUALLY',
23
- Quarterly: 'QUARTERLY',
24
- Monthly: 'MONTHLY'
25
- };
22
+ var BudgetPeriod;
23
+ (function (BudgetPeriod) {
24
+ BudgetPeriod["Annually"] = "ANNUALLY";
25
+ BudgetPeriod["Quarterly"] = "QUARTERLY";
26
+ BudgetPeriod["Monthly"] = "MONTHLY";
27
+ })(BudgetPeriod = exports.BudgetPeriod || (exports.BudgetPeriod = {}));
26
28
  function BudgetPeriodFromJSON(json) {
27
29
  return BudgetPeriodFromJSONTyped(json, false);
28
30
  }
@@ -12,14 +12,14 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const CustomerType: {
17
- readonly Free: "FREE";
18
- readonly Usage: "USAGE";
19
- readonly Marketplace: "MARKETPLACE";
20
- readonly Contract: "CONTRACT";
21
- };
22
- export type CustomerType = typeof CustomerType[keyof typeof CustomerType];
17
+ export declare enum CustomerType {
18
+ Free = "FREE",
19
+ Usage = "USAGE",
20
+ Marketplace = "MARKETPLACE",
21
+ Contract = "CONTRACT"
22
+ }
23
23
  export declare function CustomerTypeFromJSON(json: any): CustomerType;
24
24
  export declare function CustomerTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerType;
25
25
  export declare function CustomerTypeToJSON(value?: CustomerType | null): any;
@@ -17,13 +17,15 @@ exports.CustomerTypeToJSON = exports.CustomerTypeFromJSONTyped = exports.Custome
17
17
  /**
18
18
  *
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.CustomerType = {
22
- Free: 'FREE',
23
- Usage: 'USAGE',
24
- Marketplace: 'MARKETPLACE',
25
- Contract: 'CONTRACT'
26
- };
22
+ var CustomerType;
23
+ (function (CustomerType) {
24
+ CustomerType["Free"] = "FREE";
25
+ CustomerType["Usage"] = "USAGE";
26
+ CustomerType["Marketplace"] = "MARKETPLACE";
27
+ CustomerType["Contract"] = "CONTRACT";
28
+ })(CustomerType = exports.CustomerType || (exports.CustomerType = {}));
27
29
  function CustomerTypeFromJSON(json) {
28
30
  return CustomerTypeFromJSONTyped(json, false);
29
31
  }
@@ -12,12 +12,12 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const DatasetType: {
17
- readonly Upload: "UPLOAD";
18
- readonly Public: "PUBLIC";
19
- };
20
- export type DatasetType = typeof DatasetType[keyof typeof DatasetType];
17
+ export declare enum DatasetType {
18
+ Upload = "UPLOAD",
19
+ Public = "PUBLIC"
20
+ }
21
21
  export declare function DatasetTypeFromJSON(json: any): DatasetType;
22
22
  export declare function DatasetTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DatasetType;
23
23
  export declare function DatasetTypeToJSON(value?: DatasetType | null): any;
@@ -17,11 +17,13 @@ exports.DatasetTypeToJSON = exports.DatasetTypeFromJSONTyped = exports.DatasetTy
17
17
  /**
18
18
  *
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.DatasetType = {
22
- Upload: 'UPLOAD',
23
- Public: 'PUBLIC'
24
- };
22
+ var DatasetType;
23
+ (function (DatasetType) {
24
+ DatasetType["Upload"] = "UPLOAD";
25
+ DatasetType["Public"] = "PUBLIC";
26
+ })(DatasetType = exports.DatasetType || (exports.DatasetType = {}));
25
27
  function DatasetTypeFromJSON(json) {
26
28
  return DatasetTypeFromJSONTyped(json, false);
27
29
  }
@@ -12,13 +12,13 @@
12
12
  /**
13
13
  * Process executor
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const Executor: {
17
- readonly Ingest: "INGEST";
18
- readonly Nextflow: "NEXTFLOW";
19
- readonly Cromwell: "CROMWELL";
20
- };
21
- export type Executor = typeof Executor[keyof typeof Executor];
17
+ export declare enum Executor {
18
+ Ingest = "INGEST",
19
+ Nextflow = "NEXTFLOW",
20
+ Cromwell = "CROMWELL"
21
+ }
22
22
  export declare function ExecutorFromJSON(json: any): Executor;
23
23
  export declare function ExecutorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Executor;
24
24
  export declare function ExecutorToJSON(value?: Executor | null): any;
@@ -17,12 +17,14 @@ exports.ExecutorToJSON = exports.ExecutorFromJSONTyped = exports.ExecutorFromJSO
17
17
  /**
18
18
  * Process executor
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.Executor = {
22
- Ingest: 'INGEST',
23
- Nextflow: 'NEXTFLOW',
24
- Cromwell: 'CROMWELL'
25
- };
22
+ var Executor;
23
+ (function (Executor) {
24
+ Executor["Ingest"] = "INGEST";
25
+ Executor["Nextflow"] = "NEXTFLOW";
26
+ Executor["Cromwell"] = "CROMWELL";
27
+ })(Executor = exports.Executor || (exports.Executor = {}));
26
28
  function ExecutorFromJSON(json) {
27
29
  return ExecutorFromJSONTyped(json, false);
28
30
  }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Cirro Data
3
+ * Cirro Data Platform service API
4
+ *
5
+ * The version of the OpenAPI document: latest
6
+ * Contact: support@cirro.bio
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
+ *
14
+ * @export
15
+ * @interface MetricRecord
16
+ */
17
+ export interface MetricRecord {
18
+ /**
19
+ *
20
+ * @type {Date}
21
+ * @memberof MetricRecord
22
+ */
23
+ date: Date;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof MetricRecord
28
+ */
29
+ unit: string;
30
+ /**
31
+ * Map of service names to metric value
32
+ * @type {{ [key: string]: number; }}
33
+ * @memberof MetricRecord
34
+ */
35
+ services?: {
36
+ [key: string]: number;
37
+ };
38
+ }
39
+ /**
40
+ * Check if a given object implements the MetricRecord interface.
41
+ */
42
+ export declare function instanceOfMetricRecord(value: object): boolean;
43
+ export declare function MetricRecordFromJSON(json: any): MetricRecord;
44
+ export declare function MetricRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetricRecord;
45
+ export declare function MetricRecordToJSON(value?: MetricRecord | null): any;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Cirro Data
6
+ * Cirro Data Platform service API
7
+ *
8
+ * The version of the OpenAPI document: latest
9
+ * Contact: support@cirro.bio
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.MetricRecordToJSON = exports.MetricRecordFromJSONTyped = exports.MetricRecordFromJSON = exports.instanceOfMetricRecord = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * Check if a given object implements the MetricRecord interface.
20
+ */
21
+ function instanceOfMetricRecord(value) {
22
+ var isInstance = true;
23
+ isInstance = isInstance && "date" in value;
24
+ isInstance = isInstance && "unit" in value;
25
+ return isInstance;
26
+ }
27
+ exports.instanceOfMetricRecord = instanceOfMetricRecord;
28
+ function MetricRecordFromJSON(json) {
29
+ return MetricRecordFromJSONTyped(json, false);
30
+ }
31
+ exports.MetricRecordFromJSON = MetricRecordFromJSON;
32
+ function MetricRecordFromJSONTyped(json, ignoreDiscriminator) {
33
+ if ((json === undefined) || (json === null)) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'date': (new Date(json['date'])),
38
+ 'unit': json['unit'],
39
+ 'services': !(0, runtime_1.exists)(json, 'services') ? undefined : json['services'],
40
+ };
41
+ }
42
+ exports.MetricRecordFromJSONTyped = MetricRecordFromJSONTyped;
43
+ function MetricRecordToJSON(value) {
44
+ if (value === undefined) {
45
+ return undefined;
46
+ }
47
+ if (value === null) {
48
+ return null;
49
+ }
50
+ return {
51
+ 'date': (value.date.toISOString().substring(0, 10)),
52
+ 'unit': value.unit,
53
+ 'services': value.services,
54
+ };
55
+ }
56
+ exports.MetricRecordToJSON = MetricRecordToJSON;
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { MetricRecord } from './MetricRecord';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -23,22 +24,16 @@ export interface ProjectMetrics {
23
24
  projectId: string;
24
25
  /**
25
26
  * Costs by service by month
26
- * @type {{ [key: string]: { [key: string]: number; }; }}
27
+ * @type {Array<MetricRecord>}
27
28
  * @memberof ProjectMetrics
28
29
  */
29
- costs?: {
30
- [key: string]: {
31
- [key: string]: number;
32
- };
33
- };
30
+ costs?: Array<MetricRecord>;
34
31
  /**
35
32
  * Storage usage by tier by day
36
- * @type {{ [key: string]: any; }}
33
+ * @type {Array<MetricRecord>}
37
34
  * @memberof ProjectMetrics
38
35
  */
39
- storageMetrics?: {
40
- [key: string]: any;
41
- };
36
+ storageMetrics?: Array<MetricRecord>;
42
37
  }
43
38
  /**
44
39
  * Check if a given object implements the ProjectMetrics interface.
@@ -15,6 +15,7 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.ProjectMetricsToJSON = exports.ProjectMetricsFromJSONTyped = exports.ProjectMetricsFromJSON = exports.instanceOfProjectMetrics = void 0;
17
17
  var runtime_1 = require("../runtime");
18
+ var MetricRecord_1 = require("./MetricRecord");
18
19
  /**
19
20
  * Check if a given object implements the ProjectMetrics interface.
20
21
  */
@@ -34,8 +35,8 @@ function ProjectMetricsFromJSONTyped(json, ignoreDiscriminator) {
34
35
  }
35
36
  return {
36
37
  'projectId': json['projectId'],
37
- 'costs': !(0, runtime_1.exists)(json, 'costs') ? undefined : json['costs'],
38
- 'storageMetrics': !(0, runtime_1.exists)(json, 'storageMetrics') ? undefined : json['storageMetrics'],
38
+ 'costs': !(0, runtime_1.exists)(json, 'costs') ? undefined : (json['costs'].map(MetricRecord_1.MetricRecordFromJSON)),
39
+ 'storageMetrics': !(0, runtime_1.exists)(json, 'storageMetrics') ? undefined : (json['storageMetrics'].map(MetricRecord_1.MetricRecordFromJSON)),
39
40
  };
40
41
  }
41
42
  exports.ProjectMetricsFromJSONTyped = ProjectMetricsFromJSONTyped;
@@ -48,8 +49,8 @@ function ProjectMetricsToJSON(value) {
48
49
  }
49
50
  return {
50
51
  'projectId': value.projectId,
51
- 'costs': value.costs,
52
- 'storageMetrics': value.storageMetrics,
52
+ 'costs': value.costs === undefined ? undefined : (value.costs.map(MetricRecord_1.MetricRecordToJSON)),
53
+ 'storageMetrics': value.storageMetrics === undefined ? undefined : (value.storageMetrics.map(MetricRecord_1.MetricRecordToJSON)),
53
54
  };
54
55
  }
55
56
  exports.ProjectMetricsToJSON = ProjectMetricsToJSON;
@@ -54,13 +54,13 @@ export interface ProjectRequest {
54
54
  * @type {CloudAccount}
55
55
  * @memberof ProjectRequest
56
56
  */
57
- account: CloudAccount;
57
+ account: CloudAccount | null;
58
58
  /**
59
59
  *
60
60
  * @type {Array<Tag>}
61
61
  * @memberof ProjectRequest
62
62
  */
63
- tags: Array<Tag>;
63
+ tags: Array<Tag> | null;
64
64
  }
65
65
  /**
66
66
  * Check if a given object implements the ProjectRequest interface.
@@ -48,7 +48,7 @@ function ProjectRequestFromJSONTyped(json, ignoreDiscriminator) {
48
48
  'settings': (0, ProjectSettings_1.ProjectSettingsFromJSON)(json['settings']),
49
49
  'contacts': (json['contacts'].map(Contact_1.ContactFromJSON)),
50
50
  'account': (0, CloudAccount_1.CloudAccountFromJSON)(json['account']),
51
- 'tags': (json['tags'].map(Tag_1.TagFromJSON)),
51
+ 'tags': (json['tags'] === null ? null : json['tags'].map(Tag_1.TagFromJSON)),
52
52
  };
53
53
  }
54
54
  exports.ProjectRequestFromJSONTyped = ProjectRequestFromJSONTyped;
@@ -66,7 +66,7 @@ function ProjectRequestToJSON(value) {
66
66
  'settings': (0, ProjectSettings_1.ProjectSettingsToJSON)(value.settings),
67
67
  'contacts': (value.contacts.map(Contact_1.ContactToJSON)),
68
68
  'account': (0, CloudAccount_1.CloudAccountToJSON)(value.account),
69
- 'tags': (value.tags.map(Tag_1.TagToJSON)),
69
+ 'tags': (value.tags === null ? null : value.tags.map(Tag_1.TagToJSON)),
70
70
  };
71
71
  }
72
72
  exports.ProjectRequestToJSON = ProjectRequestToJSON;
@@ -12,14 +12,14 @@
12
12
  /**
13
13
  *
14
14
  * @export
15
+ * @enum {string}
15
16
  */
16
- export declare const ProjectRole: {
17
- readonly Admin: "ADMIN";
18
- readonly Contributor: "CONTRIBUTOR";
19
- readonly Collaborator: "COLLABORATOR";
20
- readonly None: "NONE";
21
- };
22
- export type ProjectRole = typeof ProjectRole[keyof typeof ProjectRole];
17
+ export declare enum ProjectRole {
18
+ Admin = "ADMIN",
19
+ Contributor = "CONTRIBUTOR",
20
+ Collaborator = "COLLABORATOR",
21
+ None = "NONE"
22
+ }
23
23
  export declare function ProjectRoleFromJSON(json: any): ProjectRole;
24
24
  export declare function ProjectRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProjectRole;
25
25
  export declare function ProjectRoleToJSON(value?: ProjectRole | null): any;
@@ -17,13 +17,15 @@ exports.ProjectRoleToJSON = exports.ProjectRoleFromJSONTyped = exports.ProjectRo
17
17
  /**
18
18
  *
19
19
  * @export
20
+ * @enum {string}
20
21
  */
21
- exports.ProjectRole = {
22
- Admin: 'ADMIN',
23
- Contributor: 'CONTRIBUTOR',
24
- Collaborator: 'COLLABORATOR',
25
- None: 'NONE'
26
- };
22
+ var ProjectRole;
23
+ (function (ProjectRole) {
24
+ ProjectRole["Admin"] = "ADMIN";
25
+ ProjectRole["Contributor"] = "CONTRIBUTOR";
26
+ ProjectRole["Collaborator"] = "COLLABORATOR";
27
+ ProjectRole["None"] = "NONE";
28
+ })(ProjectRole = exports.ProjectRole || (exports.ProjectRole = {}));
27
29
  function ProjectRoleFromJSON(json) {
28
30
  return ProjectRoleFromJSONTyped(json, false);
29
31
  }