generated from intersystems-community/iris-interoperability-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Pydantic-based message classes for improved validation and …
…serialization
- Loading branch information
1 parent
5441f73
commit aaadd6c
Showing
10 changed files
with
61 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
from typing import Any | ||
from pydantic import BaseModel | ||
|
||
class _Message: | ||
""" The abstract class that is the superclass for persistent messages sent from one component to another. | ||
This class has no properties or methods. Users subclass Message and add properties. | ||
The IOP framework provides the persistence to objects derived from the Message class. | ||
""" | ||
pass | ||
pass | ||
|
||
class _PickleMessage: | ||
""" The abstract class that is the superclass for persistent messages sent from one component to another. | ||
This class has no properties or methods. Users subclass Message and add properties. | ||
The IOP framework provides the persistence to objects derived from the Message class. | ||
""" | ||
pass | ||
|
||
class _PydanticMessage(BaseModel): | ||
"""Base class for Pydantic-based messages that can be serialized to IRIS.""" | ||
|
||
def __init__(self, **data: Any): | ||
super().__init__(**data) | ||
|
||
class _PydanticPickleMessage(BaseModel): | ||
"""Base class for Pydantic-based messages that can be serialized to IRIS.""" | ||
|
||
def __init__(self, **data: Any): | ||
super().__init__(**data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters