def AddDomainUser(self, first_name, last_name, user_mail, new_password,
                    verify=False):
    """Adds user to the domain.

    Checks if the user already exists.  Users are created by default
    as unsuspended, non-admin users.

    Args:
      first_name: Given first name.
      last_name: Family name.
      user_mail: user_mail to add.
      new_password: Password to set.
      verify: If True, verify user was created.
    """
    log_utils.LogDebug('AddDomainUser (%s).' % user_mail)
    if self.IsDomainUser(user_mail):
      raise admin_api_tool_errors.AdminAPIToolUserError(
          'User %s already exists.' % user_mail)
    body = {
        'primaryEmail': user_mail,
        'name': {'givenName': first_name, 'familyName': last_name},
        'password': new_password
        }
    backoff = http_utils.Backoff()
    while backoff.Loop():
      try:
        self._users.insert(body=body).execute()
        if verify:
          time.sleep(2)  # Seems to be needed for Verify to work consistently.
          if not self.IsDomainUser(user_mail):
            raise admin_api_tool_errors.AdminAPIToolUserError(
                'Problem creating user: %s' % user_mail)
        return
      except apiclient_errors.HttpError as e:
        if e.resp.status not in http_utils.RETRY_RESPONSE_CODES:
          raise admin_api_tool_errors.AdminAPIToolUserError(
              http_utils.ParseHttpResult(e.uri, e.resp, e.content))
        log_utils.LogInfo(
            'Possible quota problem adding user %s (%d). Retrying after '
            'a short wait.' % (user_mail, e.resp.status))
        backoff.Fail()
dataset/ETHPy150Open google/gfw-toolkit/toolkit/admin_sdk_directory_api/users_api.py/UsersApiWrapper.AddDomainUser/original