createLoggerDefinitionVersion method
Creates a version of a logger definition that has already been defined.
May throw BadRequestException.
Parameter loggerDefinitionId
:
The ID of the logger definition.
Parameter amznClientToken
:
A client token used to correlate requests and responses.
Parameter loggers
:
A list of loggers.
Implementation
Future<CreateLoggerDefinitionVersionResponse> createLoggerDefinitionVersion({
required String loggerDefinitionId,
String? amznClientToken,
List<Logger>? loggers,
}) async {
ArgumentError.checkNotNull(loggerDefinitionId, 'loggerDefinitionId');
final headers = <String, String>{
if (amznClientToken != null)
'X-Amzn-Client-Token': amznClientToken.toString(),
};
final $payload = <String, dynamic>{
if (loggers != null) 'Loggers': loggers,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/greengrass/definition/loggers/${Uri.encodeComponent(loggerDefinitionId)}/versions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateLoggerDefinitionVersionResponse.fromJson(response);
}