registerToWorkMail method

Future<void> registerToWorkMail({
  1. required String email,
  2. required String entityId,
  3. required String organizationId,
})

Registers an existing and disabled user, group, or resource for Amazon WorkMail use by associating a mailbox and calendaring capabilities. It performs no change if the user, group, or resource is enabled and fails if the user, group, or resource is deleted. This operation results in the accumulation of costs. For more information, see Pricing. The equivalent console functionality for this operation is Enable.

Users can either be created by calling the CreateUser API operation or they can be synchronized from your directory. For more information, see DeregisterFromWorkMail.

May throw DirectoryServiceAuthenticationFailedException. May throw DirectoryUnavailableException. May throw EmailAddressInUseException. May throw EntityNotFoundException. May throw EntityStateException. May throw EntityAlreadyRegisteredException. May throw InvalidParameterException. May throw MailDomainNotFoundException. May throw MailDomainStateException. May throw OrganizationNotFoundException. May throw OrganizationStateException.

Parameter email : The email for the user, group, or resource to be updated.

Parameter entityId : The identifier for the user, group, or resource to be updated.

Parameter organizationId : The identifier for the organization under which the user, group, or resource exists.

Implementation

Future<void> registerToWorkMail({
  required String email,
  required String entityId,
  required String organizationId,
}) async {
  ArgumentError.checkNotNull(email, 'email');
  _s.validateStringLength(
    'email',
    email,
    1,
    254,
    isRequired: true,
  );
  ArgumentError.checkNotNull(entityId, 'entityId');
  _s.validateStringLength(
    'entityId',
    entityId,
    12,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(organizationId, 'organizationId');
  _s.validateStringLength(
    'organizationId',
    organizationId,
    34,
    34,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.RegisterToWorkMail'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Email': email,
      'EntityId': entityId,
      'OrganizationId': organizationId,
    },
  );
}