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

Method to_model

st2common/st2common/models/api/policy.py:133–145  ·  view source on GitHub ↗
(cls, instance)

Source from the content-addressed store, hash-verified

131
132 @classmethod
133 def to_model(cls, instance):
134 return cls.model(
135 id=getattr(instance, "id", None),
136 name=str(instance.name),
137 description=getattr(instance, "description", None),
138 pack=str(instance.pack),
139 ref=getattr(instance, "ref", None),
140 enabled=getattr(instance, "enabled", None),
141 resource_ref=str(instance.resource_ref),
142 policy_type=str(instance.policy_type),
143 parameters=getattr(instance, "parameters", dict()),
144 metadata_file=getattr(instance, "metadata_file", None),
145 )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected