createFunctionDefinitionVersion method
Future<CreateFunctionDefinitionVersionResponse>
createFunctionDefinitionVersion({
- required String functionDefinitionId,
- String? amznClientToken,
- FunctionDefaultConfig? defaultConfig,
- List<
$Function> ? functions,
Creates a version of a Lambda function definition that has already been defined.
May throw BadRequestException.
Parameter functionDefinitionId
:
The ID of the Lambda function definition.
Parameter amznClientToken
:
A client token used to correlate requests and responses.
Parameter defaultConfig
:
The default configuration that applies to all Lambda functions in this
function definition version. Individual Lambda functions can override
these settings.
Parameter functions
:
A list of Lambda functions in this function definition version.
Implementation
Future<CreateFunctionDefinitionVersionResponse>
createFunctionDefinitionVersion({
required String functionDefinitionId,
String? amznClientToken,
FunctionDefaultConfig? defaultConfig,
List<$Function>? functions,
}) async {
ArgumentError.checkNotNull(functionDefinitionId, 'functionDefinitionId');
final headers = <String, String>{
if (amznClientToken != null)
'X-Amzn-Client-Token': amznClientToken.toString(),
};
final $payload = <String, dynamic>{
if (defaultConfig != null) 'DefaultConfig': defaultConfig,
if (functions != null) 'Functions': functions,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/greengrass/definition/functions/${Uri.encodeComponent(functionDefinitionId)}/versions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateFunctionDefinitionVersionResponse.fromJson(response);
}