def create_trigger_type_db(trigger_type):
 trigger_type_api = TriggerTypeAPI(**trigger_type)
 trigger_type_api.validate()
 ref = ResourceReference.to_string_reference(name=trigger_type_api.name, pack=trigger_type_api.pack)
 trigger_type_db = get_trigger_type_db(ref)
 if (not trigger_type_db):
  trigger_type_db = TriggerTypeAPI.to_model(trigger_type_api)
  LOG.debug('verified trigger and formulated TriggerDB=%s', trigger_type_db)
  trigger_type_db = TriggerType.add_or_update(trigger_type_db)
 return trigger_type_db

def create_trigger_type_db ( trigger_type ) : trigger_type_api = TriggerTypeAPI ( ** trigger_type ) trigger_type_api . validate ( ) ref = ResourceReference . to_string_reference ( name = trigger_type_api . name , pack = trigger_type_api . pack ) trigger_type_db = get_trigger_type_db ( ref ) if ( not trigger_type_db ) : trigger_type_db = TriggerTypeAPI . to_model ( trigger_type_api ) LOG . debug ( 'verified trigger and formulated TriggerDB=%s' , trigger_type_db ) trigger_type_db = TriggerType . add_or_update ( trigger_type_db ) return trigger_type_db
creates a trigger type db object in the db given trigger_type definition as dict .