putOptedOutNumber method
Creates an opted out destination phone number in the opt-out list.
If the destination phone number isn't valid or if the specified opt-out list doesn't exist, an error is returned.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter optOutListName :
The OptOutListName or OptOutListArn to add the phone number to.
Parameter optedOutNumber :
The phone number to add to the OptOutList in E.164 format.
Implementation
Future<PutOptedOutNumberResult> putOptedOutNumber({
required String optOutListName,
required String optedOutNumber,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PinpointSMSVoiceV2.PutOptedOutNumber'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'OptOutListName': optOutListName,
'OptedOutNumber': optedOutNumber,
},
);
return PutOptedOutNumberResult.fromJson(jsonResponse.body);
}