azure.communication.administration.aio package¶
-
class
azure.communication.administration.aio.
CommunicationIdentityClient
(endpoint: str, credential: str, **kwargs: Any)[source]¶ Azure Communication Services Identity client.
- Parameters
endpoint (str) – The endpoint url for Azure Communication Service resource.
credential – The credentials with which to authenticate. The value is an account shared access key
Example:
-
async
close
() → None[source]¶ Close the :class: ~azure.communication.administration.aio.CommunicationIdentityClient session.
-
async
create_user
(**kwargs) → azure.communication.administration._shared.models.CommunicationUser[source]¶ create a single Communication user
return: CommunicationUser rtype: ~azure.communication.administration.CommunicationUser
-
async
delete_user
(communication_user: CommunicationUser, **kwargs: Any) → None[source]¶ Triggers revocation event for user and deletes all its data.
- Parameters
communication_user (CommunicationUser) – Azure Communication User to delete
- Returns
None
- Return type
-
classmethod
from_connection_string
(conn_str: str, **kwargs: Any) → CommunicationIdentityClient[source]¶ Create CommunicationIdentityClient from a Connection String.
- Parameters
conn_str (str) – A connection string to an Azure Communication Service resource.
- Returns
Instance of CommunicationIdentityClient.
- Return type
CommunicationIdentityClient
Example:
-
async
issue_token
(user: CommunicationUser, scopes: List[str], **kwargs: Any) → CommunicationIdentityToken[source]¶ Generates a new token for an identity.
- Parameters
user (CommunicationUser) – Azure Communication User
scopes (list[str]) – List of scopes to be added to the token.
- Returns
CommunicationIdentityToken
- Return type
-
async
revoke_tokens
(user: CommunicationUser, issued_before: Optional[datetime.datetime] = None, **kwargs: Any) → None[source]¶ Schedule revocation of all tokens of an identity.
- Parameters
user (CommunicationUser) – Azure Communication User.
issued_before (datetime) – All tokens that are issued prior to this time should get revoked.
- Returns
None
- Return type