@@ -30,6 +30,7 @@ import { ListHmacKeysResponse } from '../model/listHmacKeysResponse';
3030import { ListProjectsResponse } from '../model/listProjectsResponse' ;
3131import { ListVersionsResponse } from '../model/listVersionsResponse' ;
3232import { ProjectDataAxesSummaryResponse } from '../model/projectDataAxesSummaryResponse' ;
33+ import { ProjectDataIntervalResponse } from '../model/projectDataIntervalResponse' ;
3334import { ProjectDownloadsResponse } from '../model/projectDownloadsResponse' ;
3435import { ProjectInfoResponse } from '../model/projectInfoResponse' ;
3536import { RemoveCollaboratorRequest } from '../model/removeCollaboratorRequest' ;
@@ -839,6 +840,76 @@ export class ProjectsApi {
839840 } ) ;
840841 } ) ;
841842 }
843+ /**
844+ * Get the interval of the training data; if multiple intervals are present, the interval of the longest data item is returned.
845+ * @summary Get the interval (in ms) of the training data
846+ * @param projectId Project ID
847+ */
848+ public async getProjectRecommendedDataInterval ( projectId : number , options : { headers : { [ name : string ] : string } } = { headers : { } } ) : Promise < { response : http . IncomingMessage ; body : ProjectDataIntervalResponse ; } > {
849+ const localVarPath = this . basePath + '/api/{projectId}/data-interval'
850+ . replace ( '{' + 'projectId' + '}' , encodeURIComponent ( String ( projectId ) ) ) ;
851+ let localVarQueryParameters : any = { } ;
852+ let localVarHeaderParams : any = ( < any > Object ) . assign ( { } , this . defaultHeaders ) ;
853+ const produces = [ 'application/json' ] ;
854+ // give precedence to 'application/json'
855+ if ( produces . indexOf ( 'application/json' ) >= 0 ) {
856+ localVarHeaderParams . Accept = 'application/json' ;
857+ } else {
858+ localVarHeaderParams . Accept = produces . join ( ',' ) ;
859+ }
860+ let localVarFormParams : any = { } ;
861+
862+ // verify required parameter 'projectId' is not null or undefined
863+ if ( projectId === null || projectId === undefined ) {
864+ throw new Error ( 'Required parameter projectId was null or undefined when calling getProjectRecommendedDataInterval.' ) ;
865+ }
866+
867+ ( < any > Object ) . assign ( localVarHeaderParams , options . headers ) ;
868+
869+ let localVarUseFormData = false ;
870+
871+ let localVarRequestOptions : localVarRequest . Options = {
872+ method : 'GET' ,
873+ qs : localVarQueryParameters ,
874+ headers : localVarHeaderParams ,
875+ uri : localVarPath ,
876+ useQuerystring : this . _useQuerystring ,
877+ agentOptions : ( process . env . EI_HOST && process . env . EI_HOST !== "edgeimpulse.com" ) ? { keepAlive : true } : undefined ,
878+ json : true ,
879+ } ;
880+
881+ let authenticationPromise = Promise . resolve ( ) ;
882+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . ApiKeyAuthentication . applyToRequest ( localVarRequestOptions ) ) ;
883+
884+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . JWTAuthentication . applyToRequest ( localVarRequestOptions ) ) ;
885+
886+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . JWTHttpHeaderAuthentication . applyToRequest ( localVarRequestOptions ) ) ;
887+
888+ authenticationPromise = authenticationPromise . then ( ( ) => this . authentications . default . applyToRequest ( localVarRequestOptions ) ) ;
889+ return authenticationPromise . then ( ( ) => {
890+ if ( Object . keys ( localVarFormParams ) . length ) {
891+ if ( localVarUseFormData ) {
892+ ( < any > localVarRequestOptions ) . formData = localVarFormParams ;
893+ } else {
894+ localVarRequestOptions . form = localVarFormParams ;
895+ }
896+ }
897+ return new Promise < { response : http . IncomingMessage ; body : ProjectDataIntervalResponse ; } > ( ( resolve , reject ) => {
898+ localVarRequest ( localVarRequestOptions , ( error , response , body ) => {
899+ if ( error ) {
900+ reject ( error ) ;
901+ } else {
902+ body = ObjectSerializer . deserialize ( body , "ProjectDataIntervalResponse" ) ;
903+ if ( response . statusCode && response . statusCode >= 200 && response . statusCode <= 299 ) {
904+ resolve ( { response : response , body : body } ) ;
905+ } else {
906+ reject ( new HttpError ( response , body , response . statusCode ) ) ;
907+ }
908+ }
909+ } ) ;
910+ } ) ;
911+ } ) ;
912+ }
842913 /**
843914 * Get a token to authenticate with the web socket interface.
844915 * @summary Get socket token
0 commit comments