code: @Override
      public UpdatePrimaryEmailAddressResult updatePrimaryEmailAddress(UpdatePrimaryEmailAddressRequest request) {
          request = beforeClientExecution(request);
          return executeUpdatePrimaryEmailAddress(request);
      }
docs: <p>
  Updates the primary email for a user, group, or resource. The current email is moved into the list of aliases (or
  swapped between an existing alias and the current primary email), and the email provided in the input is promoted
  as the primary.
  </p>
  
  @param updatePrimaryEmailAddressRequest
  @return Result of the UpdatePrimaryEmailAddress operation returned by the service.
  @throws DirectoryServiceAuthenticationFailedException
  The directory service doesn't recognize the credentials supplied by WorkMail.
  @throws DirectoryUnavailableException
  The directory on which you are trying to perform operations isn't available.
  @throws EmailAddressInUseException
  The email address that you're trying to assign is already created for a different user, group, or
  resource.
  @throws EntityNotFoundException
  The identifier supplied for the user, group, or resource does not exist in your organization.
  @throws EntityStateException
  You are performing an operation on a user, group, or resource that isn't in the expected state, such as
  trying to delete an active user.
  @throws InvalidParameterException
  One or more of the input parameters don't match the service's restrictions.
  @throws MailDomainNotFoundException
  For an email or alias to be created in Amazon WorkMail, the included domain must be defined in the
  organization.
  @throws MailDomainStateException
  After a domain has been added to the organization, it must be verified. The domain is not yet verified.
  @throws InvalidParameterException
  One or more of the input parameters don't match the service's restrictions.
  @throws OrganizationNotFoundException
  An operation received a valid organization identifier that either doesn't belong or exist in the system.
  @throws OrganizationStateException
  The organization must have a valid state (Active or Synchronizing) to perform certain operations on the
  organization or its members.
  @throws UnsupportedOperationException
  You can't perform a write operation against a read-only directory.
  @sample AmazonWorkMail.UpdatePrimaryEmailAddress
  @see <a href="http://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdatePrimaryEmailAddress"
  target="_top">AWS API Documentation</a>