def _create_trigger(trigger_type):
    """
    :param trigger_type: TriggerType db object.
    :type trigger_type: :class:`TriggerTypeDB`
    """
    if (
        hasattr(trigger_type, "parameters_schema")
        and not trigger_type["parameters_schema"]
    ):
        trigger_dict = {
            "name": trigger_type.name,
            "pack": trigger_type.pack,
            "type": trigger_type.get_reference().ref,
        }

        try:
            return create_or_update_trigger_db(trigger=trigger_dict)
        except:
            LOG.exception("Validation failed for Trigger=%s.", trigger_dict)
            raise TriggerTypeRegistrationException(
                "Unable to create Trigger for TriggerType=%s." % trigger_type.name
            )
    else:
        LOG.debug(
            "Won't create Trigger object as TriggerType %s expects " + "parameters.",
            trigger_type,
        )
        return None

    :param trigger_type: TriggerType db object.
    :type trigger_type: :class:`TriggerTypeDB`
    
st2common/st2common/services/triggers.py