Skip to content

Commit

Permalink
Merge pull request Azure#16 from beltr0n/bertong-extract-identity
Browse files Browse the repository at this point in the history
Bertong extract identity
  • Loading branch information
lsundaralingam authored Jan 22, 2021
2 parents 57b784f + cdbac44 commit 8b41ee8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 191 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@
CommunicationIdentityToken
)

from ._shared.models import CommunicationUserIdentifier


__all__ = [
'CommunicationIdentityClient',

# from _identity
'CommunicationTokenRequest',
'CommunicationIdentityToken',

# from _shared
'CommunicationUserIdentifier'
]
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def create_user(self, **kwargs):
"""create a single Communication user
return: CommunicationUserIdentifier
rtype: ~azure.communication.administration.CommunicationUserIdentifier
rtype: ~azure.communication.identity.CommunicationUserIdentifier
"""
return self._identity_service_client.communication_identity.create(
cls=lambda pr, u, e: CommunicationUserIdentifier(u.id),
Expand All @@ -100,7 +100,7 @@ def delete_user(
:param communication_user:
Azure Communication User to delete
:type communication_user: ~azure.communication.administration.CommunicationUserIdentifier
:type communication_user: ~azure.communication.identity.CommunicationUserIdentifier
:return: None
:rtype: None
"""
Expand All @@ -118,12 +118,12 @@ def issue_token(
"""Generates a new token for an identity.
:param user: Azure Communication User
:type user: ~azure.communication.administration.CommunicationUserIdentifier
:type user: ~azure.communication.identity.CommunicationUserIdentifier
:param scopes:
List of scopes to be added to the token.
:type scopes: list[str]
:return: CommunicationIdentityToken
:rtype: ~azure.communication.administration.CommunicationIdentityToken
:rtype: ~azure.communication.identity.CommunicationIdentityToken
"""
return self._identity_service_client.communication_identity.issue_token(
user.identifier,
Expand All @@ -141,7 +141,7 @@ def revoke_tokens(
"""Schedule revocation of all tokens of an identity.
:param user: Azure Communication User.
:type user: ~azure.communication.administration.CommunicationUserIdentifier.
:type user: ~azure.communication.identity.CommunicationUserIdentifier.
:param issued_before: All tokens that are issued prior to this time should get revoked.
:type issued_before: ~datetime.datetime.
:return: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

VERSION = "1.0.0b4"

SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str
SDK_MONIKER = "communication-identity/{}".format(VERSION) # type: str
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def create_user(self, **kwargs):
"""create a single Communication user
return: CommunicationUserIdentifier
rtype: ~azure.communication.administration.CommunicationUserIdentifier
rtype: ~azure.communication.identity.CommunicationUserIdentifier
"""
return await self._identity_service_client.communication_identity.create(
cls=lambda pr, u, e: CommunicationUserIdentifier(u.id),
Expand All @@ -102,7 +102,7 @@ async def delete_user(
:param communication_user:
Azure Communication User to delete
:type communication_user: ~azure.communication.administration.CommunicationUserIdentifier
:type communication_user: ~azure.communication.identity.CommunicationUserIdentifier
:return: None
:rtype: None
"""
Expand All @@ -120,12 +120,12 @@ async def issue_token(
"""Generates a new token for an identity.
:param user: Azure Communication User
:type user: ~azure.communication.administration.CommunicationUserIdentifier
:type user: ~azure.communication.identity.CommunicationUserIdentifier
:param scopes:
List of scopes to be added to the token.
:type scopes: list[str]
:return: CommunicationIdentityToken
:rtype: ~azure.communication.administration.CommunicationIdentityToken
:rtype: ~azure.communication.identity.CommunicationIdentityToken
"""
return await self._identity_service_client.communication_identity.issue_token(
user.identifier,
Expand All @@ -143,7 +143,7 @@ async def revoke_tokens(
"""Schedule revocation of all tokens of an identity.
:param user: Azure Communication User.
:type user: ~azure.communication.administration.CommunicationUserIdentifier
:type user: ~azure.communication.identity.CommunicationUserIdentifier
:param issued_before: All tokens that are issued prior to this time should get revoked.
:type issued_before: ~datetime.datetime
:return: None
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[packaging]
auto_update = false
package_name = "azure-communication-identity"
package_pprint_name = "Communication Service"
package_pprint_name = "Communication Identity Service"
package_doc_id = ""
is_stable = false
is_arm = false
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure Communication Administration for Python
# Azure Communication Identity for Python

> see https://aka.ms/autorest
Expand All @@ -24,4 +24,4 @@ no-namespace-folders: true
clear-output-folder: true
v3: true
python: true
```
```

0 comments on commit 8b41ee8

Please sign in to comment.