deleteContactMethod method

Future<DeleteContactMethodResult> deleteContactMethod({
  1. required ContactProtocol protocol,
})

Deletes a contact method.

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.

May throw ServiceException. May throw InvalidInputException. May throw OperationFailureException. May throw UnauthenticatedException. May throw AccessDeniedException. May throw NotFoundException.

Parameter protocol : The protocol that will be deleted, such as Email or SMS (text messaging).

Implementation

Future<DeleteContactMethodResult> deleteContactMethod({
  required ContactProtocol protocol,
}) async {
  ArgumentError.checkNotNull(protocol, 'protocol');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.DeleteContactMethod'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'protocol': protocol.toValue(),
    },
  );

  return DeleteContactMethodResult.fromJson(jsonResponse.body);
}