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