createFunctionDefinition method
Creates a Lambda function definition which contains a list of Lambda functions and their configurations to be used in a group. You can create an initial version of the definition by providing a list of Lambda functions and their configurations now, or use ''CreateFunctionDefinitionVersion'' later.
May throw BadRequestException.
Parameter amznClientToken
:
A client token used to correlate requests and responses.
Parameter initialVersion
:
Information about the initial version of the function definition.
Parameter name
:
The name of the function definition.
Parameter tags
:
Tag(s) to add to the new resource.
Implementation
Future<CreateFunctionDefinitionResponse> createFunctionDefinition({
String? amznClientToken,
FunctionDefinitionVersion? initialVersion,
String? name,
Map<String, String>? tags,
}) async {
final headers = <String, String>{
if (amznClientToken != null)
'X-Amzn-Client-Token': amznClientToken.toString(),
};
final $payload = <String, dynamic>{
if (initialVersion != null) 'InitialVersion': initialVersion,
if (name != null) 'Name': name,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/greengrass/definition/functions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateFunctionDefinitionResponse.fromJson(response);
}