def _factory_for_type(self, params, name):
    endpoint_type = params.get('type')
    if (not endpoint_type):
        logger.warning('Endpoint %s is missing "type".', name)
        return None
    factory = self._factories.get(endpoint_type)
    if (not factory):
        logger.warning('Endpoint %s has invalid "type". Valid types: %s', name, sorted(self._factories.keys()))
        return None
    return factory
def _factory_for_type(self, params, name):
    endpoint_type = params.get('type')
    if (not endpoint_type):
        logger.warning('Endpoint %s is missing "type".', name)
        return None
    factory = self._factories.get(endpoint_type)
    if (not factory):
        logger.warning('Endpoint %s has invalid "type". Valid types: %s', name, sorted(self._factories.keys()))
        return None
    return factory