@cirrobio/api-client 0.0.9-alpha → 0.0.11-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 (81) hide show
  1. package/.openapi-generator/FILES +6 -2
  2. package/README.md +1 -1
  3. package/dist/apis/BillingApi.d.ts +15 -2
  4. package/dist/apis/BillingApi.js +57 -3
  5. package/dist/apis/DashboardsApi.d.ts +88 -0
  6. package/dist/apis/DashboardsApi.js +374 -0
  7. package/dist/apis/DatasetsApi.d.ts +19 -5
  8. package/dist/apis/DatasetsApi.js +64 -4
  9. package/dist/apis/MetadataApi.d.ts +12 -0
  10. package/dist/apis/MetadataApi.js +59 -1
  11. package/dist/apis/ProjectsApi.d.ts +13 -1
  12. package/dist/apis/ProjectsApi.js +54 -4
  13. package/dist/apis/index.d.ts +1 -0
  14. package/dist/apis/index.js +1 -0
  15. package/dist/models/BillingAccount.d.ts +6 -0
  16. package/dist/models/BillingAccount.js +3 -0
  17. package/dist/models/BudgetPeriod.d.ts +1 -1
  18. package/dist/models/BudgetPeriod.js +1 -1
  19. package/dist/models/CloudAccount.d.ts +3 -10
  20. package/dist/models/CloudAccount.js +0 -3
  21. package/dist/models/Contact.d.ts +4 -4
  22. package/dist/models/Contact.js +8 -5
  23. package/dist/models/CreateDashboardRequest.d.ts +31 -0
  24. package/dist/models/CreateDashboardRequest.js +50 -0
  25. package/dist/models/CustomPipelineSettings.d.ts +6 -6
  26. package/dist/models/CustomPipelineSettings.js +13 -8
  27. package/dist/models/CustomerType.d.ts +2 -4
  28. package/dist/models/CustomerType.js +2 -4
  29. package/dist/models/Dashboard.d.ts +69 -0
  30. package/dist/models/Dashboard.js +68 -0
  31. package/dist/models/Dataset.d.ts +8 -7
  32. package/dist/models/Dataset.js +10 -9
  33. package/dist/models/DatasetDetail.d.ts +11 -10
  34. package/dist/models/DatasetDetail.js +13 -12
  35. package/dist/models/PaginatedResponseDatasetListDto.d.ts +38 -0
  36. package/dist/models/PaginatedResponseDatasetListDto.js +54 -0
  37. package/dist/models/Project.d.ts +9 -2
  38. package/dist/models/Project.js +6 -2
  39. package/dist/models/ProjectDetail.d.ts +7 -6
  40. package/dist/models/ProjectDetail.js +7 -6
  41. package/dist/models/ProjectSettings.d.ts +26 -26
  42. package/dist/models/ProjectSettings.js +14 -26
  43. package/dist/models/RegisterDatasetRequest.d.ts +20 -2
  44. package/dist/models/RegisterDatasetRequest.js +11 -2
  45. package/dist/models/RegisterPublicDataRequest.d.ts +43 -0
  46. package/dist/models/RegisterPublicDataRequest.js +56 -0
  47. package/dist/models/Sample.d.ts +12 -0
  48. package/dist/models/Sample.js +6 -0
  49. package/dist/models/SetUserProjectRoleRequest.d.ts +15 -2
  50. package/dist/models/SetUserProjectRoleRequest.js +9 -2
  51. package/dist/models/Status.d.ts +29 -0
  52. package/dist/models/Status.js +44 -0
  53. package/dist/models/index.d.ts +5 -2
  54. package/dist/models/index.js +5 -2
  55. package/package.json +1 -1
  56. package/src/apis/BillingApi.ts +46 -3
  57. package/src/apis/DashboardsApi.ts +287 -0
  58. package/src/apis/DatasetsApi.ts +64 -9
  59. package/src/apis/MetadataApi.ts +51 -1
  60. package/src/apis/ProjectsApi.ts +44 -6
  61. package/src/apis/index.ts +1 -0
  62. package/src/models/BillingAccount.ts +9 -0
  63. package/src/models/BudgetPeriod.ts +1 -1
  64. package/src/models/CloudAccount.ts +3 -18
  65. package/src/models/Contact.ts +12 -8
  66. package/src/models/CreateDashboardRequest.ts +65 -0
  67. package/src/models/CustomPipelineSettings.ts +19 -13
  68. package/src/models/CustomerType.ts +2 -4
  69. package/src/models/Dashboard.ts +120 -0
  70. package/src/models/Dataset.ts +22 -16
  71. package/src/models/DatasetDetail.ts +28 -22
  72. package/src/models/PaginatedResponseDatasetListDto.ts +82 -0
  73. package/src/models/Project.ts +19 -4
  74. package/src/models/ProjectDetail.ts +18 -12
  75. package/src/models/ProjectSettings.ts +39 -52
  76. package/src/models/RegisterDatasetRequest.ts +31 -4
  77. package/src/models/RegisterPublicDataRequest.ts +83 -0
  78. package/src/models/Sample.ts +18 -0
  79. package/src/models/SetUserProjectRoleRequest.ts +29 -4
  80. package/src/models/Status.ts +43 -0
  81. package/src/models/index.ts +5 -2
