updateSubscriber method
Future<void>
updateSubscriber({
- required String accountId,
- required String budgetName,
- required Subscriber newSubscriber,
- required Notification notification,
- required Subscriber oldSubscriber,
Updates a subscriber.
May throw InternalErrorException. May throw InvalidParameterException. May throw NotFoundException. May throw DuplicateRecordException. May throw AccessDeniedException.
Parameter accountId
:
The accountId
that is associated with the budget whose
subscriber you want to update.
Parameter budgetName
:
The name of the budget whose subscriber you want to update.
Parameter newSubscriber
:
The updated subscriber that is associated with a budget notification.
Parameter notification
:
The notification whose subscriber you want to update.
Parameter oldSubscriber
:
The previous subscriber that is associated with a budget notification.
Implementation
Future<void> updateSubscriber({
required String accountId,
required String budgetName,
required Subscriber newSubscriber,
required Notification notification,
required Subscriber oldSubscriber,
}) async {
ArgumentError.checkNotNull(accountId, 'accountId');
_s.validateStringLength(
'accountId',
accountId,
12,
12,
isRequired: true,
);
ArgumentError.checkNotNull(budgetName, 'budgetName');
_s.validateStringLength(
'budgetName',
budgetName,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(newSubscriber, 'newSubscriber');
ArgumentError.checkNotNull(notification, 'notification');
ArgumentError.checkNotNull(oldSubscriber, 'oldSubscriber');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSBudgetServiceGateway.UpdateSubscriber'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AccountId': accountId,
'BudgetName': budgetName,
'NewSubscriber': newSubscriber,
'Notification': notification,
'OldSubscriber': oldSubscriber,
},
);
}