createConnectionFunction method

Future<CreateConnectionFunctionResult> createConnectionFunction({
  1. required Uint8List connectionFunctionCode,
  2. required FunctionConfig connectionFunctionConfig,
  3. required String name,
  4. Tags? tags,
})

Creates a connection function.

May throw AccessDenied. May throw EntityAlreadyExists. May throw EntityLimitExceeded. May throw EntitySizeLimitExceeded. May throw InvalidArgument. May throw InvalidTagging. May throw UnsupportedOperation.

Parameter connectionFunctionCode : The code for the connection function.

Parameter name : A name for the connection function.

Implementation

Future<CreateConnectionFunctionResult> createConnectionFunction({
  required Uint8List connectionFunctionCode,
  required FunctionConfig connectionFunctionConfig,
  required String name,
  Tags? tags,
}) async {
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2020-05-31/connection-function',
    payload: CreateConnectionFunctionRequest(
            connectionFunctionCode: connectionFunctionCode,
            connectionFunctionConfig: connectionFunctionConfig,
            name: name,
            tags: tags)
        .toXml('CreateConnectionFunctionRequest'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateConnectionFunctionResult(
    connectionFunctionSummary: ConnectionFunctionSummary.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}