ACS Chat: Changes for API version: 2020-11-01-preview3#15455
Conversation
* Add failed participant check in response header for create_thread method * New convention method add_participant(thread_participant: ChatThreadParticipant) - sync and async
fangchen0601
left a comment
There was a problem hiding this comment.
lgtm. please make sure unit test and live test passed locally. and upload recorded yaml files if needed.
| @@ -0,0 +1,8 @@ | |||
| # ------------------------------------------------------------------------ | |||
There was a problem hiding this comment.
the _shared folder is shared between all service SDKs, like SMS SDK has the same folder and same files/methods. Which means adding one method/module to this folder, other teams must do the same.
So I suggest:
- Talk to Tural to ask if above is the same case, if yes, ask if this will become a common method that other teams will use, if yes, then your PR is good
- If this module and method is only for Chat team, suggest move it to azure/communication/chat/_util.py after talked to Tural.
There was a problem hiding this comment.
Thanks for the feedback.
Currently, I don't commit the test files in order to reduce the unnecessary review workload. Yes, I will run and upload new test files after review.
For the helper file in shared folder, what do you think? @turalf
There was a problem hiding this comment.
I guess this file is specific to the chat module. If that is the case please keep this file outside of the _shared folder.
Also it seems that this method is used only in 1 file. If you are not planning to use it somewhere else in the future, better to keep in that file.
4b1f836 to
a0e2210
Compare
turalf
left a comment
There was a problem hiding this comment.
Please make sure to add recording files after running live tests locally, once they are available
| @@ -0,0 +1,8 @@ | |||
| # ------------------------------------------------------------------------ | |||
There was a problem hiding this comment.
I guess this file is specific to the chat module. If that is the case please keep this file outside of the _shared folder.
Also it seems that this method is used only in 1 file. If you are not planning to use it somewhere else in the future, better to keep in that file.
9d0e425 to
914bbfe
Compare
| :return: SendChatMessageResult, or the result of cls(response) | ||
| :rtype: ~azure.communication.chat.SendChatMessageResult | ||
| :return: str, or the result of cls(response) | ||
| :rtype: str |
There was a problem hiding this comment.
This change should not have been made - could we fix it before the next release goes out?
Instead we should use something like this:
return { 'id': send_chat_message_result.id }
There was a problem hiding this comment.
Will change accordingly in the next iteration
| def update_thread( | ||
| def update_topic( | ||
| self, | ||
| topic=None, # type: Optional[str] |
There was a problem hiding this comment.
If we are updating the topic- the topic parameter should no longer be optional.
| participant, reason = invalid_participant_and_reason.split(',', 1) | ||
| errors.append('participant ' + participant + ' failed to join thread ' | ||
| + create_chat_thread_result.id + ' return statue code ' + reason) | ||
| raise ValueError(errors) |
There was a problem hiding this comment.
This should not be a ValueError
Several changes required by `2020-11-01-preview3` of the API: - Rename `Thread Members` to `Participants` - Rename function `UpdateThread` to `UpdateTopic` - Rename `ReadReceipt` to `ChatMessageReadReceipt` in model - Return message id (string) instead of SendMessageResult (object) when calling `send_message` - Add a convenience method `add_participant` for adding 1 participant - Add failed participants check in response header in `create_thread` function Misc: - Add updated test record files Co-authored-by: Leo Li <jixli@microsoft.com> Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com>
* ACS Chat: Changes for API version: 2020-11-01-preview3 (#15455) Several changes required by `2020-11-01-preview3` of the API: - Rename `Thread Members` to `Participants` - Rename function `UpdateThread` to `UpdateTopic` - Rename `ReadReceipt` to `ChatMessageReadReceipt` in model - Return message id (string) instead of SendMessageResult (object) when calling `send_message` - Add a convenience method `add_participant` for adding 1 participant - Add failed participants check in response header in `create_thread` function Misc: - Add updated test record files Co-authored-by: Leo Li <jixli@microsoft.com> Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> * Update ACS Chat Python SDK align with swagger changes (#15640) - Seperate AzureCommunicationChatServiceOperationsMixin into ChatOperations and ChatThreadOperations - Move invalid participants into errors object in reponse body Co-authored-by: Leo Li <jixli@microsoft.com> * Communication chat - paginated results for participants and readreceipts (#15682) * Failed participant check + single member add * Add failed participant check in response header for create_thread method * New convention method add_participant(thread_participant: ChatThreadParticipant) - sync and async * Add empty line at the end of files * Enable pagination for list participants * Enable pagination for read receipts * conflicts resolved after merge with upstream * update README.md * e2e test fix * bkp commit * updated e2e tests * adding test recording Co-authored-by: Leo Li <jixli@microsoft.com> * Updated swagger changes (#16390) * Updated swagger changes - Generate new models from swagger - ChatMessage.content -> ChatMessageContent instead of 'str' - Remove ChatMessagePriority - Introduce ChatMessageType - Add tests around ChatMessageType deserialization - Generate a repeatability ID by default - Add some test scenarios around repeatability ID - Update all relevant tests - Update sample code - Record new test sessions * Rebase with master - Use CommunicationUserIdentifier * pylint fixes Co-authored-by: Jixing (Leo) Li <lijixing3377@gmail.com> Co-authored-by: Leo Li <jixli@microsoft.com>
* Rsarkar/chat preview3 rebased (#16463) * ACS Chat: Changes for API version: 2020-11-01-preview3 (#15455) Several changes required by `2020-11-01-preview3` of the API: - Rename `Thread Members` to `Participants` - Rename function `UpdateThread` to `UpdateTopic` - Rename `ReadReceipt` to `ChatMessageReadReceipt` in model - Return message id (string) instead of SendMessageResult (object) when calling `send_message` - Add a convenience method `add_participant` for adding 1 participant - Add failed participants check in response header in `create_thread` function Misc: - Add updated test record files Co-authored-by: Leo Li <jixli@microsoft.com> Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> * Update ACS Chat Python SDK align with swagger changes (#15640) - Seperate AzureCommunicationChatServiceOperationsMixin into ChatOperations and ChatThreadOperations - Move invalid participants into errors object in reponse body Co-authored-by: Leo Li <jixli@microsoft.com> * Communication chat - paginated results for participants and readreceipts (#15682) * Failed participant check + single member add * Add failed participant check in response header for create_thread method * New convention method add_participant(thread_participant: ChatThreadParticipant) - sync and async * Add empty line at the end of files * Enable pagination for list participants * Enable pagination for read receipts * conflicts resolved after merge with upstream * update README.md * e2e test fix * bkp commit * updated e2e tests * adding test recording Co-authored-by: Leo Li <jixli@microsoft.com> * Updated swagger changes (#16390) * Updated swagger changes - Generate new models from swagger - ChatMessage.content -> ChatMessageContent instead of 'str' - Remove ChatMessagePriority - Introduce ChatMessageType - Add tests around ChatMessageType deserialization - Generate a repeatability ID by default - Add some test scenarios around repeatability ID - Update all relevant tests - Update sample code - Record new test sessions * Rebase with master - Use CommunicationUserIdentifier * pylint fixes Co-authored-by: Jixing (Leo) Li <lijixing3377@gmail.com> Co-authored-by: Leo Li <jixli@microsoft.com> * Apiview changes (#16560) * apiview fixes - Add missing type hints - return ItemPaged or AsyncItemPaged instead of full classpath Co-authored-by: Jixing (Leo) Li <lijixing3377@gmail.com> Co-authored-by: Leo Li <jixli@microsoft.com>
Several changes required by
2020-11-01-preview3of the API:Thread MemberstoParticipantsUpdateThreadtoUpdateTopicReadReceipttoChatMessageReadReceiptin modelsend_messageadd_participantfor adding 1 participantcreate_threadfunction