Convert SQLAlchemy model to ExecutionTokenOut response schema.
(model: ExecutionTokenModel)
| 76 | |
| 77 | |
| 78 | def _model_to_out(model: ExecutionTokenModel) -> ExecutionTokenOut: |
| 79 | """Convert SQLAlchemy model to ExecutionTokenOut response schema.""" |
| 80 | token = _model_to_pydantic(model) |
| 81 | return ExecutionTokenOut( |
| 82 | token_id=token.token_id, |
| 83 | agent_id=token.agent_id, |
| 84 | mission_id=token.mission_id, |
| 85 | execution_scope=token.execution_scope, |
| 86 | immutable_params=token.immutable_params, |
| 87 | bounded_params=token.bounded_params, |
| 88 | issued_at=token.issued_at, |
| 89 | expires_at=token.expires_at, |
| 90 | boundary_snapshot_id=token.boundary_snapshot_id, |
| 91 | token_signature=token.token_signature, |
| 92 | used=token.used, |
| 93 | is_valid=token.is_valid, |
| 94 | invalidated_at=token.invalidated_at, |
| 95 | invalidation_reason=token.invalidation_reason, |
| 96 | ) |
| 97 | |
| 98 | |
| 99 | def _pydantic_to_model_data(token: ExecutionToken) -> dict[str, Any]: |
no test coverage detected