createGroupVersion method
- required String groupId,
- String? amznClientToken,
- String? connectorDefinitionVersionArn,
- String? coreDefinitionVersionArn,
- String? deviceDefinitionVersionArn,
- String? functionDefinitionVersionArn,
- String? loggerDefinitionVersionArn,
- String? resourceDefinitionVersionArn,
- String? subscriptionDefinitionVersionArn,
Creates a version of a group which has already been defined.
May throw BadRequestException.
Parameter groupId
:
The ID of the Greengrass group.
Parameter amznClientToken
:
A client token used to correlate requests and responses.
Parameter connectorDefinitionVersionArn
:
The ARN of the connector definition version for this group.
Parameter coreDefinitionVersionArn
:
The ARN of the core definition version for this group.
Parameter deviceDefinitionVersionArn
:
The ARN of the device definition version for this group.
Parameter functionDefinitionVersionArn
:
The ARN of the function definition version for this group.
Parameter loggerDefinitionVersionArn
:
The ARN of the logger definition version for this group.
Parameter resourceDefinitionVersionArn
:
The ARN of the resource definition version for this group.
Parameter subscriptionDefinitionVersionArn
:
The ARN of the subscription definition version for this group.
Implementation
Future<CreateGroupVersionResponse> createGroupVersion({
required String groupId,
String? amznClientToken,
String? connectorDefinitionVersionArn,
String? coreDefinitionVersionArn,
String? deviceDefinitionVersionArn,
String? functionDefinitionVersionArn,
String? loggerDefinitionVersionArn,
String? resourceDefinitionVersionArn,
String? subscriptionDefinitionVersionArn,
}) async {
ArgumentError.checkNotNull(groupId, 'groupId');
final headers = <String, String>{
if (amznClientToken != null)
'X-Amzn-Client-Token': amznClientToken.toString(),
};
final $payload = <String, dynamic>{
if (connectorDefinitionVersionArn != null)
'ConnectorDefinitionVersionArn': connectorDefinitionVersionArn,
if (coreDefinitionVersionArn != null)
'CoreDefinitionVersionArn': coreDefinitionVersionArn,
if (deviceDefinitionVersionArn != null)
'DeviceDefinitionVersionArn': deviceDefinitionVersionArn,
if (functionDefinitionVersionArn != null)
'FunctionDefinitionVersionArn': functionDefinitionVersionArn,
if (loggerDefinitionVersionArn != null)
'LoggerDefinitionVersionArn': loggerDefinitionVersionArn,
if (resourceDefinitionVersionArn != null)
'ResourceDefinitionVersionArn': resourceDefinitionVersionArn,
if (subscriptionDefinitionVersionArn != null)
'SubscriptionDefinitionVersionArn': subscriptionDefinitionVersionArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/greengrass/groups/${Uri.encodeComponent(groupId)}/versions',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateGroupVersionResponse.fromJson(response);
}