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

Method from_model

st2common/st2common/models/api/action.py:264–272  ·  view source on GitHub ↗
(cls, model, mask_secrets=False)

Source from the content-addressed store, hash-verified

262
263 @classmethod
264 def from_model(cls, model, mask_secrets=False):
265 action = cls._from_model(model)
266 action["runner_type"] = action.get("runner_type", {}).get("name", None)
267 action["tags"] = TagsHelper.from_model(model.tags)
268
269 if getattr(model, "notify", None):
270 action["notify"] = NotificationsHelper.from_model(model.notify)
271
272 return cls(**action)
273
274 @classmethod
275 def to_model(cls, action):

Callers 1

from_modelMethod · 0.45

Calls 2

_from_modelMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected