edge-impulse-api 1.83.2 → 1.83.4

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.
@@ -47,6 +47,7 @@ import { RawDataCategory } from '../model/rawDataCategory';
47
47
  import { RebalanceDatasetResponse } from '../model/rebalanceDatasetResponse';
48
48
  import { RenameSampleRequest } from '../model/renameSampleRequest';
49
49
  import { SampleBoundingBoxesRequest } from '../model/sampleBoundingBoxesRequest';
50
+ import { SampleLabelMapRequest } from '../model/sampleLabelMapRequest';
50
51
  import { SegmentSampleRequest } from '../model/segmentSampleRequest';
51
52
  import { SetSampleMetadataRequest } from '../model/setSampleMetadataRequest';
52
53
  import { SetSampleProposedChangesRequest } from '../model/setSampleProposedChangesRequest';
@@ -1253,6 +1254,18 @@ export declare class RawDataApi {
1253
1254
  [name: string]: string;
1254
1255
  };
1255
1256
  }): Promise<GenericApiResponse>;
1257
+ /**
1258
+ * Update key/value labels for a sample. This is experimental and may change in the future.
1259
+ * @summary Set sample label map labels
1260
+ * @param projectId Project ID
1261
+ * @param sampleId Sample ID
1262
+ * @param sampleLabelMapRequest
1263
+ */
1264
+ setSampleLabelMap(projectId: number, sampleId: number, sampleLabelMapRequest: SampleLabelMapRequest, options?: {
1265
+ headers: {
1266
+ [name: string]: string;
1267
+ };
1268
+ }): Promise<GenericApiResponse>;
1256
1269
  /**
1257
1270
  * Adds or updates the metadata associated to a sample.
1258
1271
  * @summary Set sample metadata
@@ -5428,6 +5428,91 @@ class RawDataApi {
5428
5428
  const response = await fetch(url, requestOptions);
5429
5429
  return this.handleResponse(response, 'GenericApiResponse');
5430
5430
  }
5431
+ /**
5432
+ * Update key/value labels for a sample. This is experimental and may change in the future.
5433
+ * @summary Set sample label map labels
5434
+ * @param projectId Project ID
5435
+ * @param sampleId Sample ID
5436
+ * @param sampleLabelMapRequest
5437
+ */
5438
+ async setSampleLabelMap(projectId, sampleId, sampleLabelMapRequest, options = { headers: {} }) {
5439
+ const localVarPath = this.basePath + '/api/{projectId}/raw-data/{sampleId}/label-map-labels'
5440
+ .replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
5441
+ .replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
5442
+ let localVarQueryParameters = {};
5443
+ let localVarHeaderParams = {
5444
+ 'User-Agent': 'edgeimpulse-api nodejs',
5445
+ 'Content-Type': 'application/json',
5446
+ ...this.defaultHeaders,
5447
+ };
5448
+ const produces = ['application/json'];
5449
+ // give precedence to 'application/json'
5450
+ if (produces.indexOf('application/json') >= 0) {
5451
+ localVarHeaderParams.Accept = 'application/json';
5452
+ }
5453
+ else {
5454
+ localVarHeaderParams.Accept = produces.join(',');
5455
+ }
5456
+ let localVarFormParams;
5457
+ // verify required parameter 'projectId' is not null or undefined
5458
+ if (projectId === null || projectId === undefined) {
5459
+ throw new Error('Required parameter projectId was null or undefined when calling setSampleLabelMap.');
5460
+ }
5461
+ // verify required parameter 'sampleId' is not null or undefined
5462
+ if (sampleId === null || sampleId === undefined) {
5463
+ throw new Error('Required parameter sampleId was null or undefined when calling setSampleLabelMap.');
5464
+ }
5465
+ // verify required parameter 'sampleLabelMapRequest' is not null or undefined
5466
+ if (sampleLabelMapRequest === null || sampleLabelMapRequest === undefined) {
5467
+ throw new Error('Required parameter sampleLabelMapRequest was null or undefined when calling setSampleLabelMap.');
5468
+ }
5469
+ localVarHeaderParams = {
5470
+ ...localVarHeaderParams,
5471
+ ...options.headers,
5472
+ ...this.opts.extraHeaders,
5473
+ };
5474
+ const queryString = Object.entries(localVarQueryParameters)
5475
+ .filter(([, value]) => value !== undefined)
5476
+ .map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
5477
+ .join('&');
5478
+ let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
5479
+ let localVarRequestOptions = {
5480
+ method: 'POST',
5481
+ headers: { ...localVarHeaderParams },
5482
+ };
5483
+ localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(sampleLabelMapRequest, "SampleLabelMapRequest"));
5484
+ let requestOptions = localVarRequestOptions;
5485
+ let url = localVarUrl;
5486
+ const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
5487
+ requestOptions = auth_ApiKeyAuthentication.requestOptions;
5488
+ url = auth_ApiKeyAuthentication.url;
5489
+ const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
5490
+ requestOptions = auth_JWTAuthentication.requestOptions;
5491
+ url = auth_JWTAuthentication.url;
5492
+ const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
5493
+ requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
5494
+ url = auth_JWTHttpHeaderAuthentication.url;
5495
+ const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
5496
+ requestOptions = auth_OAuth2.requestOptions;
5497
+ url = auth_OAuth2.url;
5498
+ const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
5499
+ requestOptions = authDefault.requestOptions;
5500
+ url = authDefault.url;
5501
+ if (localVarFormParams) {
5502
+ delete requestOptions.headers['Content-Type'];
5503
+ if (localVarFormParams instanceof FormData) {
5504
+ // FormData: fetch will handle Content-Type automatically.
5505
+ requestOptions.body = localVarFormParams;
5506
+ }
5507
+ else if (Object.keys(localVarFormParams).length > 0) {
5508
+ // URL-encoded form
5509
+ requestOptions.body = new URLSearchParams(localVarFormParams).toString();
5510
+ requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
5511
+ }
5512
+ }
5513
+ const response = await fetch(url, requestOptions);
5514
+ return this.handleResponse(response, 'GenericApiResponse');
5515
+ }
5431
5516
  /**
5432
5517
  * Adds or updates the metadata associated to a sample.
5433
5518
  * @summary Set sample metadata