stinger-python-utils 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stinger_python_utils/message_creator.py +16 -3
- {stinger_python_utils-0.1.5.dist-info → stinger_python_utils-0.1.6.dist-info}/METADATA +1 -1
- stinger_python_utils-0.1.6.dist-info/RECORD +7 -0
- stinger_python_utils-0.1.5.dist-info/RECORD +0 -7
- {stinger_python_utils-0.1.5.dist-info → stinger_python_utils-0.1.6.dist-info}/WHEEL +0 -0
- {stinger_python_utils-0.1.5.dist-info → stinger_python_utils-0.1.6.dist-info}/licenses/LICENSE +0 -0
|
@@ -4,6 +4,7 @@ from typing import Union, Optional
|
|
|
4
4
|
import uuid
|
|
5
5
|
from .return_codes import MethodReturnCode
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
class MessageCreator:
|
|
8
9
|
|
|
9
10
|
@classmethod
|
|
@@ -38,7 +39,11 @@ class MessageCreator:
|
|
|
38
39
|
"""
|
|
39
40
|
This could be used for a response to a request, but where there was an error fulfilling the request.
|
|
40
41
|
"""
|
|
41
|
-
rc =
|
|
42
|
+
rc = (
|
|
43
|
+
return_code.value
|
|
44
|
+
if isinstance(return_code, MethodReturnCode)
|
|
45
|
+
else return_code
|
|
46
|
+
)
|
|
42
47
|
msg_obj = Message(
|
|
43
48
|
topic=topic,
|
|
44
49
|
payload=b"{}",
|
|
@@ -74,7 +79,11 @@ class MessageCreator:
|
|
|
74
79
|
payload = response_obj.encode("utf-8")
|
|
75
80
|
else:
|
|
76
81
|
payload = response_obj
|
|
77
|
-
rc =
|
|
82
|
+
rc = (
|
|
83
|
+
return_code.value
|
|
84
|
+
if isinstance(return_code, MethodReturnCode)
|
|
85
|
+
else return_code
|
|
86
|
+
)
|
|
78
87
|
msg_obj = Message(
|
|
79
88
|
topic=response_topic,
|
|
80
89
|
payload=payload,
|
|
@@ -147,7 +156,11 @@ class MessageCreator:
|
|
|
147
156
|
"""
|
|
148
157
|
Creates a message representing a response to a property update request.
|
|
149
158
|
"""
|
|
150
|
-
rc =
|
|
159
|
+
rc = (
|
|
160
|
+
return_code.value
|
|
161
|
+
if isinstance(return_code, MethodReturnCode)
|
|
162
|
+
else return_code
|
|
163
|
+
)
|
|
151
164
|
msg_obj = Message(
|
|
152
165
|
topic=response_topic,
|
|
153
166
|
payload=property_obj.model_dump_json(by_alias=True).encode("utf-8"),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
stinger_python_utils/__init__.py,sha256=IjHRV0k2DNwvFrEHebmsXiBvmITE8nQUnsR07h9tVkU,7
|
|
2
|
+
stinger_python_utils/message_creator.py,sha256=9gC4i0wZtuobbpha01Y5QVZ1z5cEfjoyF6q6tKtk8Ds,6674
|
|
3
|
+
stinger_python_utils/return_codes.py,sha256=AAwshvHu3SBoctwMX35k3j666J4a7DQ3V8AnR7QBjC8,5114
|
|
4
|
+
stinger_python_utils-0.1.6.dist-info/METADATA,sha256=k0g0LnQI-8yrFXgdsichqOGXnc4rABfxkwU-Hu7A8i0,2769
|
|
5
|
+
stinger_python_utils-0.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
+
stinger_python_utils-0.1.6.dist-info/licenses/LICENSE,sha256=_T-8ExmblJbhv-1AxC6XDVEHg1JdJA-126NvRiMqS-I,1070
|
|
7
|
+
stinger_python_utils-0.1.6.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
stinger_python_utils/__init__.py,sha256=IjHRV0k2DNwvFrEHebmsXiBvmITE8nQUnsR07h9tVkU,7
|
|
2
|
-
stinger_python_utils/message_creator.py,sha256=KHiw7Zk2n8QI96Zv4dT2Isj8ZljwSKaVfyoOyIjlRCA,6529
|
|
3
|
-
stinger_python_utils/return_codes.py,sha256=AAwshvHu3SBoctwMX35k3j666J4a7DQ3V8AnR7QBjC8,5114
|
|
4
|
-
stinger_python_utils-0.1.5.dist-info/METADATA,sha256=6qVtX_zsa7TGr3Ny8myBxm0dhY2OSR_IP6xx5SB5Yog,2769
|
|
5
|
-
stinger_python_utils-0.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
6
|
-
stinger_python_utils-0.1.5.dist-info/licenses/LICENSE,sha256=_T-8ExmblJbhv-1AxC6XDVEHg1JdJA-126NvRiMqS-I,1070
|
|
7
|
-
stinger_python_utils-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
{stinger_python_utils-0.1.5.dist-info → stinger_python_utils-0.1.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|