Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check schema of the object to determine the type [preview4] #16838

Merged
merged 8 commits into from
Feb 20, 2021

Conversation

turalf
Copy link
Contributor

@turalf turalf commented Feb 20, 2021

This PR checks the schema of the communicationIdentifierObject to determine the type during serialization.
It also changes the schema of the UnknownIdentifier model class as it has the exact same schema as CommunicationUserIdentifier

@turalf turalf requested review from ankitarorabit, memontic-ms and a team as code owners February 20, 2021 01:13
@ghost ghost added the Communication label Feb 20, 2021
@turalf
Copy link
Contributor Author

turalf commented Feb 20, 2021

/azp run python - communication

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@turalf turalf merged commit 99f25be into Azure:feature/preview4 Feb 20, 2021
juancamilor pushed a commit that referenced this pull request Mar 3, 2021
* [Communication] Generate identifier Models from new swagger (#16735)
* Add generated chat code from new swagger
* Address PR Feedback
* Remove CommunicationUserIdentifierModel in identity,phone number package
* Check schema of the object to determine the type [preview4] (#16838)
* Replace identifier with rawId
* Change serilizer
* Replace indentifier with rawId in test code
* Sync models across modules
* fix typo in serizliser
* Rearrange imports
* Replace rawId with raw_id
* remove trailing newline

Co-authored-by: turalf <tufarhad@microsoft.com>

* preview4 changes made + unit tests fixed

* Chat - preview4 changes
- CommunicationUserIdentifier models added
- create_chat_thread - returns CreateChatThreadResult instead of ChatThreadClient
- add_participant - docstring update AddChatParticipantsResult instead of None
- add_participants - docstring update AddChatParticipantsResult instead of None

* pylint-changes

* pylint changes

* Method signature changed for add_pariticipant and add_participants
- add_participant - AddChatParticipantsResult -> tuple(ChatThreadParticipant, CommunicationError)
- add_participants - AddChatParticipantsResult -> list(tuple(ChatThreadParticipant, CommunicationError))
- unit tests modified as per signature change
- CommunicationErrorResponseConverter added to cosolidate list(ChatThreadParticipant) and list(CommunicationError) into list(tuple(ChatThreadParticipant, CommunicationError))
- e2e tests modified as per signature change

* CreateChatThreadResult modified to handle partial errors in batch calls with ease
- CreateChatThreadResult -> attributes changed to
  - chat_thread -> ChatThread (no change)
  - Errors -> CreateChatThreadErrors -> list(tuple(ChatThreadParticipant, CommunicationError))
- create_chat_thread -> `thread_participants` and `repeatability_request_id` changed to keyword arguments
- Modify unit tests to capture method signature modifications
- Modify e2e tests to capture method signature modifications

* pylint-changes

* pylint fixes

* README.md update + pylint fixes

* test recordings added

* add_participant -> raises error
- Update README.md with modified signature
- Update samples with new method signatures
- Add test to detect invalid instantiation of AccessToken
- Minor documentation updates
- Modify unit tests to capture method signature modifications
- Modify e2e tests to capture method signature modifications

* pylint fixes

* cls removed from docstring + update_topic async refactored

* cls removed from docstring

Co-authored-by: Sam Cheung <sacheu@microsoft.com>
Co-authored-by: turalf <tural.ferhadov@gmail.com>
Co-authored-by: turalf <tufarhad@microsoft.com>
juancamilor pushed a commit that referenced this pull request Mar 3, 2021
* [Communication] Generate identifier Models from new swagger (#16735)
* Add generated chat code from new swagger
* Address PR Feedback
* Remove CommunicationUserIdentifierModel in identity,phone number package
* Check schema of the object to determine the type [preview4] (#16838)
* Replace identifier with rawId
* Change serilizer
* Replace indentifier with rawId in test code
* Sync models across modules
* fix typo in serizliser
* Rearrange imports
* Replace rawId with raw_id
* remove trailing newline

Co-authored-by: turalf <tufarhad@microsoft.com>

* preview4 changes made + unit tests fixed

* Chat - preview4 changes
- CommunicationUserIdentifier models added
- create_chat_thread - returns CreateChatThreadResult instead of ChatThreadClient
- add_participant - docstring update AddChatParticipantsResult instead of None
- add_participants - docstring update AddChatParticipantsResult instead of None

* pylint-changes

* pylint changes

* Method signature changed for add_pariticipant and add_participants
- add_participant - AddChatParticipantsResult -> tuple(ChatThreadParticipant, CommunicationError)
- add_participants - AddChatParticipantsResult -> list(tuple(ChatThreadParticipant, CommunicationError))
- unit tests modified as per signature change
- CommunicationErrorResponseConverter added to cosolidate list(ChatThreadParticipant) and list(CommunicationError) into list(tuple(ChatThreadParticipant, CommunicationError))
- e2e tests modified as per signature change

* CreateChatThreadResult modified to handle partial errors in batch calls with ease
- CreateChatThreadResult -> attributes changed to
  - chat_thread -> ChatThread (no change)
  - Errors -> CreateChatThreadErrors -> list(tuple(ChatThreadParticipant, CommunicationError))
- create_chat_thread -> `thread_participants` and `repeatability_request_id` changed to keyword arguments
- Modify unit tests to capture method signature modifications
- Modify e2e tests to capture method signature modifications

* pylint-changes

* pylint fixes

* README.md update + pylint fixes

* test recordings added

* add_participant -> raises error
- Update README.md with modified signature
- Update samples with new method signatures
- Add test to detect invalid instantiation of AccessToken
- Minor documentation updates
- Modify unit tests to capture method signature modifications
- Modify e2e tests to capture method signature modifications

* pylint fixes

* cls removed from docstring + update_topic async refactored

* cls removed from docstring

Co-authored-by: Sam Cheung <sacheu@microsoft.com>
Co-authored-by: turalf <tural.ferhadov@gmail.com>
Co-authored-by: turalf <tufarhad@microsoft.com>

Co-authored-by: Sam Cheung <sacheu@microsoft.com>
Co-authored-by: turalf <tural.ferhadov@gmail.com>
Co-authored-by: turalf <tufarhad@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants