createEmailContact method

Future<CreateEmailContactResponse> createEmailContact({
  1. required String emailAddress,
  2. required String name,
  3. Map<String, String>? tags,
})

Creates an email contact for the provided email address.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter emailAddress : The email address this email contact points to. The activation email and any subscribed emails are sent here.

Parameter name : The name of the email contact.

Parameter tags : A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

Implementation

Future<CreateEmailContactResponse> createEmailContact({
  required String emailAddress,
  required String name,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'emailAddress': emailAddress,
    'name': name,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2022-09-19/emailcontacts',
    exceptionFnMap: _exceptionFns,
  );
  return CreateEmailContactResponse.fromJson(response);
}