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