sendContactMethodVerification method

Future<SendContactMethodVerificationResult> sendContactMethodVerification({
  1. 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 AWS Region. However, SMS text messaging is not supported in some AWS 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 ServiceException. May throw InvalidInputException. May throw OperationFailureException. May throw UnauthenticatedException. May throw AccessDeniedException. May throw NotFoundException.

Parameter protocol : The protocol to verify, such as Email or SMS (text messaging).

Implementation

Future<SendContactMethodVerificationResult> sendContactMethodVerification({
  required ContactMethodVerificationProtocol protocol,
}) async {
  ArgumentError.checkNotNull(protocol, 'protocol');
  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.toValue(),
    },
  );

  return SendContactMethodVerificationResult.fromJson(jsonResponse.body);
}