

def main(argv):
    'A script to test Admin SDK Directory APIs.'
    flags = common_flags.ParseFlags(argv, 'Add a domain user.', AddFlags)
    http = auth_helper.GetAuthorizedHttp(flags)
    api_wrapper = users_api.UsersApiWrapper(http)
    try:
        api_wrapper.AddDomainUser(flags.first_name, flags.last_name, flags.user_email, flags.password)
    except admin_api_tool_errors.AdminAPIToolUserError as e:
        log_utils.LogError(('Unable to add user %s.' % flags.user_email), e)
        sys.exit(1)
    log_utils.LogInfo(('User %s added.' % flags.user_email))

dataset/ETHPy150Open google/gfw-toolkit/toolkit/cmds/add_user.py main/original