testConnectionFunction method

Future<TestConnectionFunctionResult> testConnectionFunction({
  1. required Uint8List connectionObject,
  2. required String id,
  3. required String ifMatch,
  4. FunctionStage? stage,
})

Tests a connection function.

May throw EntityNotFound. May throw InvalidArgument. May throw InvalidIfMatchVersion. May throw PreconditionFailed. May throw TestFunctionFailed. May throw UnsupportedOperation.

Parameter connectionObject : The connection object.

Parameter id : The connection function ID.

Parameter ifMatch : The current version (ETag value) of the connection function.

Parameter stage : The connection function stage.

Implementation

Future<TestConnectionFunctionResult> testConnectionFunction({
  required Uint8List connectionObject,
  required String id,
  required String ifMatch,
  FunctionStage? stage,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri:
        '/2020-05-31/connection-function/${Uri.encodeComponent(id)}/test',
    headers: headers,
    payload: TestConnectionFunctionRequest(
            connectionObject: connectionObject,
            id: id,
            ifMatch: ifMatch,
            stage: stage)
        .toXml('TestConnectionFunctionRequest'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return TestConnectionFunctionResult(
    connectionFunctionTestResult: ConnectionFunctionTestResult.fromXml($elem),
  );
}