import { SdkClient } from "../common/sdk-client" ; import { SpectrumAnalysisModels } from "./spectrum-analysis-models" ; import { spectralAnalysisTemplate } from "./spectrum-analysis-template" ; export class extends SdkClient export class SpectrumAnalysisClient extends SdkClient { private _baseUrl = "/api/spectrumanalysis/v3" ; param { Buffer } file param { SpectrumAnalysisModels . WindowType . WindowTypeEnum } windowType param { { filename ? : string ; mimetype ? : string } } params returns { Promise < SpectrumAnalysisModels . FFTOutput > } memberOf public async CalculateFrequencies ( file , windowType ? , params ? ) { const selectedWindowType = windowType || SpectrumAnalysisModels . WindowType . WindowTypeEnum . FLATTOP ; const parameters = params || { } ; const { filename , mimetype } = parameters ; const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/calculateFrequencies` , body : spectralAnalysisTemplate ( file , filename , selectedWindowType . toString ( ) , mimetype ) , multiPartFormData : true } ) ; return result as SpectrumAnalysisModels . FFTOutput ; } param { SpectrumAnalysisModels . ThresholdViolationInput } data returns { Promise < SpectrumAnalysisModels . ThresholdViolationOutput > } memberOf public async DetectThresholdViolations ( data ) { const result = await this . HttpAction ( { verb : "POST" , gateway : this . GetGateway ( ) , authorization : await this . GetToken ( ) , baseUrl : `${ this . _baseUrl }/detectThresholdViolations` , body : data } ) ; return result as SpectrumAnalysisModels . ThresholdViolationOutput ; } }