Update code to use new create_or_update functions from the trigger service
module.
Fix a bug in RuleAPI.to_model API which caused the same trigger model to be
created multiple times if the "rule.trigger" dict didn't contain a "name"
attribute.

Instead of using the existing Trigger object, this method created a new trigger
with a random uuid for the name.

Name attribute doesn't need to be specified by the user, since the name can be
inferred from "type" attribute.
Fix lint.