addConnectionWithHttpInfo method

Future<Response> addConnectionWithHttpInfo(
  1. AddConnectionRequest addConnectionRequest, {
  2. required String uuidToken,
})

Creates a new connection

Creates a new connection and returns the associated id. Requires either AddConnectionS7 or AddConnectionModbus or AddConnectionOPCUA object as request body. The connection could be potentially deleted after a certain timeout of inactivity. When an Internal Server Error occours, an Error object will be returned.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> addConnectionWithHttpInfo(
  AddConnectionRequest addConnectionRequest, {
  required String uuidToken,
}) async {
  // ignore: prefer_const_declarations

  final path = '${LbWriterEnvironment.getApiEndpoint(
    iotUuid: uuidToken,
  )}/connection/';

  // ignore: prefer_final_locals
  Object? postBody = addConnectionRequest;

  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,
  );
}