dasf.messaging.constants module
Enums within the DASF Messaging Framework.
Classes:
|
Supported message types. |
|
A request to send via the message broker. |
|
A request to send via the message broker. |
|
Property keys for a message to the message broker. |
|
A DASF request for a consumer. |
|
Base class for a DASF request or response. |
|
A DASF response for a producer. |
|
Status flag of a request. |
Functions:
|
Utility function to generate the docstring for an enum. |
- class dasf.messaging.constants.MessageType(value)[source]
-
Supported message types.
The following values are valid:
PING (
"ping")PONG (
"pong")REQUEST (
"request")RESPONSE (
"response")LOG (
"log")INFO (
"info")PROGRESS (
"progress")API_INFO (
"api_info")
Attributes:
- API_INFO = 'api_info'
- INFO = 'info'
- LOG = 'log'
- PING = 'ping'
- PONG = 'pong'
- PROGRESS = 'progress'
- REQUEST = 'request'
- RESPONSE = 'response'
- class dasf.messaging.constants.ModuleRequest(*, payload: Annotated[str, EncodedStr(encoder=Base64Encoder)], context: str, properties: RequestProperties)[source]
Bases:
BaseModelA request to send via the message broker.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- properties: RequestProperties
- class dasf.messaging.constants.ModuleResponse(*, messageId: str = '', payload: Annotated[str, EncodedStr(encoder=Base64Encoder)], publishTime: str = '', properties: ResponseProperties)[source]
Bases:
BaseModelA request to send via the message broker.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- properties: ResponseProperties
- class dasf.messaging.constants.PropertyKeys(value)[source]
-
Property keys for a message to the message broker.
The following values are valid:
REQUEST_CONTEXT (
"requestContext")RESPONSE_TOPIC (
"response_topic")SOURCE_TOPIC (
"source_topic")REQUEST_MESSAGEID (
"requestMessageId")MESSAGE_TYPE (
"messageType")FRAGMENT (
"fragment")NUM_FRAGMENTS (
"num_fragments")STATUS (
"status")
Attributes:
- FRAGMENT = 'fragment'
- MESSAGE_TYPE = 'messageType'
- NUM_FRAGMENTS = 'num_fragments'
- REQUEST_CONTEXT = 'requestContext'
- REQUEST_MESSAGEID = 'requestMessageId'
- RESPONSE_TOPIC = 'response_topic'
- SOURCE_TOPIC = 'source_topic'
- STATUS = 'status'
- class dasf.messaging.constants.RequestProperties(*, messageType: MessageType, requestContext: int | Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], response_topic: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])[source]
Bases:
RequestPropertiesBaseA DASF request for a consumer.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- messageType: MessageType
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dasf.messaging.constants.RequestPropertiesBase(*, messageType: MessageType, requestContext: int | Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)])[source]
Bases:
BaseModelBase class for a DASF request or response.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- messageType: MessageType
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dasf.messaging.constants.ResponseProperties(*, messageType: MessageType, requestContext: int | Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)], requestMessageId: str | None = None, source_topic: str | None = None, fragment: int | None = None, num_fragments: int | None = None, status: Status | None = None, info: str | None = None, api_info: str | None = None, response_topic: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=None, pattern=None, ascii_only=None)] | None = None)[source]
Bases:
RequestPropertiesBaseA DASF response for a producer.
Attributes:
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- messageType: MessageType
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].