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

Method to_model

st2common/st2common/models/api/auth.py:78–84  ·  view source on GitHub ↗
(cls, instance)

Source from the content-addressed store, hash-verified

76
77 @classmethod
78 def to_model(cls, instance):
79 user = str(instance.user) if instance.user else None
80 token = str(instance.token) if instance.token else None
81 expiry = isotime.parse(instance.expiry) if instance.expiry else None
82
83 model = cls.model(user=user, token=token, expiry=expiry)
84 return model
85
86
87class ApiKeyAPI(BaseAPI, APIUIDMixin):

Callers

nothing calls this directly

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected