stinger-python-utils 0.2.0__py3-none-any.whl → 0.3.0__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 +13 -11
- {stinger_python_utils-0.2.0.dist-info → stinger_python_utils-0.3.0.dist-info}/METADATA +1 -1
- stinger_python_utils-0.3.0.dist-info/RECORD +7 -0
- stinger_python_utils-0.2.0.dist-info/RECORD +0 -7
- {stinger_python_utils-0.2.0.dist-info → stinger_python_utils-0.3.0.dist-info}/WHEEL +0 -0
- {stinger_python_utils-0.2.0.dist-info → stinger_python_utils-0.3.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -211,7 +211,7 @@ class MessageCreator:
|
|
|
211
211
|
cls,
|
|
212
212
|
topic: str,
|
|
213
213
|
property_obj: BaseModel,
|
|
214
|
-
version:
|
|
214
|
+
version: Optional[int],
|
|
215
215
|
response_topic: str,
|
|
216
216
|
correlation_id: Union[str, bytes, None] = None,
|
|
217
217
|
) -> Message:
|
|
@@ -233,13 +233,13 @@ class MessageCreator:
|
|
|
233
233
|
topic: str,
|
|
234
234
|
payload: bytes,
|
|
235
235
|
content_type: str,
|
|
236
|
-
version:
|
|
236
|
+
version: Optional[int],
|
|
237
237
|
response_topic: str,
|
|
238
238
|
correlation_id: Union[str, bytes, None] = None,
|
|
239
239
|
) -> Message:
|
|
240
240
|
cls._validate_topic(topic)
|
|
241
241
|
cls._validate_topic(response_topic, "response_topic")
|
|
242
|
-
|
|
242
|
+
msg = Message(
|
|
243
243
|
topic=topic,
|
|
244
244
|
payload=payload,
|
|
245
245
|
qos=1,
|
|
@@ -251,15 +251,17 @@ class MessageCreator:
|
|
|
251
251
|
if isinstance(correlation_id, str)
|
|
252
252
|
else correlation_id
|
|
253
253
|
),
|
|
254
|
-
user_properties={"PropertyVersion": str(version)},
|
|
255
254
|
)
|
|
255
|
+
if version is not None:
|
|
256
|
+
msg.user_properties = {"PropertyVersion": str(version)}
|
|
257
|
+
return msg
|
|
256
258
|
|
|
257
259
|
@classmethod
|
|
258
260
|
def property_response_message(
|
|
259
261
|
cls,
|
|
260
262
|
response_topic: str,
|
|
261
263
|
property_obj: BaseModel,
|
|
262
|
-
version:
|
|
264
|
+
version: Optional[int],
|
|
263
265
|
return_code: Union[int, MethodReturnCode],
|
|
264
266
|
correlation_id: Union[str, bytes, None] = None,
|
|
265
267
|
debug_info: Optional[str] = None,
|
|
@@ -283,7 +285,7 @@ class MessageCreator:
|
|
|
283
285
|
response_topic: str,
|
|
284
286
|
payload: bytes,
|
|
285
287
|
content_type: str,
|
|
286
|
-
version:
|
|
288
|
+
version: Optional[int],
|
|
287
289
|
return_code: Union[int, MethodReturnCode],
|
|
288
290
|
correlation_id: Union[str, bytes, None] = None,
|
|
289
291
|
debug_info: Optional[str] = None,
|
|
@@ -307,13 +309,13 @@ class MessageCreator:
|
|
|
307
309
|
),
|
|
308
310
|
user_properties={
|
|
309
311
|
"ReturnCode": str(rc),
|
|
310
|
-
"PropertyVersion": str(version),
|
|
311
312
|
},
|
|
312
313
|
)
|
|
313
|
-
if
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
314
|
+
if msg_obj.user_properties is not None: # user_properties should never be None here, but checking to satisfy type checker
|
|
315
|
+
if version is not None:
|
|
316
|
+
msg_obj.user_properties["PropertyVersion"] = str(version)
|
|
317
|
+
if debug_info is not None:
|
|
318
|
+
msg_obj.user_properties["DebugInfo"] = debug_info
|
|
317
319
|
return msg_obj
|
|
318
320
|
|
|
319
321
|
@classmethod
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
stinger_python_utils/__init__.py,sha256=IjHRV0k2DNwvFrEHebmsXiBvmITE8nQUnsR07h9tVkU,7
|
|
2
|
+
stinger_python_utils/message_creator.py,sha256=fA7ZICVB6K2UVmq1u9bEiJ_GorlR8BnFpan3E9_ALh4,11737
|
|
3
|
+
stinger_python_utils/return_codes.py,sha256=AAwshvHu3SBoctwMX35k3j666J4a7DQ3V8AnR7QBjC8,5114
|
|
4
|
+
stinger_python_utils-0.3.0.dist-info/METADATA,sha256=10X4jhrUNe5v8cBG2RsZcYEaxY7W4GJSWOCp3eyOiIE,2769
|
|
5
|
+
stinger_python_utils-0.3.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
6
|
+
stinger_python_utils-0.3.0.dist-info/licenses/LICENSE,sha256=_T-8ExmblJbhv-1AxC6XDVEHg1JdJA-126NvRiMqS-I,1070
|
|
7
|
+
stinger_python_utils-0.3.0.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
stinger_python_utils/__init__.py,sha256=IjHRV0k2DNwvFrEHebmsXiBvmITE8nQUnsR07h9tVkU,7
|
|
2
|
-
stinger_python_utils/message_creator.py,sha256=SEdtwRJCDSBmVy_1ciJeHwPjK6pav4OIaF0W88RjOMY,11588
|
|
3
|
-
stinger_python_utils/return_codes.py,sha256=AAwshvHu3SBoctwMX35k3j666J4a7DQ3V8AnR7QBjC8,5114
|
|
4
|
-
stinger_python_utils-0.2.0.dist-info/METADATA,sha256=OjtR5mmKovSMZSbeMtaVhRZ-ZJ_GtUe99pKyKC0soUk,2769
|
|
5
|
-
stinger_python_utils-0.2.0.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
6
|
-
stinger_python_utils-0.2.0.dist-info/licenses/LICENSE,sha256=_T-8ExmblJbhv-1AxC6XDVEHg1JdJA-126NvRiMqS-I,1070
|
|
7
|
-
stinger_python_utils-0.2.0.dist-info/RECORD,,
|
|
File without changes
|
{stinger_python_utils-0.2.0.dist-info → stinger_python_utils-0.3.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|