Skip to content

Commit 8135810

Browse files
Add silent message update support
- Update Symphony APIs spec version - Add silent flag support according to the new spec. When silent is true, the new updated message is marked as read, otherwise is unread. True is the default value.
1 parent 6224c16 commit 8135810

File tree

164 files changed

+204
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+204
-175
lines changed

api_client_generation/generate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ code_gen_dir=`pwd`
44
project_root=$code_gen_dir/..
55
echo $code_gen_dir
66

7-
commit_hash=136b530512eea112de73591906051871d034750a
7+
commit_hash=46abc03ad7225ebc32439c06920019c9d0fb0814
88
api_spec_base_url=https://raw.githubusercontent.com/symphonyoss/symphony-api-spec/${commit_hash}
99
echo $api_spec_base_url
1010

symphony/bdk/core/service/message/message_service.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ async def search_messages_one_page(skip, limit):
466466

467467
@retry
468468
async def update_message(self, stream_id: str, message_id: str, message: Union[str, Message], data=None,
469-
version: str = "") -> V4Message:
469+
version: str = "", silent=True) -> V4Message:
470470
"""Update an existing message. The existing message must be a valid social message, that has not been deleted.
471471
See: `Update Message <https://developers.symphony.com/restapi/reference/update-message-v4>`_
472472
@@ -476,12 +476,15 @@ async def update_message(self, stream_id: str, message_id: str, message: Union[s
476476
If it is a :py:class:`Message` instance, other parameters will be ignored.
477477
If it is a string, ``<messageML>`` tags can be omitted.
478478
:param data: an object (e.g. dict) that will be serialized into JSON using ``json.dumps``.
479+
:param silent: a bool flag that will determine if the updated message is going to be marked as read (when true,
480+
which is default value) or unread (when false).
479481
:param version: Optional message version in the format "major.minor".
480482
If empty, defaults to the latest supported version.
481483
482484
:return: a V4Message object containing the details of the updated message.
483485
"""
484-
message_object = message if isinstance(message, Message) else Message(content=message, data=data, version=version)
486+
message_object = message if isinstance(message, Message) else Message(content=message, data=data, silent=silent,
487+
version=version)
485488

486489
params = {
487490
"sid": stream_id,
@@ -490,7 +493,8 @@ async def update_message(self, stream_id: str, message_id: str, message: Union[s
490493
"key_manager_token": await self._auth_session.key_manager_token,
491494
"message": message_object.content,
492495
"data": message_object.data,
493-
"version": message_object.version
496+
"version": message_object.version,
497+
"silent": str(message_object.silent)
494498
}
495499
return await self._messages_api.v4_stream_sid_message_mid_update_post(**params)
496500

symphony/bdk/core/service/message/model.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ class Message:
1414
`Create Message <https://developers.symphony.com/restapi/reference/create-message-v4>`_.
1515
"""
1616

17-
def __init__(self, content: str, data=None,
17+
def __init__(self, content: str, data=None, silent=True,
1818
attachments: List[Union[IO, Tuple[IO, IO]]] = None, version: str = ""):
1919
"""Builds a message.
2020
2121
:param content: the MessageML content to be sent. This is mandatory
2222
If there is no <messageML> tags, they will be added to the content.
23-
:param data: an object (e.g. dict) that will be serialized into JSON using ``json.dumps``
23+
:param data: an object (e.g. dict) that will be serialized into JSON using ``json.dumps``.
24+
:param silent: the bool flag determine if the updated message will be marked as read (when it
25+
is true and it s the default value) or unread (when it is false)
2426
:param attachments: list of attachments or list of (attachment, previews).
2527
These must be opened files either in binary or text mode.
2628
Previews are optional but if present, all attachments must have a preview.
@@ -32,6 +34,7 @@ def __init__(self, content: str, data=None,
3234
self._content = self._get_content(content)
3335
self._data = "" if data is None else json.dumps(data)
3436
self._version = version
37+
self._silent = silent
3538
self._attachments, self._previews = self._get_attachments_and_previews(attachments)
3639

3740
@property
@@ -58,6 +61,14 @@ def version(self) -> str:
5861
"""
5962
return self._version
6063

64+
@property
65+
def silent(self) -> str:
66+
"""Message silent flag
67+
68+
:return: the message silent value
69+
"""
70+
return self._silent
71+
6172
@property
6273
def attachments(self) -> List[IO]:
6374
"""List of attachments

symphony/bdk/gen/agent_api/attachments_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/audit_trail_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/datafeed_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/dlp_policies_and_dictionary_management_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/messages_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/share_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/signals_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/system_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

symphony/bdk/gen/agent_api/util_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
This document refers to Symphony API calls to send and receive messages and content. They need the on-premise Agent installed to perform decryption/encryption of content. - sessionToken and keyManagerToken can be obtained by calling the authenticationAPI on the symphony back end and the key manager respectively. Refer to the methods described in authenticatorAPI.yaml. - A new authorizationToken has been introduced in the authenticationAPI response payload. It can be used to replace the sessionToken in any of the API calls and can be passed as \"Authorization\" header. - Actions are defined to be atomic, ie will succeed in their entirety or fail and have changed nothing. - If it returns a 40X status then it will have sent no message to any stream even if a request to some subset of the requested streams would have succeeded. - If this contract cannot be met for any reason then this is an error and the response code will be 50X. - MessageML is a markup language for messages. See reference here: https://rest-api.symphony.com/docs/messagemlv2 - **Real Time Events**: The following events are returned when reading from a real time messages and events stream (\"datafeed\"). These events will be returned for datafeeds created with the v5 endpoints. To know more about the endpoints, refer to Create Messages/Events Stream and Read Messages/Events Stream. Unless otherwise specified, all events were added in 1.46. # noqa: E501
55
6-
The version of the OpenAPI document: 22.5.1-SNAPSHOT
6+
The version of the OpenAPI document: 22.5.1
77
Generated by: https://openapi-generator.tech
88
"""
99

0 commit comments

Comments
 (0)