connectionWriteWithHttpInfo method

Future<Response> connectionWriteWithHttpInfo(
  1. String id,
  2. ConnectionWriteRequest connectionWriteRequest, {
  3. required String uuidToken,
})

Write one metric over the specified connection

Write one metric over the specified connection. Requires the associated metrics as an array of MetricS7, MetricModbus or MetricOPCUA objects and the corresponding values. Returns an array of written values as Value object or a Error if the writing went wrong. You should always ensure that the values were written correctly by reading them right after their writing. If an Internal Server Error occours, an Error object will be returned.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> connectionWriteWithHttpInfo(
  String id,
  ConnectionWriteRequest connectionWriteRequest, {
  required String uuidToken,
}) async {
  // ignore: prefer_const_declarations
  final path = '${LbWriterEnvironment.getApiEndpoint(
    iotUuid: uuidToken,
  )}/connection/$id/write';

  // ignore: prefer_final_locals
  Object? postBody = connectionWriteRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}