Skip to content

Commit e63d3e1

Browse files
Release v1.25.1
1 parent 9388b83 commit e63d3e1

6 files changed

Lines changed: 255 additions & 1 deletion

sdk/studio/sdk/api/organizationCreateProjectApi.ts

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ else {
2525
FormData = undici.FormData;
2626
}
2727

28+
import { CreateCustomBlockUploadLinkRequest } from '../model/createCustomBlockUploadLinkRequest';
29+
import { CreateCustomBlockUploadLinkResponse } from '../model/createCustomBlockUploadLinkResponse';
2830
import { CreateProjectResponse } from '../model/createProjectResponse';
31+
import { FinalizeCustomBlockUploadRequest } from '../model/finalizeCustomBlockUploadRequest';
2932
import { GenericApiResponse } from '../model/genericApiResponse';
3033
import { OrganizationCreateProjectRequest } from '../model/organizationCreateProjectRequest';
3134
import { OrganizationCreateProjectResponse } from '../model/organizationCreateProjectResponse';
@@ -243,6 +246,95 @@ export class OrganizationCreateProjectApi {
243246
);
244247
}
245248

249+
/**
250+
* Creates a signed link to securely upload a custom block archive directly to S3.
251+
* @summary Create pre-signed S3 upload link for a custom block archive
252+
* @param organizationId Organization ID
253+
* @param createCustomBlockUploadLinkRequest
254+
*/
255+
public async createCustomBlockUploadLink (organizationId: number, createCustomBlockUploadLinkRequest: CreateCustomBlockUploadLinkRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<CreateCustomBlockUploadLinkResponse> {
256+
const localVarPath = this.basePath + '/api/organizations/{organizationId}/custom-block/upload-link'
257+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
258+
let queryParameters: Record<string, string> = {};
259+
let localVarHeaderParams: Record<string, string> = {
260+
'User-Agent': 'edgeimpulse-api nodejs',
261+
'Content-Type': 'application/json',
262+
...this.defaultHeaders,
263+
};
264+
const produces = ['application/json'];
265+
// give precedence to 'application/json'
266+
if (produces.indexOf('application/json') >= 0) {
267+
localVarHeaderParams.Accept = 'application/json';
268+
} else {
269+
localVarHeaderParams.Accept = produces.join(',');
270+
}
271+
let localVarFormParams: LocalFormParams | undefined;
272+
273+
// verify required parameter 'organizationId' is not null or undefined
274+
275+
276+
if (organizationId === null || organizationId === undefined) {
277+
throw new Error('Required parameter organizationId was null or undefined when calling createCustomBlockUploadLink.');
278+
}
279+
280+
// verify required parameter 'createCustomBlockUploadLinkRequest' is not null or undefined
281+
282+
283+
if (createCustomBlockUploadLinkRequest === null || createCustomBlockUploadLinkRequest === undefined) {
284+
throw new Error('Required parameter createCustomBlockUploadLinkRequest was null or undefined when calling createCustomBlockUploadLink.');
285+
}
286+
287+
localVarHeaderParams = {
288+
...localVarHeaderParams,
289+
...options.headers,
290+
...this.opts.extraHeaders,
291+
};
292+
293+
const queryString = Object.entries(queryParameters)
294+
.filter(([, value]) => value !== undefined)
295+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
296+
.join('&');
297+
298+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
299+
let localVarRequestOptions: RequestOptionsType = {
300+
method: 'POST',
301+
headers: { ...localVarHeaderParams },
302+
};
303+
304+
localVarRequestOptions.body = JSON.stringify(createCustomBlockUploadLinkRequest);
305+
306+
307+
let requestOptions = localVarRequestOptions;
308+
let url = localVarUrl;
309+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
310+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
311+
url = auth_ApiKeyAuthentication.url;
312+
313+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
314+
requestOptions = auth_JWTAuthentication.requestOptions;
315+
url = auth_JWTAuthentication.url;
316+
317+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
318+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
319+
url = auth_JWTHttpHeaderAuthentication.url;
320+
321+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
322+
requestOptions = auth_OAuth2.requestOptions;
323+
url = auth_OAuth2.url;
324+
325+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
326+
requestOptions = authDefault.requestOptions;
327+
url = authDefault.url;
328+
329+
applyFormParams(requestOptions, localVarFormParams);
330+
331+
const response = await fetch(url, requestOptions);
332+
return this.handleResponse(
333+
response,
334+
'CreateCustomBlockUploadLinkResponse'
335+
);
336+
}
337+
246338
/**
247339
* Remove a transformation job. This will stop all running jobs.
248340
* @summary Delete transformation job
@@ -428,6 +520,95 @@ export class OrganizationCreateProjectApi {
428520
);
429521
}
430522

523+
/**
524+
* Verifies a staged custom block archive and starts a custom block build job.
525+
* @summary Finalize custom block upload
526+
* @param organizationId Organization ID
527+
* @param finalizeCustomBlockUploadRequest
528+
*/
529+
public async finalizeCustomBlockUpload (organizationId: number, finalizeCustomBlockUploadRequest: FinalizeCustomBlockUploadRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<StartJobResponse> {
530+
const localVarPath = this.basePath + '/api/organizations/{organizationId}/custom-block/finalize'
531+
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
532+
let queryParameters: Record<string, string> = {};
533+
let localVarHeaderParams: Record<string, string> = {
534+
'User-Agent': 'edgeimpulse-api nodejs',
535+
'Content-Type': 'application/json',
536+
...this.defaultHeaders,
537+
};
538+
const produces = ['application/json'];
539+
// give precedence to 'application/json'
540+
if (produces.indexOf('application/json') >= 0) {
541+
localVarHeaderParams.Accept = 'application/json';
542+
} else {
543+
localVarHeaderParams.Accept = produces.join(',');
544+
}
545+
let localVarFormParams: LocalFormParams | undefined;
546+
547+
// verify required parameter 'organizationId' is not null or undefined
548+
549+
550+
if (organizationId === null || organizationId === undefined) {
551+
throw new Error('Required parameter organizationId was null or undefined when calling finalizeCustomBlockUpload.');
552+
}
553+
554+
// verify required parameter 'finalizeCustomBlockUploadRequest' is not null or undefined
555+
556+
557+
if (finalizeCustomBlockUploadRequest === null || finalizeCustomBlockUploadRequest === undefined) {
558+
throw new Error('Required parameter finalizeCustomBlockUploadRequest was null or undefined when calling finalizeCustomBlockUpload.');
559+
}
560+
561+
localVarHeaderParams = {
562+
...localVarHeaderParams,
563+
...options.headers,
564+
...this.opts.extraHeaders,
565+
};
566+
567+
const queryString = Object.entries(queryParameters)
568+
.filter(([, value]) => value !== undefined)
569+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
570+
.join('&');
571+
572+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
573+
let localVarRequestOptions: RequestOptionsType = {
574+
method: 'POST',
575+
headers: { ...localVarHeaderParams },
576+
};
577+
578+
localVarRequestOptions.body = JSON.stringify(finalizeCustomBlockUploadRequest);
579+
580+
581+
let requestOptions = localVarRequestOptions;
582+
let url = localVarUrl;
583+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
584+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
585+
url = auth_ApiKeyAuthentication.url;
586+
587+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
588+
requestOptions = auth_JWTAuthentication.requestOptions;
589+
url = auth_JWTAuthentication.url;
590+
591+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
592+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
593+
url = auth_JWTHttpHeaderAuthentication.url;
594+
595+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
596+
requestOptions = auth_OAuth2.requestOptions;
597+
url = auth_OAuth2.url;
598+
599+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
600+
requestOptions = authDefault.requestOptions;
601+
url = authDefault.url;
602+
603+
applyFormParams(requestOptions, localVarFormParams);
604+
605+
const response = await fetch(url, requestOptions);
606+
return this.handleResponse(
607+
response,
608+
'StartJobResponse'
609+
);
610+
}
611+
431612
/**
432613
* Get the current status of a transformation job job.
433614
* @summary Get transformation job status

sdk/studio/sdk/api/rawDataApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6255,7 +6255,7 @@ export class RawDataApi {
62556255
}
62566256

62576257
/**
6258-
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data. Returns immediately on small datasets, or starts a job on larger datasets. To get the dataset ratio (as returned by the v1 endpoint), use getDatasetRatio.
6258+
* Rebalances the dataset over training / testing categories. This resets the category for all data and splits it 80%/20% between training and testing. This is a deterministic process based on the hash of the name of the data. Returns immediately on small datasets, or starts a job on larger datasets. To get the dataset ratio (as returned by the v1 endpoint), use getDatasetRatio. For richer, more powerful dataset splitting with configurable ratios, stratification, and grouping, use splitDataset (`/v1/api/{projectId}/split`).
62596259
* @summary Rebalance dataset
62606260
* @param projectId Project ID
62616261
*/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Generated by studio/openapi/generate-models/convert.ts
2+
3+
export type CreateCustomBlockUploadLinkRequest = {
4+
/**
5+
* file name
6+
*/
7+
fileName: string;
8+
/**
9+
* file size in bytes
10+
*/
11+
fileSize: number;
12+
/**
13+
* hash to identify file changes
14+
*/
15+
fileHash: string;
16+
type: CreateCustomBlockUploadLinkRequestTypeEnum;
17+
blockId: number;
18+
};
19+
20+
export type CreateCustomBlockUploadLinkRequestTypeEnum = 'transform' | 'deploy' | 'dsp' | 'transferLearning';
21+
export const CreateCustomBlockUploadLinkRequestTypeEnumValues: string[] = [ 'transform', 'deploy', 'dsp', 'transferLearning' ];
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Generated by studio/openapi/generate-models/convert.ts
2+
3+
export type CreateCustomBlockUploadLinkResponse = {
4+
/**
5+
* Whether the operation succeeded
6+
*/
7+
success: boolean;
8+
/**
9+
* Optional error description (set if 'success' was false)
10+
*/
11+
error?: string;
12+
/**
13+
* S3 Upload Link
14+
*/
15+
url?: string;
16+
/**
17+
* S3 File Tag
18+
*/
19+
ETag?: string;
20+
/**
21+
* S3 object key for the staged upload
22+
*/
23+
uploadKey: string;
24+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Generated by studio/openapi/generate-models/convert.ts
2+
3+
export type FinalizeCustomBlockUploadRequest = {
4+
/**
5+
* S3 object key for the staged upload
6+
*/
7+
uploadKey: string;
8+
/**
9+
* file name
10+
*/
11+
fileName: string;
12+
/**
13+
* file size in bytes
14+
*/
15+
fileSize: number;
16+
/**
17+
* hash to identify file changes
18+
*/
19+
fileHash: string;
20+
type: FinalizeCustomBlockUploadRequestTypeEnum;
21+
blockId: number;
22+
};
23+
24+
export type FinalizeCustomBlockUploadRequestTypeEnum = 'transform' | 'deploy' | 'dsp' | 'transferLearning';
25+
export const FinalizeCustomBlockUploadRequestTypeEnumValues: string[] = [ 'transform', 'deploy', 'dsp', 'transferLearning' ];

sdk/studio/sdk/model/models.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export * from './convertUserRequest';
135135
export * from './cosineSimilarityData';
136136
export * from './cosineSimilarityIssue';
137137
export * from './countSamplesResponse';
138+
export * from './createCustomBlockUploadLinkRequest';
139+
export * from './createCustomBlockUploadLinkResponse';
138140
export * from './createDeveloperProfileResponse';
139141
export * from './createDeviceRequest';
140142
export * from './createEnterpriseTrialResponse';
@@ -280,6 +282,7 @@ export * from './exportKerasBlockDataRequest';
280282
export * from './exportOriginalDataRequest';
281283
export * from './exportWavDataRequest';
282284
export * from './feature';
285+
export * from './finalizeCustomBlockUploadRequest';
283286
export * from './findSegmentSampleRequest';
284287
export * from './findSegmentSampleResponse';
285288
export * from './findSyntiantPosteriorRequest';

0 commit comments

Comments
 (0)