def METHOD_NAME(stub_factory_class, user, password, nsx_host,
                      tcp_port=443, auth_type=BASIC_AUTH):
    if auth_type == BASIC_AUTH:
        stub_config = get_basic_auth_stub_config(
            user, password, nsx_host, tcp_port)
    elif auth_type == SESSION_AUTH:
        stub_config = get_session_auth_stub_config(
            user, password, nsx_host, tcp_port)
    stub_factory = stub_factory_class.StubFactory(stub_config)
    return ApiClient(stub_factory)