MCPcopy Create free account
hub / github.com/StackStorm/st2 / from_model

Method from_model

st2common/st2common/models/api/trigger.py:163–176  ·  view source on GitHub ↗
(cls, model, mask_secrets=False)

Source from the content-addressed store, hash-verified

161
162 @classmethod
163 def from_model(cls, model, mask_secrets=False):
164 instance = cls._from_model(model, mask_secrets=mask_secrets)
165
166 if "payload" in instance:
167 instance["payload"] = TriggerInstanceDB.payload.parse_field_value(
168 instance["payload"]
169 )
170
171 if instance.get("occurrence_time", None):
172 instance["occurrence_time"] = isotime.format(
173 instance["occurrence_time"], offset=False
174 )
175
176 return cls(**instance)
177
178 @classmethod
179 def to_model(cls, instance):

Callers

nothing calls this directly

Calls 4

_from_modelMethod · 0.80
parse_field_valueMethod · 0.80
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected