createEmailAddress method

Future<CreateEmailAddressResponse> createEmailAddress({
  1. required String emailAddress,
  2. required String instanceId,
  3. String? clientToken,
  4. String? description,
  5. String? displayName,
  6. Map<String, String>? tags,
})

Create new email address in the specified Connect Customer instance. For more information about email addresses, see Create email addresses in the Connect Customer Administrator Guide.

May throw AccessDeniedException. May throw DuplicateResourceException. May throw IdempotencyException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException.

Parameter emailAddress : The email address, including the domain.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter description : The description of the email address.

Parameter displayName : The display name of email address

Parameter tags : The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Implementation

Future<CreateEmailAddressResponse> createEmailAddress({
  required String emailAddress,
  required String instanceId,
  String? clientToken,
  String? description,
  String? displayName,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'EmailAddress': emailAddress,
    if (clientToken != null) 'ClientToken': clientToken,
    if (description != null) 'Description': description,
    if (displayName != null) 'DisplayName': displayName,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/email-addresses/${Uri.encodeComponent(instanceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateEmailAddressResponse.fromJson(response);
}