sendContactMethodVerification method
- required ContactMethodVerificationProtocol protocol,
Sends a verification request to an email contact method to ensure it's owned by the requester. SMS contact methods don't need to be verified.
A contact method is used to send you notifications about your Amazon Lightsail resources. You can add one email address and one mobile phone number contact method in each Amazon Web Services Region. However, SMS text messaging is not supported in some Amazon Web Services Regions, and SMS text messages cannot be sent to some countries/regions. For more information, see Notifications in Amazon Lightsail.
A verification request is sent to the contact method when you initially create it. Use this action to send another verification request if a previous verification request was deleted, or has expired.
May throw AccessDeniedException.
May throw InvalidInputException.
May throw NotFoundException.
May throw OperationFailureException.
May throw RegionSetupInProgressException.
May throw ServiceException.
May throw UnauthenticatedException.
Parameter protocol :
The protocol to verify, such as Email or SMS
(text messaging).
Implementation
Future<SendContactMethodVerificationResult> sendContactMethodVerification({
required ContactMethodVerificationProtocol protocol,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Lightsail_20161128.SendContactMethodVerification'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'protocol': protocol.value,
},
);
return SendContactMethodVerificationResult.fromJson(jsonResponse.body);
}