From bbcfd69a3d7a33afe89be976cd1e728e98288706 Mon Sep 17 00:00:00 2001 From: kylebouchard Date: Tue, 13 Feb 2024 23:12:13 -0500 Subject: [PATCH] Fix --- api/actuators.service.ts | 12 +++--- api/sensors.service.ts | 92 ++++++++++++++++++++++++++++++++++++---- model/sensor.ts | 4 ++ 3 files changed, 93 insertions(+), 15 deletions(-) diff --git a/api/actuators.service.ts b/api/actuators.service.ts index 3b6b201..47fed24 100644 --- a/api/actuators.service.ts +++ b/api/actuators.service.ts @@ -158,17 +158,17 @@ export class ActuatorsService { } /** - * Put Actuators + * Update Actuators * @param actuator * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public putActuators(actuator: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public putActuators(actuator: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public putActuators(actuator: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public putActuators(actuator: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public updateActuators(actuator: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateActuators(actuator: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateActuators(actuator: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateActuators(actuator: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (actuator === null || actuator === undefined) { - throw new Error('Required parameter actuator was null or undefined when calling putActuators.'); + throw new Error('Required parameter actuator was null or undefined when calling updateActuators.'); } let localVarHeaders = this.defaultHeaders; diff --git a/api/sensors.service.ts b/api/sensors.service.ts index 96b49cc..4fdf5f6 100644 --- a/api/sensors.service.ts +++ b/api/sensors.service.ts @@ -236,25 +236,25 @@ export class SensorsService { /** * Sensors - * @param sensorType * @param prototypeId + * @param sensorType * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public sensors(sensorType?: string, prototypeId?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public sensors(sensorType?: string, prototypeId?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public sensors(sensorType?: string, prototypeId?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public sensors(sensorType?: string, prototypeId?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public sensors(prototypeId?: number, sensorType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public sensors(prototypeId?: number, sensorType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public sensors(prototypeId?: number, sensorType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public sensors(prototypeId?: number, sensorType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (sensorType !== undefined && sensorType !== null) { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sensorType, 'sensor_type'); - } if (prototypeId !== undefined && prototypeId !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, prototypeId, 'prototype_id'); } + if (sensorType !== undefined && sensorType !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sensorType, 'sensor_type'); + } let localVarHeaders = this.defaultHeaders; @@ -307,4 +307,78 @@ export class SensorsService { ); } + /** + * Update Sensors + * @param sensor + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateSensors(sensor: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateSensors(sensor: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateSensors(sensor: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateSensors(sensor: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (sensor === null || sensor === undefined) { + throw new Error('Required parameter sensor was null or undefined when calling updateSensors.'); + } + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + let localVarTransferCache: boolean | undefined = options && options.transferCache; + if (localVarTransferCache === undefined) { + localVarTransferCache = true; + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/sensors`; + return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: sensor, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + transferCache: localVarTransferCache, + reportProgress: reportProgress + } + ); + } + } diff --git a/model/sensor.ts b/model/sensor.ts index f512b18..96aac0b 100644 --- a/model/sensor.ts +++ b/model/sensor.ts @@ -16,6 +16,10 @@ export interface Sensor { sensor_type: SensorType; prototype_id: number; sensor_id: number; + threshold_critically_low: number; + threshold_low: number; + threshold_high: number; + threshold_critically_high: number; } export namespace Sensor { }