From 127516e2fa439be50742cbd02fddad64f85e4d90 Mon Sep 17 00:00:00 2001 From: Lakshman Sundaralingam Date: Tue, 20 Apr 2021 17:28:19 -0700 Subject: [PATCH] Updated identity samples (#18189) --- .../samples/identity_samples.py | 10 +++++----- .../samples/identity_samples_async.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sdk/communication/azure-communication-identity/samples/identity_samples.py b/sdk/communication/azure-communication-identity/samples/identity_samples.py index 21d20d163143..32139b97086a 100644 --- a/sdk/communication/azure-communication-identity/samples/identity_samples.py +++ b/sdk/communication/azure-communication-identity/samples/identity_samples.py @@ -43,7 +43,7 @@ def get_token(self): else: identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string) user = identity_client.create_user() - print("Getting token for: " + user.identifier) + print("Getting token for: " + user.properties.get('id')) tokenresponse = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) print("Token issued with value: " + tokenresponse.token) @@ -74,7 +74,7 @@ def create_user(self): identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string) print("Creating new user") user = identity_client.create_user() - print("User created with id:" + user.identifier) + print("User created with id:" + user.properties.get('id')) def create_user_and_token(self): from azure.communication.identity import ( @@ -88,7 +88,7 @@ def create_user_and_token(self): identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string) print("Creating new user with token") user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT]) - print("User created with id:" + user.identifier) + print("User created with id:" + user.properties.get('id')) print("Token issued with value: " + tokenresponse.token) def delete_user(self): @@ -100,9 +100,9 @@ def delete_user(self): else: identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string) user = identity_client.create_user() - print("Deleting user: " + user.identifier) + print("Deleting user: " + user.properties.get('id')) identity_client.delete_user(user) - print(user.identifier + " deleted") + print(user.properties.get('id') + " deleted") if __name__ == '__main__': sample = CommunicationIdentityClientSamples() diff --git a/sdk/communication/azure-communication-identity/samples/identity_samples_async.py b/sdk/communication/azure-communication-identity/samples/identity_samples_async.py index 0956e469fed2..bda99acb95b2 100644 --- a/sdk/communication/azure-communication-identity/samples/identity_samples_async.py +++ b/sdk/communication/azure-communication-identity/samples/identity_samples_async.py @@ -45,7 +45,7 @@ async def get_token(self): async with identity_client: user = await identity_client.create_user() - print("Issuing token for: " + user.identifier) + print("Issuing token for: " + user.properties.get('id')) tokenresponse = await identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT]) print("Token issued with value: " + tokenresponse.token) @@ -76,7 +76,7 @@ async def create_user(self): async with identity_client: print("Creating new user") user = await identity_client.create_user() - print("User created with id:" + user.identifier) + print("User created with id:" + user.properties.get('id')) async def create_user_and_token(self): from azure.communication.identity.aio import CommunicationIdentityClient @@ -90,7 +90,7 @@ async def create_user_and_token(self): async with identity_client: print("Creating new user with token") user, tokenresponse = await identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT]) - print("User created with id:" + user.identifier) + print("User created with id:" + user.properties.get('id')) print("Token issued with value: " + tokenresponse.token) async def delete_user(self): @@ -103,9 +103,9 @@ async def delete_user(self): async with identity_client: user = await identity_client.create_user() - print("Deleting user: " + user.identifier) + print("Deleting user: " + user.properties.get('id')) await identity_client.delete_user(user) - print(user.identifier + " deleted") + print(user.properties.get('id') + " deleted") async def main(): sample = CommunicationIdentityClientSamples()