createNotification method
Creates a notification. You must create the budget before you create the associated notification.
May throw AccessDeniedException.
May throw CreationLimitExceededException.
May throw DuplicateRecordException.
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotFoundException.
May throw ThrottlingException.
Parameter accountId :
The accountId that is associated with the budget that you
want to create a notification for.
Parameter budgetName :
The name of the budget that you want Amazon Web Services to notify you
about. Budget names must be unique within an account.
Parameter notification :
The notification that you want to create.
Parameter subscribers :
A list of subscribers that you want to associate with the notification.
Each notification can have one SNS subscriber and up to 10 email
subscribers.
Implementation
Future<void> createNotification({
required String accountId,
required String budgetName,
required Notification notification,
required List<Subscriber> subscribers,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSBudgetServiceGateway.CreateNotification'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AccountId': accountId,
'BudgetName': budgetName,
'Notification': notification,
'Subscribers': subscribers,
},
);
}