associateResourcesToSubscription method
Adds one or more resources to an existing subscription. The subscription must be in an active state that is not pending other changes.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter arn :
The ARN of the subscription to add resources to.
Parameter ifMatch :
The ETag value from a previous GetSubscription
or ListSubscriptions response.
Parameter resourceArns :
The ARNs of the resources to add to the subscription.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the request
is handled only once.
Implementation
Future<AssociateResourcesToSubscriptionOutput>
associateResourcesToSubscription({
required String arn,
required String ifMatch,
required List<String> resourceArns,
String? clientToken,
}) async {
final headers = <String, String>{
'If-Match': ifMatch.toString(),
};
final $payload = <String, dynamic>{
'arn': arn,
'resourceArns': resourceArns,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.sendRaw(
payload: $payload,
method: 'POST',
requestUri: '/v1/AssociateResourcesToSubscription',
headers: headers,
exceptionFnMap: _exceptionFns,
);
final $json = await _s.jsonFromResponse(response);
return AssociateResourcesToSubscriptionOutput(
subscription: Subscription.fromJson($json),
eTag: _s.extractHeaderStringValue(response.headers, 'ETag')!,
);
}