@@ -3,6 +3,7 @@
3
3
  README.md
4
4
  package.json
5
5
  src/apis/BillingApi.ts
6
+ src/apis/DashboardsApi.ts
6
7
  src/apis/DatasetsApi.ts
7
8
  src/apis/ExecutionApi.ts
8
9
  src/apis/MetadataApi.ts
@@ -20,13 +21,14 @@ src/models/BillingMethod.ts
20
21
  src/models/BudgetPeriod.ts
21
22
  src/models/CloudAccount.ts
22
23
  src/models/Contact.ts
24
+ src/models/CreateDashboardRequest.ts
23
25
  src/models/CreateNotebookInstanceRequest.ts
24
26
  src/models/CreateResponse.ts
25
27
  src/models/CustomPipelineSettings.ts
26
28
  src/models/CustomerType.ts
29
+ src/models/Dashboard.ts
27
30
  src/models/Dataset.ts
28
31
  src/models/DatasetDetail.ts
29
- src/models/DatasetType.ts
30
32
  src/models/Executor.ts
31
33
  src/models/FormSchema.ts
32
34
  src/models/GetExecutionLogsResponse.ts
@@ -34,6 +36,7 @@ src/models/LogEntry.ts
34
36
  src/models/MetricRecord.ts
35
37
  src/models/NotebookInstance.ts
36
38
  src/models/OpenNotebookInstanceResponse.ts
39
+ src/models/PaginatedResponseDatasetListDto.ts
37
40
  src/models/Process.ts
38
41
  src/models/ProcessDetail.ts
39
42
  src/models/Project.ts
@@ -45,11 +48,12 @@ src/models/ProjectSettings.ts
45
48
  src/models/ProjectUser.ts
46
49
  src/models/Reference.ts
47
50
  src/models/ReferenceType.ts
48
- src/models/Region.ts
49
51
  src/models/RegisterDatasetRequest.ts
52
+ src/models/RegisterPublicDataRequest.ts
50
53
  src/models/Sample.ts
51
54
  src/models/ServiceConnection.ts
52
55
  src/models/SetUserProjectRoleRequest.ts
56
+ src/models/Status.ts
53
57
  src/models/StopExecutionResponse.ts
54
58
  src/models/SystemInfoResponse.ts
55
59
  src/models/Tag.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.9-alpha --save
39
+ npm install @cirrobio/api-client@0.0.11-alpha --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -17,6 +17,9 @@ export interface CreateBillingAccountRequest {
17
17
  export interface DeleteBillingAccountRequest {
18
18
  billingAccountId: string;
19
19
  }
20
+ export interface GetBillingAccountsRequest {
21
+ includeArchived?: boolean;
22
+ }
20
23
  export interface UpdateBillingAccountRequest {
21
24
  billingAccountId: string;
22
25
  billingAccount: BillingAccount;
@@ -45,16 +48,26 @@ export declare class BillingApi extends runtime.BaseAPI {
45
48
  * Delete billing account
46
49
  */
47
50
  deleteBillingAccount(requestParameters: DeleteBillingAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
51
+ /**
52
+ * Generates a billing report xlsx with cost information
53
+ * Generate billing report
54
+ */
55
+ generateBillingReportRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
56
+ /**
57
+ * Generates a billing report xlsx with cost information
58
+ * Generate billing report
59
+ */
60
+ generateBillingReport(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
48
61
  /**
49
62
  * Gets a list of billing accounts the current user has access to
50
63
  * List billing accounts
51
64
  */
52
- getBillingAccountsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<BillingAccount>>>;
65
+ getBillingAccountsRaw(requestParameters: GetBillingAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<BillingAccount>>>;
53
66
  /**
54
67
  * Gets a list of billing accounts the current user has access to
55
68
  * List billing accounts
56
69
  */
57
- getBillingAccounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<BillingAccount>>;
70
+ getBillingAccounts(requestParameters?: GetBillingAccountsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<BillingAccount>>;
58
71
  /**
59
72
  * Updates a billing account
60
73
  * Update billing account
@@ -185,17 +185,70 @@ var BillingApi = /** @class */ (function (_super) {
185
185
  });
186
186
  });
187
187
  };
188
+ /**
189
+ * Generates a billing report xlsx with cost information
190
+ * Generate billing report
191
+ */
192
+ BillingApi.prototype.generateBillingReportRaw = function (initOverrides) {
193
+ return __awaiter(this, void 0, void 0, function () {
194
+ var queryParameters, headerParameters, token, tokenString, response;
195
+ return __generator(this, function (_a) {
196
+ switch (_a.label) {
197
+ case 0:
198
+ queryParameters = {};
199
+ headerParameters = {};
200
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
201
+ token = this.configuration.accessToken;
202
+ return [4 /*yield*/, token("accessToken", [])];
203
+ case 1:
204
+ tokenString = _a.sent();
205
+ if (tokenString) {
206
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
207
+ }
208
+ _a.label = 2;
209
+ case 2: return [4 /*yield*/, this.request({
210
+ path: "/billing-report",
211
+ method: 'GET',
212
+ headers: headerParameters,
213
+ query: queryParameters,
214
+ }, initOverrides)];
215
+ case 3:
216
+ response = _a.sent();
217
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
218
+ }
219
+ });
220
+ });
221
+ };
222
+ /**
223
+ * Generates a billing report xlsx with cost information
224
+ * Generate billing report
225
+ */
226
+ BillingApi.prototype.generateBillingReport = function (initOverrides) {
227
+ return __awaiter(this, void 0, void 0, function () {
228
+ return __generator(this, function (_a) {
229
+ switch (_a.label) {
230
+ case 0: return [4 /*yield*/, this.generateBillingReportRaw(initOverrides)];
231
+ case 1:
232
+ _a.sent();
233
+ return [2 /*return*/];
234
+ }
235
+ });
236
+ });
237
+ };
188
238
  /**
189
239
  * Gets a list of billing accounts the current user has access to
190
240
  * List billing accounts
191
241
  */
192
- BillingApi.prototype.getBillingAccountsRaw = function (initOverrides) {
242
+ BillingApi.prototype.getBillingAccountsRaw = function (requestParameters, initOverrides) {
193
243
  return __awaiter(this, void 0, void 0, function () {
194
244
  var queryParameters, headerParameters, token, tokenString, response;
195
245
  return __generator(this, function (_a) {
196
246
  switch (_a.label) {
197
247
  case 0:
198
248
  queryParameters = {};
249
+ if (requestParameters.includeArchived !== undefined) {
250
+ queryParameters['includeArchived'] = requestParameters.includeArchived;
251
+ }
199
252
  headerParameters = {};
200
253
  if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
201
254
  token = this.configuration.accessToken;
@@ -223,12 +276,13 @@ var BillingApi = /** @class */ (function (_super) {
223
276
  * Gets a list of billing accounts the current user has access to
224
277
  * List billing accounts
225
278
  */
226
- BillingApi.prototype.getBillingAccounts = function (initOverrides) {
279
+ BillingApi.prototype.getBillingAccounts = function (requestParameters, initOverrides) {
280
+ if (requestParameters === void 0) { requestParameters = {}; }
227
281
  return __awaiter(this, void 0, void 0, function () {
228
282
  var response;
229
283
  return __generator(this, function (_a) {
230
284
  switch (_a.label) {
231
- case 0: return [4 /*yield*/, this.getBillingAccountsRaw(initOverrides)];
285
+ case 0: return [4 /*yield*/, this.getBillingAccountsRaw(requestParameters, initOverrides)];
232
286
  case 1:
233
287
  response = _a.sent();
234
288
  return [4 /*yield*/, response.value()];
@@ -0,0 +1,88 @@
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
+ import * as runtime from '../runtime';
13
+ import type { CreateDashboardRequest, CreateResponse, Dashboard } from '../models/index';
14
+ export interface CreateDashboardOperationRequest {
15
+ projectId: string;
16
+ createDashboardRequest: CreateDashboardRequest;
17
+ }
18
+ export interface DeleteDashboardRequest {
19
+ projectId: string;
20
+ dashboardId: string;
21
+ }
22
+ export interface GetDashboardRequest {
23
+ projectId: string;
24
+ dashboardId: string;
25
+ }
26
+ export interface GetDashboardsRequest {
27
+ projectId: string;
28
+ }
29
+ export interface UpdateDashboardRequest {
30
+ projectId: string;
31
+ dashboardId: string;
32
+ createDashboardRequest: CreateDashboardRequest;
33
+ }
34
+ /**
35
+ *
36
+ */
37
+ export declare class DashboardsApi extends runtime.BaseAPI {
38
+ /**
39
+ * Creates a dashboard
40
+ * Create dashboard
41
+ */
42
+ createDashboardRaw(requestParameters: CreateDashboardOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateResponse>>;
43
+ /**
44
+ * Creates a dashboard
45
+ * Create dashboard
46
+ */
47
+ createDashboard(requestParameters: CreateDashboardOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateResponse>;
48
+ /**
49
+ * Deletes a dashboard
50
+ * Delete dashboard
51
+ */
52
+ deleteDashboardRaw(requestParameters: DeleteDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Dashboard>>;
53
+ /**
54
+ * Deletes a dashboard
55
+ * Delete dashboard
56
+ */
57
+ deleteDashboard(requestParameters: DeleteDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Dashboard>;
58
+ /**
59
+ * Retrieves a dashboard
60
+ * Get dashboard
61
+ */
62
+ getDashboardRaw(requestParameters: GetDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Dashboard>>;
63
+ /**
64
+ * Retrieves a dashboard
65
+ * Get dashboard
66
+ */
67
+ getDashboard(requestParameters: GetDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Dashboard>;
68
+ /**
69
+ * Retrieves a list of dashboards for a given project
70
+ * List dashboards
71
+ */
72
+ getDashboardsRaw(requestParameters: GetDashboardsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Dashboard>>>;
73
+ /**
74
+ * Retrieves a list of dashboards for a given project
75
+ * List dashboards
76
+ */
77
+ getDashboards(requestParameters: GetDashboardsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Dashboard>>;
78
+ /**
79
+ * Updates a dashboard
80
+ * Update dashboard
81
+ */
82
+ updateDashboardRaw(requestParameters: UpdateDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Dashboard>>;
83
+ /**
84
+ * Updates a dashboard
85
+ * Update dashboard
86
+ */
87
+ updateDashboard(requestParameters: UpdateDashboardRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Dashboard>;
88
+ }
@@ -0,0 +1,374 @@
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
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
41
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.DashboardsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var DashboardsApi = /** @class */ (function (_super) {
74
+ __extends(DashboardsApi, _super);
75
+ function DashboardsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Creates a dashboard
80
+ * Create dashboard
81
+ */
82
+ DashboardsApi.prototype.createDashboardRaw = function (requestParameters, 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
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
89
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling createDashboard.');
90
+ }
91
+ if (requestParameters.createDashboardRequest === null || requestParameters.createDashboardRequest === undefined) {
92
+ throw new runtime.RequiredError('createDashboardRequest', 'Required parameter requestParameters.createDashboardRequest was null or undefined when calling createDashboard.');
93
+ }
94
+ queryParameters = {};
95
+ headerParameters = {};
96
+ headerParameters['Content-Type'] = 'application/json';
97
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
98
+ token = this.configuration.accessToken;
99
+ return [4 /*yield*/, token("accessToken", [])];
100
+ case 1:
101
+ tokenString = _a.sent();
102
+ if (tokenString) {
103
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
104
+ }
105
+ _a.label = 2;
106
+ case 2: return [4 /*yield*/, this.request({
107
+ path: "/projects/{projectId}/dashboards".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))),
108
+ method: 'POST',
109
+ headers: headerParameters,
110
+ query: queryParameters,
111
+ body: (0, index_1.CreateDashboardRequestToJSON)(requestParameters.createDashboardRequest),
112
+ }, initOverrides)];
113
+ case 3:
114
+ response = _a.sent();
115
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.CreateResponseFromJSON)(jsonValue); })];
116
+ }
117
+ });
118
+ });
119
+ };
120
+ /**
121
+ * Creates a dashboard
122
+ * Create dashboard
123
+ */
124
+ DashboardsApi.prototype.createDashboard = function (requestParameters, initOverrides) {
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ var response;
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0: return [4 /*yield*/, this.createDashboardRaw(requestParameters, initOverrides)];
130
+ case 1:
131
+ response = _a.sent();
132
+ return [4 /*yield*/, response.value()];
133
+ case 2: return [2 /*return*/, _a.sent()];
134
+ }
135
+ });
136
+ });
137
+ };
138
+ /**
139
+ * Deletes a dashboard
140
+ * Delete dashboard
141
+ */
142
+ DashboardsApi.prototype.deleteDashboardRaw = function (requestParameters, initOverrides) {
143
+ return __awaiter(this, void 0, void 0, function () {
144
+ var queryParameters, headerParameters, token, tokenString, response;
145
+ return __generator(this, function (_a) {
146
+ switch (_a.label) {
147
+ case 0:
148
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
149
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling deleteDashboard.');
150
+ }
151
+ if (requestParameters.dashboardId === null || requestParameters.dashboardId === undefined) {
152
+ throw new runtime.RequiredError('dashboardId', 'Required parameter requestParameters.dashboardId was null or undefined when calling deleteDashboard.');
153
+ }
154
+ queryParameters = {};
155
+ headerParameters = {};
156
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
157
+ token = this.configuration.accessToken;
158
+ return [4 /*yield*/, token("accessToken", [])];
159
+ case 1:
160
+ tokenString = _a.sent();
161
+ if (tokenString) {
162
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
163
+ }
164
+ _a.label = 2;
165
+ case 2: return [4 /*yield*/, this.request({
166
+ path: "/projects/{projectId}/dashboards/{dashboardId}".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))).replace("{".concat("dashboardId", "}"), encodeURIComponent(String(requestParameters.dashboardId))),
167
+ method: 'DELETE',
168
+ headers: headerParameters,
169
+ query: queryParameters,
170
+ }, initOverrides)];
171
+ case 3:
172
+ response = _a.sent();
173
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.DashboardFromJSON)(jsonValue); })];
174
+ }
175
+ });
176
+ });
177
+ };
178
+ /**
179
+ * Deletes a dashboard
180
+ * Delete dashboard
181
+ */
182
+ DashboardsApi.prototype.deleteDashboard = function (requestParameters, initOverrides) {
183
+ return __awaiter(this, void 0, void 0, function () {
184
+ var response;
185
+ return __generator(this, function (_a) {
186
+ switch (_a.label) {
187
+ case 0: return [4 /*yield*/, this.deleteDashboardRaw(requestParameters, initOverrides)];
188
+ case 1:
189
+ response = _a.sent();
190
+ return [4 /*yield*/, response.value()];
191
+ case 2: return [2 /*return*/, _a.sent()];
192
+ }
193
+ });
194
+ });
195
+ };
196
+ /**
197
+ * Retrieves a dashboard
198
+ * Get dashboard
199
+ */
200
+ DashboardsApi.prototype.getDashboardRaw = function (requestParameters, initOverrides) {
201
+ return __awaiter(this, void 0, void 0, function () {
202
+ var queryParameters, headerParameters, token, tokenString, response;
203
+ return __generator(this, function (_a) {
204
+ switch (_a.label) {
205
+ case 0:
206
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
207
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getDashboard.');
208
+ }
209
+ if (requestParameters.dashboardId === null || requestParameters.dashboardId === undefined) {
210
+ throw new runtime.RequiredError('dashboardId', 'Required parameter requestParameters.dashboardId was null or undefined when calling getDashboard.');
211
+ }
212
+ queryParameters = {};
213
+ headerParameters = {};
214
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
215
+ token = this.configuration.accessToken;
216
+ return [4 /*yield*/, token("accessToken", [])];
217
+ case 1:
218
+ tokenString = _a.sent();
219
+ if (tokenString) {
220
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
221
+ }
222
+ _a.label = 2;
223
+ case 2: return [4 /*yield*/, this.request({
224
+ path: "/projects/{projectId}/dashboards/{dashboardId}".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))).replace("{".concat("dashboardId", "}"), encodeURIComponent(String(requestParameters.dashboardId))),
225
+ method: 'GET',
226
+ headers: headerParameters,
227
+ query: queryParameters,
228
+ }, initOverrides)];
229
+ case 3:
230
+ response = _a.sent();
231
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.DashboardFromJSON)(jsonValue); })];
232
+ }
233
+ });
234
+ });
235
+ };
236
+ /**
237
+ * Retrieves a dashboard
238
+ * Get dashboard
239
+ */
240
+ DashboardsApi.prototype.getDashboard = function (requestParameters, initOverrides) {
241
+ return __awaiter(this, void 0, void 0, function () {
242
+ var response;
243
+ return __generator(this, function (_a) {
244
+ switch (_a.label) {
245
+ case 0: return [4 /*yield*/, this.getDashboardRaw(requestParameters, initOverrides)];
246
+ case 1:
247
+ response = _a.sent();
248
+ return [4 /*yield*/, response.value()];
249
+ case 2: return [2 /*return*/, _a.sent()];
250
+ }
251
+ });
252
+ });
253
+ };
254
+ /**
255
+ * Retrieves a list of dashboards for a given project
256
+ * List dashboards
257
+ */
258
+ DashboardsApi.prototype.getDashboardsRaw = function (requestParameters, initOverrides) {
259
+ return __awaiter(this, void 0, void 0, function () {
260
+ var queryParameters, headerParameters, token, tokenString, response;
261
+ return __generator(this, function (_a) {
262
+ switch (_a.label) {
263
+ case 0:
264
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
265
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling getDashboards.');
266
+ }
267
+ queryParameters = {};
268
+ headerParameters = {};
269
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
270
+ token = this.configuration.accessToken;
271
+ return [4 /*yield*/, token("accessToken", [])];
272
+ case 1:
273
+ tokenString = _a.sent();
274
+ if (tokenString) {
275
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
276
+ }
277
+ _a.label = 2;
278
+ case 2: return [4 /*yield*/, this.request({
279
+ path: "/projects/{projectId}/dashboards".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))),
280
+ method: 'GET',
281
+ headers: headerParameters,
282
+ query: queryParameters,
283
+ }, initOverrides)];
284
+ case 3:
285
+ response = _a.sent();
286
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.DashboardFromJSON); })];
287
+ }
288
+ });
289
+ });
290
+ };
291
+ /**
292
+ * Retrieves a list of dashboards for a given project
293
+ * List dashboards
294
+ */
295
+ DashboardsApi.prototype.getDashboards = function (requestParameters, initOverrides) {
296
+ return __awaiter(this, void 0, void 0, function () {
297
+ var response;
298
+ return __generator(this, function (_a) {
299
+ switch (_a.label) {
300
+ case 0: return [4 /*yield*/, this.getDashboardsRaw(requestParameters, initOverrides)];
301
+ case 1:
302
+ response = _a.sent();
303
+ return [4 /*yield*/, response.value()];
304
+ case 2: return [2 /*return*/, _a.sent()];
305
+ }
306
+ });
307
+ });
308
+ };
309
+ /**
310
+ * Updates a dashboard
311
+ * Update dashboard
312
+ */
313
+ DashboardsApi.prototype.updateDashboardRaw = function (requestParameters, initOverrides) {
314
+ return __awaiter(this, void 0, void 0, function () {
315
+ var queryParameters, headerParameters, token, tokenString, response;
316
+ return __generator(this, function (_a) {
317
+ switch (_a.label) {
318
+ case 0:
319
+ if (requestParameters.projectId === null || requestParameters.projectId === undefined) {
320
+ throw new runtime.RequiredError('projectId', 'Required parameter requestParameters.projectId was null or undefined when calling updateDashboard.');
321
+ }
322
+ if (requestParameters.dashboardId === null || requestParameters.dashboardId === undefined) {
323
+ throw new runtime.RequiredError('dashboardId', 'Required parameter requestParameters.dashboardId was null or undefined when calling updateDashboard.');
324
+ }
325
+ if (requestParameters.createDashboardRequest === null || requestParameters.createDashboardRequest === undefined) {
326
+ throw new runtime.RequiredError('createDashboardRequest', 'Required parameter requestParameters.createDashboardRequest was null or undefined when calling updateDashboard.');
327
+ }
328
+ queryParameters = {};
329
+ headerParameters = {};
330
+ headerParameters['Content-Type'] = 'application/json';
331
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
332
+ token = this.configuration.accessToken;
333
+ return [4 /*yield*/, token("accessToken", [])];
334
+ case 1:
335
+ tokenString = _a.sent();
336
+ if (tokenString) {
337
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
338
+ }
339
+ _a.label = 2;
340
+ case 2: return [4 /*yield*/, this.request({
341
+ path: "/projects/{projectId}/dashboards/{dashboardId}".replace("{".concat("projectId", "}"), encodeURIComponent(String(requestParameters.projectId))).replace("{".concat("dashboardId", "}"), encodeURIComponent(String(requestParameters.dashboardId))),
342
+ method: 'PUT',
343
+ headers: headerParameters,
344
+ query: queryParameters,
345
+ body: (0, index_1.CreateDashboardRequestToJSON)(requestParameters.createDashboardRequest),
346
+ }, initOverrides)];
347
+ case 3:
348
+ response = _a.sent();
349
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.DashboardFromJSON)(jsonValue); })];
350
+ }
351
+ });
352
+ });
353
+ };
354
+ /**
355
+ * Updates a dashboard
356
+ * Update dashboard
357
+ */
358
+ DashboardsApi.prototype.updateDashboard = function (requestParameters, initOverrides) {
359
+ return __awaiter(this, void 0, void 0, function () {
360
+ var response;
361
+ return __generator(this, function (_a) {
362
+ switch (_a.label) {
363
+ case 0: return [4 /*yield*/, this.updateDashboardRaw(requestParameters, initOverrides)];
364
+ case 1:
365
+ response = _a.sent();
366
+ return [4 /*yield*/, response.value()];
367
+ case 2: return [2 /*return*/, _a.sent()];
368
+ }
369
+ });
370
+ });
371
+ };
372
+ return DashboardsApi;
373
+ }(runtime.BaseAPI));
374
+ exports.DashboardsApi = DashboardsApi;