edge-impulse-api 1.34.11 → 1.39.0
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/build/library/sdk/api/adminApi.d.ts +72 -4
- package/build/library/sdk/api/adminApi.js +402 -4
- package/build/library/sdk/api/adminApi.js.map +1 -1
- package/build/library/sdk/api/apis.d.ts +1 -5
- package/build/library/sdk/api/apis.js +1 -5
- package/build/library/sdk/api/apis.js.map +1 -1
- package/build/library/sdk/api/optimizationApi.d.ts +35 -0
- package/build/library/sdk/api/optimizationApi.js +237 -0
- package/build/library/sdk/api/optimizationApi.js.map +1 -1
- package/build/library/sdk/api/organizationDataApi.d.ts +2 -2
- package/build/library/sdk/api/organizationDataApi.js +2 -2
- package/build/library/sdk/api/organizationsApi.d.ts +99 -0
- package/build/library/sdk/api/organizationsApi.js +725 -127
- package/build/library/sdk/api/organizationsApi.js.map +1 -1
- package/build/library/sdk/api/projectsApi.d.ts +26 -3
- package/build/library/sdk/api/projectsApi.js +158 -6
- package/build/library/sdk/api/projectsApi.js.map +1 -1
- package/build/library/sdk/api/uploadPortalApi.d.ts +1 -1
- package/build/library/sdk/api/uploadPortalApi.js +1 -1
- package/build/library/sdk/model/addApiKeyRequest.d.ts +0 -7
- package/build/library/sdk/model/addApiKeyRequest.js +1 -12
- package/build/library/sdk/model/addApiKeyRequest.js.map +1 -1
- package/build/library/sdk/model/addOrganizationApiKeyRequest.js.map +1 -1
- package/build/library/sdk/model/addOrganizationApiKeyRequestAllOf.d.ts +27 -0
- package/build/library/sdk/model/addOrganizationApiKeyRequestAllOf.js +33 -0
- package/build/library/sdk/model/addOrganizationApiKeyRequestAllOf.js.map +1 -0
- package/build/library/sdk/model/addProjectApiKeyRequest.d.ts +39 -0
- package/build/library/sdk/model/addProjectApiKeyRequest.js +48 -0
- package/build/library/sdk/model/addProjectApiKeyRequest.js.map +1 -0
- package/build/library/sdk/model/addProjectApiKeyRequestAllOf.d.ts +31 -0
- package/build/library/sdk/model/addProjectApiKeyRequestAllOf.js +38 -0
- package/build/library/sdk/model/addProjectApiKeyRequestAllOf.js.map +1 -0
- package/build/library/sdk/model/adminAddOrganizationApiKeyRequest.d.ts +39 -0
- package/build/library/sdk/model/adminAddOrganizationApiKeyRequest.js +48 -0
- package/build/library/sdk/model/adminAddOrganizationApiKeyRequest.js.map +1 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequest.d.ts +36 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequest.js +42 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequest.js.map +1 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequestAllOf.d.ts +28 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequestAllOf.js +32 -0
- package/build/library/sdk/model/adminAddProjectApiKeyRequestAllOf.js.map +1 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponse.d.ts +34 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponse.js +42 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponse.js.map +1 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js +32 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponse.d.ts +38 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponse.js +47 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponse.js.map +1 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.d.ts +30 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.js +37 -0
- package/build/library/sdk/model/adminGetOrganizationUsageReportsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/anomalyResult.d.ts +5 -0
- package/build/library/sdk/model/anomalyResult.js +5 -0
- package/build/library/sdk/model/anomalyResult.js.map +1 -1
- package/build/library/sdk/model/applicationBudget.d.ts +32 -0
- package/build/library/sdk/model/applicationBudget.js +45 -0
- package/build/library/sdk/model/applicationBudget.js.map +1 -0
- package/build/library/sdk/model/createOrganizationUsageReportBody.d.ts +26 -0
- package/build/library/sdk/model/createOrganizationUsageReportBody.js +37 -0
- package/build/library/sdk/model/createOrganizationUsageReportBody.js.map +1 -0
- package/build/library/sdk/model/getOrganizationUsageReportResponse.d.ts +34 -0
- package/build/library/sdk/model/getOrganizationUsageReportResponse.js +42 -0
- package/build/library/sdk/model/getOrganizationUsageReportResponse.js.map +1 -0
- package/build/library/sdk/model/getTargetConstraintsResponse.d.ts +34 -0
- package/build/library/sdk/model/getTargetConstraintsResponse.js +42 -0
- package/build/library/sdk/model/getTargetConstraintsResponse.js.map +1 -0
- package/build/library/sdk/model/getTargetConstraintsResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/getTargetConstraintsResponseAllOf.js +32 -0
- package/build/library/sdk/model/getTargetConstraintsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/job.d.ts +2 -0
- package/build/library/sdk/model/job.js +5 -0
- package/build/library/sdk/model/job.js.map +1 -1
- package/build/library/sdk/model/jobCreatedByUser.d.ts +28 -0
- package/build/library/sdk/model/jobCreatedByUser.js +47 -0
- package/build/library/sdk/model/jobCreatedByUser.js.map +1 -0
- package/build/library/sdk/model/jobDetails.d.ts +2 -0
- package/build/library/sdk/model/jobDetails.js +5 -0
- package/build/library/sdk/model/jobDetails.js.map +1 -1
- package/build/library/sdk/model/jobParentTypeEnum.d.ts +1 -1
- package/build/library/sdk/model/jobParentTypeEnum.js +1 -1
- package/build/library/sdk/model/jobParentTypeEnum.js.map +1 -1
- package/build/library/sdk/model/jobStatus.d.ts +13 -0
- package/build/library/sdk/model/jobStatus.js +16 -0
- package/build/library/sdk/model/jobStatus.js.map +1 -0
- package/build/library/sdk/model/kerasModelMetadata.d.ts +1 -1
- package/build/library/sdk/model/kerasModelMetadata.js +1 -1
- package/build/library/sdk/model/kerasModelMetadata.js.map +1 -1
- package/build/library/sdk/model/kerasModelMetadataAllOf.d.ts +1 -1
- package/build/library/sdk/model/kerasModelMetadataAllOf.js +1 -1
- package/build/library/sdk/model/kerasModelMetadataAllOf.js.map +1 -1
- package/build/library/sdk/model/listApiKeysResponseAllOfApiKeys.d.ts +1 -1
- package/build/library/sdk/model/listApiKeysResponseAllOfApiKeys.js +1 -1
- package/build/library/sdk/model/listApiKeysResponseAllOfApiKeys.js.map +1 -1
- package/build/library/sdk/model/listOrganizationUsageReportsResponse.d.ts +38 -0
- package/build/library/sdk/model/listOrganizationUsageReportsResponse.js +47 -0
- package/build/library/sdk/model/listOrganizationUsageReportsResponse.js.map +1 -0
- package/build/library/sdk/model/listTunerRunsResponse.d.ts +34 -0
- package/build/library/sdk/model/listTunerRunsResponse.js +42 -0
- package/build/library/sdk/model/listTunerRunsResponse.js.map +1 -0
- package/build/library/sdk/model/listTunerRunsResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/listTunerRunsResponseAllOf.js +32 -0
- package/build/library/sdk/model/listTunerRunsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/memorySpec.d.ts +30 -0
- package/build/library/sdk/model/memorySpec.js +40 -0
- package/build/library/sdk/model/memorySpec.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +30 -0
- package/build/library/sdk/model/models.js +97 -1
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/objectDetectionLastLayer.d.ts +1 -1
- package/build/library/sdk/model/objectDetectionLastLayer.js +1 -1
- package/build/library/sdk/model/objectDetectionLastLayer.js.map +1 -1
- package/build/library/sdk/model/optimizeConfig.d.ts +9 -6
- package/build/library/sdk/model/optimizeConfig.js +7 -2
- package/build/library/sdk/model/optimizeConfig.js.map +1 -1
- package/build/library/sdk/model/optimizeConfigResponse.d.ts +9 -6
- package/build/library/sdk/model/optimizeConfigResponse.js +7 -2
- package/build/library/sdk/model/optimizeConfigResponse.js.map +1 -1
- package/build/library/sdk/model/optimizeConfigTargetDevice.d.ts +1 -1
- package/build/library/sdk/model/optimizeStateResponse.d.ts +8 -3
- package/build/library/sdk/model/optimizeStateResponse.js +14 -4
- package/build/library/sdk/model/optimizeStateResponse.js.map +1 -1
- package/build/library/sdk/model/optimizeStateResponseAllOf.d.ts +8 -3
- package/build/library/sdk/model/optimizeStateResponseAllOf.js +14 -4
- package/build/library/sdk/model/optimizeStateResponseAllOf.js.map +1 -1
- package/build/library/sdk/model/optimizeStateResponseAllOfStatus.d.ts +9 -9
- package/build/library/sdk/model/optimizeStateResponseAllOfStatus.js +1 -1
- package/build/library/sdk/model/optimizeStateResponseAllOfStatus.js.map +1 -1
- package/build/library/sdk/model/optimizeStateResponseAllOfWorkers.d.ts +2 -2
- package/build/library/sdk/model/optimizeTransferLearningModelsResponse.d.ts +1 -1
- package/build/library/sdk/model/optimizeTransferLearningModelsResponseAllOf.d.ts +1 -1
- package/build/library/sdk/model/organizationUsageReport.d.ts +34 -0
- package/build/library/sdk/model/organizationUsageReport.js +72 -0
- package/build/library/sdk/model/organizationUsageReport.js.map +1 -0
- package/build/library/sdk/model/projectInfoResponse.d.ts +2 -0
- package/build/library/sdk/model/projectInfoResponse.js +5 -0
- package/build/library/sdk/model/projectInfoResponse.js.map +1 -1
- package/build/library/sdk/model/projectInfoResponseAllOf.d.ts +2 -0
- package/build/library/sdk/model/projectInfoResponseAllOf.js +5 -0
- package/build/library/sdk/model/projectInfoResponseAllOf.js.map +1 -1
- package/build/library/sdk/model/resourceRange.d.ts +29 -0
- package/build/library/sdk/model/resourceRange.js +40 -0
- package/build/library/sdk/model/resourceRange.js.map +1 -0
- package/build/library/sdk/model/targetConstraints.d.ts +40 -0
- package/build/library/sdk/model/targetConstraints.js +43 -0
- package/build/library/sdk/model/targetConstraints.js.map +1 -0
- package/build/library/sdk/model/targetConstraintsDevice.d.ts +45 -0
- package/build/library/sdk/model/targetConstraintsDevice.js +52 -0
- package/build/library/sdk/model/targetConstraintsDevice.js.map +1 -0
- package/build/library/sdk/model/targetMemory.d.ts +30 -0
- package/build/library/sdk/model/targetMemory.js +40 -0
- package/build/library/sdk/model/targetMemory.js.map +1 -0
- package/build/library/sdk/model/targetProcessor.d.ts +48 -0
- package/build/library/sdk/model/targetProcessor.js +62 -0
- package/build/library/sdk/model/targetProcessor.js.map +1 -0
- package/build/library/sdk/model/tunerRun.d.ts +31 -0
- package/build/library/sdk/model/tunerRun.js +57 -0
- package/build/library/sdk/model/tunerRun.js.map +1 -0
- package/build/library/sdk/model/tunerTrial.d.ts +6 -3
- package/build/library/sdk/model/tunerTrial.js +4 -3
- package/build/library/sdk/model/tunerTrial.js.map +1 -1
- package/build/library/sdk/model/tunerTrialBlocks.d.ts +8 -4
- package/build/library/sdk/model/tunerTrialBlocks.js +5 -3
- package/build/library/sdk/model/tunerTrialBlocks.js.map +1 -1
- package/build/library/sdk/model/tunerTrialImpulse.d.ts +27 -0
- package/build/library/sdk/model/tunerTrialImpulse.js +42 -0
- package/build/library/sdk/model/tunerTrialImpulse.js.map +1 -0
- package/build/library/sdk/model/updateTunerRunRequest.d.ts +25 -0
- package/build/library/sdk/model/updateTunerRunRequest.js +32 -0
- package/build/library/sdk/model/updateTunerRunRequest.js.map +1 -0
- package/package.json +1 -1
- package/build/library/sdk/api/organizationRequiresAdminApi.d.ts +0 -55
- package/build/library/sdk/api/organizationRequiresAdminApi.js +0 -158
- package/build/library/sdk/api/organizationRequiresAdminApi.js.map +0 -1
- package/build/library/sdk/api/organizationRequiresWhitelabelAdminApi.d.ts +0 -55
- package/build/library/sdk/api/organizationRequiresWhitelabelAdminApi.js +0 -158
- package/build/library/sdk/api/organizationRequiresWhitelabelAdminApi.js.map +0 -1
|
@@ -20,6 +20,8 @@ import { AdminGetDataMigrationsResponse } from '../model/adminGetDataMigrationsR
|
|
|
20
20
|
import { AdminGetDisallowedEmailDomainsResponse } from '../model/adminGetDisallowedEmailDomainsResponse';
|
|
21
21
|
import { AdminGetMetricsResponse } from '../model/adminGetMetricsResponse';
|
|
22
22
|
import { AdminGetOrganizationComputeTimeUsageResponse } from '../model/adminGetOrganizationComputeTimeUsageResponse';
|
|
23
|
+
import { AdminGetOrganizationUsageReportResponse } from '../model/adminGetOrganizationUsageReportResponse';
|
|
24
|
+
import { AdminGetOrganizationUsageReportsResponse } from '../model/adminGetOrganizationUsageReportsResponse';
|
|
23
25
|
import { AdminGetOrganizationsResponse } from '../model/adminGetOrganizationsResponse';
|
|
24
26
|
import { AdminGetSSODomainIdPsResponse } from '../model/adminGetSSODomainIdPsResponse';
|
|
25
27
|
import { AdminGetSSOSettingsResponse } from '../model/adminGetSSOSettingsResponse';
|
|
@@ -49,6 +51,7 @@ import { JobMetricsResponse } from '../model/jobMetricsResponse';
|
|
|
49
51
|
import { JobParentTypeEnum } from '../model/jobParentTypeEnum';
|
|
50
52
|
import { ProjectInfoResponse } from '../model/projectInfoResponse';
|
|
51
53
|
import { StartEnterpriseTrialRequest } from '../model/startEnterpriseTrialRequest';
|
|
54
|
+
import { StartJobResponse } from '../model/startJobResponse';
|
|
52
55
|
import { UpdateProjectRequest } from '../model/updateProjectRequest';
|
|
53
56
|
import { Authentication } from '../model/models';
|
|
54
57
|
import { ApiKeyAuth } from '../model/models';
|
|
@@ -57,6 +60,10 @@ export declare enum AdminApiApiKeys {
|
|
|
57
60
|
JWTAuthentication = 1,
|
|
58
61
|
JWTHttpHeaderAuthentication = 2
|
|
59
62
|
}
|
|
63
|
+
declare type adminCreateOrganizationUsageReportQueryParams = {
|
|
64
|
+
startDate: Date;
|
|
65
|
+
endDate: Date;
|
|
66
|
+
};
|
|
60
67
|
declare type adminDeleteOrganizationQueryParams = {
|
|
61
68
|
fullDeletion?: boolean;
|
|
62
69
|
};
|
|
@@ -82,6 +89,10 @@ declare type adminGetOrganizationComputeTimeUsageQueryParams = {
|
|
|
82
89
|
startDate: Date;
|
|
83
90
|
endDate: Date;
|
|
84
91
|
};
|
|
92
|
+
declare type adminGetOrganizationUsageReportsQueryParams = {
|
|
93
|
+
limit?: number;
|
|
94
|
+
offset?: number;
|
|
95
|
+
};
|
|
85
96
|
declare type adminGetOrganizationsQueryParams = {
|
|
86
97
|
active?: number;
|
|
87
98
|
sort?: string;
|
|
@@ -203,6 +214,18 @@ export declare class AdminApi {
|
|
|
203
214
|
[name: string]: string;
|
|
204
215
|
};
|
|
205
216
|
}): Promise<CreateProjectResponse>;
|
|
217
|
+
/**
|
|
218
|
+
* Admin-only API to create a new usage report for an organization. A job is created to process the report request and the job details are returned in the response.
|
|
219
|
+
* @summary Creates a new usage report
|
|
220
|
+
* @param organizationId Organization ID
|
|
221
|
+
* @param startDate Start date
|
|
222
|
+
* @param endDate End date
|
|
223
|
+
*/
|
|
224
|
+
adminCreateOrganizationUsageReport(organizationId: number, queryParams: adminCreateOrganizationUsageReportQueryParams, options?: {
|
|
225
|
+
headers: {
|
|
226
|
+
[name: string]: string;
|
|
227
|
+
};
|
|
228
|
+
}): Promise<StartJobResponse>;
|
|
206
229
|
/**
|
|
207
230
|
* Admin-only API to create a new free tier project.
|
|
208
231
|
* @summary Create a new project
|
|
@@ -245,6 +268,17 @@ export declare class AdminApi {
|
|
|
245
268
|
[name: string]: string;
|
|
246
269
|
};
|
|
247
270
|
}): Promise<GenericApiResponse>;
|
|
271
|
+
/**
|
|
272
|
+
* Admin-only API to delete a usage report for an organization.
|
|
273
|
+
* @summary Delete usage report
|
|
274
|
+
* @param organizationId Organization ID
|
|
275
|
+
* @param usageReportId Usage report ID
|
|
276
|
+
*/
|
|
277
|
+
adminDeleteOrganizationUsageReport(organizationId: number, usageReportId: number, options?: {
|
|
278
|
+
headers: {
|
|
279
|
+
[name: string]: string;
|
|
280
|
+
};
|
|
281
|
+
}): Promise<GenericApiResponse>;
|
|
248
282
|
/**
|
|
249
283
|
* Admin-only API to delete a project.
|
|
250
284
|
* @summary Delete a project
|
|
@@ -275,7 +309,7 @@ export declare class AdminApi {
|
|
|
275
309
|
headers: {
|
|
276
310
|
[name: string]: string;
|
|
277
311
|
};
|
|
278
|
-
}): Promise<
|
|
312
|
+
}): Promise<StartJobResponse>;
|
|
279
313
|
/**
|
|
280
314
|
* Admin-only API to delete an enterprise trial for a user.
|
|
281
315
|
* @summary Delete user enterprise trial
|
|
@@ -297,6 +331,17 @@ export declare class AdminApi {
|
|
|
297
331
|
[name: string]: string;
|
|
298
332
|
};
|
|
299
333
|
}): Promise<GenericApiResponse>;
|
|
334
|
+
/**
|
|
335
|
+
* Admin-only API to download a usage report for an organization.
|
|
336
|
+
* @summary Download usage report
|
|
337
|
+
* @param organizationId Organization ID
|
|
338
|
+
* @param usageReportId Usage report ID
|
|
339
|
+
*/
|
|
340
|
+
adminDownloadOrganizationUsageReport(organizationId: number, usageReportId: number, options?: {
|
|
341
|
+
headers: {
|
|
342
|
+
[name: string]: string;
|
|
343
|
+
};
|
|
344
|
+
}): Promise<any>;
|
|
300
345
|
/**
|
|
301
346
|
* Admin-only API to set a feature flag ON. Setting a feature flag ON essentially enables the feature for all users.
|
|
302
347
|
* @summary Set a feature flag ON
|
|
@@ -386,7 +431,7 @@ export declare class AdminApi {
|
|
|
386
431
|
* Get the job execution details including inner jobs
|
|
387
432
|
* @summary Get job execution details
|
|
388
433
|
* @param jobId Job ID
|
|
389
|
-
* @param parentType Job parent type (project or
|
|
434
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
390
435
|
* @param includeChildrenJobs Include the details of each of the children jobs (recursively)
|
|
391
436
|
*/
|
|
392
437
|
adminGetJobDetails(jobId: number, queryParams: adminGetJobDetailsQueryParams, options?: {
|
|
@@ -398,7 +443,7 @@ export declare class AdminApi {
|
|
|
398
443
|
* Get the logs for a job.
|
|
399
444
|
* @summary Get job logs
|
|
400
445
|
* @param jobId Job ID
|
|
401
|
-
* @param parentType Job parent type (project or
|
|
446
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
402
447
|
* @param limit Maximum number of logs
|
|
403
448
|
* @param offset Start fetching logs from this offset
|
|
404
449
|
*/
|
|
@@ -411,7 +456,7 @@ export declare class AdminApi {
|
|
|
411
456
|
* Get cpu/memory usage metrics, if the job is a Kubernetes job
|
|
412
457
|
* @summary Get job usage metrics
|
|
413
458
|
* @param jobId Job ID
|
|
414
|
-
* @param parentType Job parent type (project or
|
|
459
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
415
460
|
*/
|
|
416
461
|
adminGetJobsMetrics(jobId: number, queryParams: adminGetJobsMetricsQueryParams, options?: {
|
|
417
462
|
headers: {
|
|
@@ -449,6 +494,29 @@ export declare class AdminApi {
|
|
|
449
494
|
[name: string]: string;
|
|
450
495
|
};
|
|
451
496
|
}): Promise<AdminOrganizationInfoResponse>;
|
|
497
|
+
/**
|
|
498
|
+
* Admin-only API to get a usage report for an organization.
|
|
499
|
+
* @summary Get usage report
|
|
500
|
+
* @param organizationId Organization ID
|
|
501
|
+
* @param usageReportId Usage report ID
|
|
502
|
+
*/
|
|
503
|
+
adminGetOrganizationUsageReport(organizationId: number, usageReportId: number, options?: {
|
|
504
|
+
headers: {
|
|
505
|
+
[name: string]: string;
|
|
506
|
+
};
|
|
507
|
+
}): Promise<AdminGetOrganizationUsageReportResponse>;
|
|
508
|
+
/**
|
|
509
|
+
* Admin-only API to get all usage reports for an organization.
|
|
510
|
+
* @summary Get all usage reports
|
|
511
|
+
* @param organizationId Organization ID
|
|
512
|
+
* @param limit Maximum number of results
|
|
513
|
+
* @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
|
|
514
|
+
*/
|
|
515
|
+
adminGetOrganizationUsageReports(organizationId: number, queryParams: adminGetOrganizationUsageReportsQueryParams, options?: {
|
|
516
|
+
headers: {
|
|
517
|
+
[name: string]: string;
|
|
518
|
+
};
|
|
519
|
+
}): Promise<AdminGetOrganizationUsageReportsResponse>;
|
|
452
520
|
/**
|
|
453
521
|
* Admin-only API to get the list of all organizations.
|
|
454
522
|
* @summary Get all organizations
|
|
@@ -601,6 +601,95 @@ class AdminApi {
|
|
|
601
601
|
});
|
|
602
602
|
});
|
|
603
603
|
}
|
|
604
|
+
/**
|
|
605
|
+
* Admin-only API to create a new usage report for an organization. A job is created to process the report request and the job details are returned in the response.
|
|
606
|
+
* @summary Creates a new usage report
|
|
607
|
+
* @param organizationId Organization ID
|
|
608
|
+
* @param startDate Start date
|
|
609
|
+
* @param endDate End date
|
|
610
|
+
*/
|
|
611
|
+
async adminCreateOrganizationUsageReport(organizationId, queryParams, options = { headers: {} }) {
|
|
612
|
+
const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/usage/reports'
|
|
613
|
+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
614
|
+
let localVarQueryParameters = {};
|
|
615
|
+
let localVarHeaderParams = Object.assign({
|
|
616
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
617
|
+
}, this.defaultHeaders);
|
|
618
|
+
const produces = ['application/json'];
|
|
619
|
+
// give precedence to 'application/json'
|
|
620
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
621
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
625
|
+
}
|
|
626
|
+
let localVarFormParams = {};
|
|
627
|
+
// verify required parameter 'organizationId' is not null or undefined
|
|
628
|
+
if (organizationId === null || organizationId === undefined) {
|
|
629
|
+
throw new Error('Required parameter organizationId was null or undefined when calling adminCreateOrganizationUsageReport.');
|
|
630
|
+
}
|
|
631
|
+
// verify required parameter 'startDate' is not null or undefined
|
|
632
|
+
if (queryParams.startDate === null || queryParams.startDate === undefined) {
|
|
633
|
+
throw new Error('Required parameter queryParams.startDate was null or undefined when calling adminCreateOrganizationUsageReport.');
|
|
634
|
+
}
|
|
635
|
+
// verify required parameter 'endDate' is not null or undefined
|
|
636
|
+
if (queryParams.endDate === null || queryParams.endDate === undefined) {
|
|
637
|
+
throw new Error('Required parameter queryParams.endDate was null or undefined when calling adminCreateOrganizationUsageReport.');
|
|
638
|
+
}
|
|
639
|
+
if (queryParams.startDate !== undefined) {
|
|
640
|
+
localVarQueryParameters['startDate'] = models_1.ObjectSerializer.serialize(queryParams.startDate, "Date");
|
|
641
|
+
}
|
|
642
|
+
if (queryParams.endDate !== undefined) {
|
|
643
|
+
localVarQueryParameters['endDate'] = models_1.ObjectSerializer.serialize(queryParams.endDate, "Date");
|
|
644
|
+
}
|
|
645
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
646
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
647
|
+
let localVarUseFormData = false;
|
|
648
|
+
let localVarRequestOptions = {
|
|
649
|
+
method: 'POST',
|
|
650
|
+
qs: localVarQueryParameters,
|
|
651
|
+
headers: localVarHeaderParams,
|
|
652
|
+
uri: localVarPath,
|
|
653
|
+
useQuerystring: this._useQuerystring,
|
|
654
|
+
agentOptions: { keepAlive: false },
|
|
655
|
+
json: true,
|
|
656
|
+
};
|
|
657
|
+
let authenticationPromise = Promise.resolve();
|
|
658
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
659
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
660
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
661
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
662
|
+
return authenticationPromise.then(() => {
|
|
663
|
+
if (Object.keys(localVarFormParams).length) {
|
|
664
|
+
if (localVarUseFormData) {
|
|
665
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
666
|
+
}
|
|
667
|
+
else {
|
|
668
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return new Promise((resolve, reject) => {
|
|
672
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
673
|
+
if (error) {
|
|
674
|
+
reject(error);
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
|
|
678
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
679
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
680
|
+
reject(new Error(body.error || errString));
|
|
681
|
+
}
|
|
682
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
683
|
+
resolve(body);
|
|
684
|
+
}
|
|
685
|
+
else {
|
|
686
|
+
reject(errString);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
}
|
|
604
693
|
/**
|
|
605
694
|
* Admin-only API to create a new free tier project.
|
|
606
695
|
* @summary Create a new project
|
|
@@ -903,6 +992,85 @@ class AdminApi {
|
|
|
903
992
|
});
|
|
904
993
|
});
|
|
905
994
|
}
|
|
995
|
+
/**
|
|
996
|
+
* Admin-only API to delete a usage report for an organization.
|
|
997
|
+
* @summary Delete usage report
|
|
998
|
+
* @param organizationId Organization ID
|
|
999
|
+
* @param usageReportId Usage report ID
|
|
1000
|
+
*/
|
|
1001
|
+
async adminDeleteOrganizationUsageReport(organizationId, usageReportId, options = { headers: {} }) {
|
|
1002
|
+
const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/usage/reports/{usageReportId}'
|
|
1003
|
+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
1004
|
+
.replace('{' + 'usageReportId' + '}', encodeURIComponent(String(usageReportId)));
|
|
1005
|
+
let localVarQueryParameters = {};
|
|
1006
|
+
let localVarHeaderParams = Object.assign({
|
|
1007
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1008
|
+
}, this.defaultHeaders);
|
|
1009
|
+
const produces = ['application/json'];
|
|
1010
|
+
// give precedence to 'application/json'
|
|
1011
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1012
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1013
|
+
}
|
|
1014
|
+
else {
|
|
1015
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1016
|
+
}
|
|
1017
|
+
let localVarFormParams = {};
|
|
1018
|
+
// verify required parameter 'organizationId' is not null or undefined
|
|
1019
|
+
if (organizationId === null || organizationId === undefined) {
|
|
1020
|
+
throw new Error('Required parameter organizationId was null or undefined when calling adminDeleteOrganizationUsageReport.');
|
|
1021
|
+
}
|
|
1022
|
+
// verify required parameter 'usageReportId' is not null or undefined
|
|
1023
|
+
if (usageReportId === null || usageReportId === undefined) {
|
|
1024
|
+
throw new Error('Required parameter usageReportId was null or undefined when calling adminDeleteOrganizationUsageReport.');
|
|
1025
|
+
}
|
|
1026
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
1027
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
1028
|
+
let localVarUseFormData = false;
|
|
1029
|
+
let localVarRequestOptions = {
|
|
1030
|
+
method: 'DELETE',
|
|
1031
|
+
qs: localVarQueryParameters,
|
|
1032
|
+
headers: localVarHeaderParams,
|
|
1033
|
+
uri: localVarPath,
|
|
1034
|
+
useQuerystring: this._useQuerystring,
|
|
1035
|
+
agentOptions: { keepAlive: false },
|
|
1036
|
+
json: true,
|
|
1037
|
+
};
|
|
1038
|
+
let authenticationPromise = Promise.resolve();
|
|
1039
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
1040
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
1041
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
1042
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1043
|
+
return authenticationPromise.then(() => {
|
|
1044
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1045
|
+
if (localVarUseFormData) {
|
|
1046
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
return new Promise((resolve, reject) => {
|
|
1053
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1054
|
+
if (error) {
|
|
1055
|
+
reject(error);
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
1059
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1060
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
1061
|
+
reject(new Error(body.error || errString));
|
|
1062
|
+
}
|
|
1063
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1064
|
+
resolve(body);
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
reject(errString);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
906
1074
|
/**
|
|
907
1075
|
* Admin-only API to delete a project.
|
|
908
1076
|
* @summary Delete a project
|
|
@@ -1110,7 +1278,7 @@ class AdminApi {
|
|
|
1110
1278
|
reject(error);
|
|
1111
1279
|
}
|
|
1112
1280
|
else {
|
|
1113
|
-
body = models_1.ObjectSerializer.deserialize(body, "
|
|
1281
|
+
body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
|
|
1114
1282
|
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1115
1283
|
if (typeof body.success === 'boolean' && !body.success) {
|
|
1116
1284
|
reject(new Error(body.error || errString));
|
|
@@ -1278,6 +1446,76 @@ class AdminApi {
|
|
|
1278
1446
|
});
|
|
1279
1447
|
});
|
|
1280
1448
|
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Admin-only API to download a usage report for an organization.
|
|
1451
|
+
* @summary Download usage report
|
|
1452
|
+
* @param organizationId Organization ID
|
|
1453
|
+
* @param usageReportId Usage report ID
|
|
1454
|
+
*/
|
|
1455
|
+
async adminDownloadOrganizationUsageReport(organizationId, usageReportId, options = { headers: {} }) {
|
|
1456
|
+
const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/usage/reports/{usageReportId}/download'
|
|
1457
|
+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
1458
|
+
.replace('{' + 'usageReportId' + '}', encodeURIComponent(String(usageReportId)));
|
|
1459
|
+
let localVarQueryParameters = {};
|
|
1460
|
+
let localVarHeaderParams = Object.assign({
|
|
1461
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1462
|
+
}, this.defaultHeaders);
|
|
1463
|
+
let localVarFormParams = {};
|
|
1464
|
+
// verify required parameter 'organizationId' is not null or undefined
|
|
1465
|
+
if (organizationId === null || organizationId === undefined) {
|
|
1466
|
+
throw new Error('Required parameter organizationId was null or undefined when calling adminDownloadOrganizationUsageReport.');
|
|
1467
|
+
}
|
|
1468
|
+
// verify required parameter 'usageReportId' is not null or undefined
|
|
1469
|
+
if (usageReportId === null || usageReportId === undefined) {
|
|
1470
|
+
throw new Error('Required parameter usageReportId was null or undefined when calling adminDownloadOrganizationUsageReport.');
|
|
1471
|
+
}
|
|
1472
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
1473
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
1474
|
+
let localVarUseFormData = false;
|
|
1475
|
+
let localVarRequestOptions = {
|
|
1476
|
+
method: 'GET',
|
|
1477
|
+
qs: localVarQueryParameters,
|
|
1478
|
+
headers: localVarHeaderParams,
|
|
1479
|
+
uri: localVarPath,
|
|
1480
|
+
useQuerystring: this._useQuerystring,
|
|
1481
|
+
agentOptions: { keepAlive: false },
|
|
1482
|
+
json: true,
|
|
1483
|
+
};
|
|
1484
|
+
let authenticationPromise = Promise.resolve();
|
|
1485
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
1486
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
1487
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
1488
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1489
|
+
return authenticationPromise.then(() => {
|
|
1490
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1491
|
+
if (localVarUseFormData) {
|
|
1492
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
1493
|
+
}
|
|
1494
|
+
else {
|
|
1495
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
return new Promise((resolve, reject) => {
|
|
1499
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1500
|
+
if (error) {
|
|
1501
|
+
reject(error);
|
|
1502
|
+
}
|
|
1503
|
+
else {
|
|
1504
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1505
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
1506
|
+
reject(new Error(body.error || errString));
|
|
1507
|
+
}
|
|
1508
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1509
|
+
resolve(body);
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
reject(errString);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
});
|
|
1516
|
+
});
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1281
1519
|
/**
|
|
1282
1520
|
* Admin-only API to set a feature flag ON. Setting a feature flag ON essentially enables the feature for all users.
|
|
1283
1521
|
* @summary Set a feature flag ON
|
|
@@ -1911,7 +2149,7 @@ class AdminApi {
|
|
|
1911
2149
|
* Get the job execution details including inner jobs
|
|
1912
2150
|
* @summary Get job execution details
|
|
1913
2151
|
* @param jobId Job ID
|
|
1914
|
-
* @param parentType Job parent type (project or
|
|
2152
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
1915
2153
|
* @param includeChildrenJobs Include the details of each of the children jobs (recursively)
|
|
1916
2154
|
*/
|
|
1917
2155
|
async adminGetJobDetails(jobId, queryParams, options = { headers: {} }) {
|
|
@@ -1996,7 +2234,7 @@ class AdminApi {
|
|
|
1996
2234
|
* Get the logs for a job.
|
|
1997
2235
|
* @summary Get job logs
|
|
1998
2236
|
* @param jobId Job ID
|
|
1999
|
-
* @param parentType Job parent type (project or
|
|
2237
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
2000
2238
|
* @param limit Maximum number of logs
|
|
2001
2239
|
* @param offset Start fetching logs from this offset
|
|
2002
2240
|
*/
|
|
@@ -2093,7 +2331,7 @@ class AdminApi {
|
|
|
2093
2331
|
* Get cpu/memory usage metrics, if the job is a Kubernetes job
|
|
2094
2332
|
* @summary Get job usage metrics
|
|
2095
2333
|
* @param jobId Job ID
|
|
2096
|
-
* @param parentType Job parent type (project or
|
|
2334
|
+
* @param parentType Job parent type (project, organization, or standalone)
|
|
2097
2335
|
*/
|
|
2098
2336
|
async adminGetJobsMetrics(jobId, queryParams, options = { headers: {} }) {
|
|
2099
2337
|
const localVarPath = this.basePath + '/api/admin/jobs/{jobId}/metrics'
|
|
@@ -2399,6 +2637,166 @@ class AdminApi {
|
|
|
2399
2637
|
});
|
|
2400
2638
|
});
|
|
2401
2639
|
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Admin-only API to get a usage report for an organization.
|
|
2642
|
+
* @summary Get usage report
|
|
2643
|
+
* @param organizationId Organization ID
|
|
2644
|
+
* @param usageReportId Usage report ID
|
|
2645
|
+
*/
|
|
2646
|
+
async adminGetOrganizationUsageReport(organizationId, usageReportId, options = { headers: {} }) {
|
|
2647
|
+
const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/usage/reports/{usageReportId}'
|
|
2648
|
+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
2649
|
+
.replace('{' + 'usageReportId' + '}', encodeURIComponent(String(usageReportId)));
|
|
2650
|
+
let localVarQueryParameters = {};
|
|
2651
|
+
let localVarHeaderParams = Object.assign({
|
|
2652
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2653
|
+
}, this.defaultHeaders);
|
|
2654
|
+
const produces = ['application/json'];
|
|
2655
|
+
// give precedence to 'application/json'
|
|
2656
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2657
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2658
|
+
}
|
|
2659
|
+
else {
|
|
2660
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2661
|
+
}
|
|
2662
|
+
let localVarFormParams = {};
|
|
2663
|
+
// verify required parameter 'organizationId' is not null or undefined
|
|
2664
|
+
if (organizationId === null || organizationId === undefined) {
|
|
2665
|
+
throw new Error('Required parameter organizationId was null or undefined when calling adminGetOrganizationUsageReport.');
|
|
2666
|
+
}
|
|
2667
|
+
// verify required parameter 'usageReportId' is not null or undefined
|
|
2668
|
+
if (usageReportId === null || usageReportId === undefined) {
|
|
2669
|
+
throw new Error('Required parameter usageReportId was null or undefined when calling adminGetOrganizationUsageReport.');
|
|
2670
|
+
}
|
|
2671
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
2672
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
2673
|
+
let localVarUseFormData = false;
|
|
2674
|
+
let localVarRequestOptions = {
|
|
2675
|
+
method: 'GET',
|
|
2676
|
+
qs: localVarQueryParameters,
|
|
2677
|
+
headers: localVarHeaderParams,
|
|
2678
|
+
uri: localVarPath,
|
|
2679
|
+
useQuerystring: this._useQuerystring,
|
|
2680
|
+
agentOptions: { keepAlive: false },
|
|
2681
|
+
json: true,
|
|
2682
|
+
};
|
|
2683
|
+
let authenticationPromise = Promise.resolve();
|
|
2684
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
2685
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
2686
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
2687
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2688
|
+
return authenticationPromise.then(() => {
|
|
2689
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2690
|
+
if (localVarUseFormData) {
|
|
2691
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
2692
|
+
}
|
|
2693
|
+
else {
|
|
2694
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
return new Promise((resolve, reject) => {
|
|
2698
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2699
|
+
if (error) {
|
|
2700
|
+
reject(error);
|
|
2701
|
+
}
|
|
2702
|
+
else {
|
|
2703
|
+
body = models_1.ObjectSerializer.deserialize(body, "AdminGetOrganizationUsageReportResponse");
|
|
2704
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2705
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
2706
|
+
reject(new Error(body.error || errString));
|
|
2707
|
+
}
|
|
2708
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2709
|
+
resolve(body);
|
|
2710
|
+
}
|
|
2711
|
+
else {
|
|
2712
|
+
reject(errString);
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
});
|
|
2716
|
+
});
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
/**
|
|
2720
|
+
* Admin-only API to get all usage reports for an organization.
|
|
2721
|
+
* @summary Get all usage reports
|
|
2722
|
+
* @param organizationId Organization ID
|
|
2723
|
+
* @param limit Maximum number of results
|
|
2724
|
+
* @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
|
|
2725
|
+
*/
|
|
2726
|
+
async adminGetOrganizationUsageReports(organizationId, queryParams, options = { headers: {} }) {
|
|
2727
|
+
const localVarPath = this.basePath + '/api/admin/organizations/{organizationId}/usage/reports'
|
|
2728
|
+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
2729
|
+
let localVarQueryParameters = {};
|
|
2730
|
+
let localVarHeaderParams = Object.assign({
|
|
2731
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2732
|
+
}, this.defaultHeaders);
|
|
2733
|
+
const produces = ['application/json'];
|
|
2734
|
+
// give precedence to 'application/json'
|
|
2735
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2736
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2737
|
+
}
|
|
2738
|
+
else {
|
|
2739
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2740
|
+
}
|
|
2741
|
+
let localVarFormParams = {};
|
|
2742
|
+
// verify required parameter 'organizationId' is not null or undefined
|
|
2743
|
+
if (organizationId === null || organizationId === undefined) {
|
|
2744
|
+
throw new Error('Required parameter organizationId was null or undefined when calling adminGetOrganizationUsageReports.');
|
|
2745
|
+
}
|
|
2746
|
+
if (queryParams.limit !== undefined) {
|
|
2747
|
+
localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
|
|
2748
|
+
}
|
|
2749
|
+
if (queryParams.offset !== undefined) {
|
|
2750
|
+
localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
|
|
2751
|
+
}
|
|
2752
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
2753
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
2754
|
+
let localVarUseFormData = false;
|
|
2755
|
+
let localVarRequestOptions = {
|
|
2756
|
+
method: 'GET',
|
|
2757
|
+
qs: localVarQueryParameters,
|
|
2758
|
+
headers: localVarHeaderParams,
|
|
2759
|
+
uri: localVarPath,
|
|
2760
|
+
useQuerystring: this._useQuerystring,
|
|
2761
|
+
agentOptions: { keepAlive: false },
|
|
2762
|
+
json: true,
|
|
2763
|
+
};
|
|
2764
|
+
let authenticationPromise = Promise.resolve();
|
|
2765
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
2766
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
2767
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
2768
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
2769
|
+
return authenticationPromise.then(() => {
|
|
2770
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2771
|
+
if (localVarUseFormData) {
|
|
2772
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
2773
|
+
}
|
|
2774
|
+
else {
|
|
2775
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
return new Promise((resolve, reject) => {
|
|
2779
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
2780
|
+
if (error) {
|
|
2781
|
+
reject(error);
|
|
2782
|
+
}
|
|
2783
|
+
else {
|
|
2784
|
+
body = models_1.ObjectSerializer.deserialize(body, "AdminGetOrganizationUsageReportsResponse");
|
|
2785
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2786
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
2787
|
+
reject(new Error(body.error || errString));
|
|
2788
|
+
}
|
|
2789
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2790
|
+
resolve(body);
|
|
2791
|
+
}
|
|
2792
|
+
else {
|
|
2793
|
+
reject(errString);
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
});
|
|
2797
|
+
});
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2402
2800
|
/**
|
|
2403
2801
|
* Admin-only API to get the list of all organizations.
|
|
2404
2802
|
* @summary Get all organizations
|