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

[communication-identity] Add methods to translate CommunicationIdentifier to / from a stable string format #24507

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

prprabhu-ms
Copy link
Contributor

@prprabhu-ms prprabhu-ms commented May 18, 2022

Description

The CommunicationIdentifier design provides a good abstraction of Azure Communication Services internal id format with better type safety, auto-complete and hides internal knowledge.

However, it doesn't lend well to storing identifiers in a database or using them as keys because there is no clear canonical way how to encode them. This PR introduces translation functions that lets developers use the underlying raw ID for these purposes.

Details Internal wiki

This PR closely follows the already merged JS PR, but diverges in two points:

  • The types already expose a raw_id property. This PR just makes sure that property is populated on construction of the object.
  • There is no equivalent of JS' CommunicationIdentifierKind structured type in python.

No REST changes.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@ghost ghost added the Communication label May 18, 2022
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-communication-identity

Copy link
Contributor

@petrsvihlik petrsvihlik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@prprabhu-ms prprabhu-ms force-pushed the identity-raw-id-translation branch from 3360113 to a792653 Compare June 24, 2022 17:58
@prprabhu-ms prprabhu-ms force-pushed the identity-raw-id-translation branch from a792653 to 8ef599c Compare June 27, 2022 18:33
Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Thanks a lot for implementing this in Python.

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.

4 participants