diff --git a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md index 7826d7f3b0a6..de82e38c93fd 100644 --- a/sdk/eventgrid/azure-eventgrid/CHANGELOG.md +++ b/sdk/eventgrid/azure-eventgrid/CHANGELOG.md @@ -2,6 +2,11 @@ ## 2.0.0b6 (Unreleased) + **Breaking Changes** + - All the `SystemEventNames` related to Azure Communication Service starting with `ACS****` are renamed to `Acs***` to honor pascal case. + + **Features** + - Added support for two new `SystemEvents` - `ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData` and `ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData` ## 2.0.0b5 (2021-02-10) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py index f99040f4ce48..1583541ccfaa 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_event_mappings.py @@ -12,28 +12,28 @@ class SystemEventNames(str, Enum): visit https://docs.microsoft.com/azure/event-grid/system-topics. """ - ACSChatMemberAddedToThreadWithUserEventName = ( + AcsChatMemberAddedToThreadWithUserEventName = ( "Microsoft.Communication.ChatMemberAddedToThreadWithUser" ) - ACSChatMemberRemovedFromThreadWithUserEventName = ( + AcsChatMemberRemovedFromThreadWithUserEventName = ( "Microsoft.Communication.ChatMemberRemovedFromThreadWithUser" ) - ACSChatMessageDeletedEventName = "Microsoft.Communication.ChatMessageDeleted" - ACSChatMessageEditedEventName = "Microsoft.Communication.ChatMessageEdited" - ACSChatMessageReceivedEventName = "Microsoft.Communication.ChatMessageReceived" - ACSChatThreadCreatedWithUserEventName = ( + AcsChatMessageDeletedEventName = "Microsoft.Communication.ChatMessageDeleted" + AcsChatMessageEditedEventName = "Microsoft.Communication.ChatMessageEdited" + AcsChatMessageReceivedEventName = "Microsoft.Communication.ChatMessageReceived" + AcsChatThreadCreatedWithUserEventName = ( "Microsoft.Communication.ChatThreadCreatedWithUser" ) - ACSChatThreadPropertiesUpdatedPerUserEventName = ( + AcsChatThreadPropertiesUpdatedPerUserEventName = ( "Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser" ) - ACSChatThreadWithUserDeletedEventName = ( + AcsChatThreadWithUserDeletedEventName = ( "Microsoft.Communication.ChatThreadWithUserDeleted" ) - ACSSMSDeliveryReportReceivedEventName = ( + AcsSmsDeliveryReportReceivedEventName = ( "Microsoft.Communication.SMSDeliveryReportReceived" ) - ACSSMSReceivedEventName = "Microsoft.Communication.SMSReceived" + AcsSmsReceivedEventName = "Microsoft.Communication.SMSReceived" AppConfigurationKeyValueDeletedEventName = ( "Microsoft.AppConfiguration.KeyValueDeleted" ) @@ -143,6 +143,12 @@ class SystemEventNames(str, Enum): ServiceBusDeadletterMessagesAvailableWithNoListenerEventName = ( "Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListener" ) + ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventName = ( + "Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications" + ) + ServiceBusActiveMessagesAvailablePeriodicNotificationsEventName = ( + "Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications" + ) StorageBlobCreatedEventName = "Microsoft.Storage.BlobCreated" StorageBlobDeletedEventName = "Microsoft.Storage.BlobDeleted" StorageBlobRenamedEventName = "Microsoft.Storage.BlobRenamed" diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py index 48b2bba0ac58..81d2c9bbaeeb 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/_event_grid_publisher_client.py @@ -15,6 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any + from azure.core.pipeline.transport import HttpRequest, HttpResponse + from ._configuration import EventGridPublisherClientConfiguration from .operations import EventGridPublisherClientOperationsMixin from . import models @@ -36,9 +38,25 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py index 6a44d89d724a..eeec885ee412 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._event_grid_publisher_client_async import EventGridPublisherClient +from ._event_grid_publisher_client import EventGridPublisherClient __all__ = ['EventGridPublisherClient'] diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py index e09e5d1c10c7..48616ed868e2 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py @@ -9,6 +9,7 @@ from typing import Any from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer from ._configuration import EventGridPublisherClientConfiguration @@ -31,9 +32,24 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py index 151e83d4b3b0..a2a3ee562e89 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py @@ -8,11 +8,11 @@ from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -22,7 +22,7 @@ class EventGridPublisherClientOperationsMixin: async def publish_events( self, topic_hostname: str, - events: List["models.EventGridEvent"], + events: List["_models.EventGridEvent"], **kwargs ) -> None: """Publishes a batch of events to an Azure Event Grid topic. @@ -37,7 +37,9 @@ async def publish_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/json") @@ -76,7 +78,7 @@ async def publish_events( async def publish_cloud_event_events( self, topic_hostname: str, - events: List["models.CloudEvent"], + events: List["_models.CloudEvent"], **kwargs ) -> None: """Publishes a batch of events to an Azure Event Grid topic. @@ -91,7 +93,9 @@ async def publish_cloud_event_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8") @@ -145,7 +149,9 @@ async def publish_custom_event_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/json") diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py index 88a07bf0e42b..624c31af936d 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py @@ -7,27 +7,40 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import ACSChatEventBaseProperties - from ._models_py3 import ACSChatMemberAddedToThreadWithUserEventData - from ._models_py3 import ACSChatMemberRemovedFromThreadWithUserEventData - from ._models_py3 import ACSChatMessageDeletedEventData - from ._models_py3 import ACSChatMessageEditedEventData - from ._models_py3 import ACSChatMessageEventBaseProperties - from ._models_py3 import ACSChatMessageReceivedEventData - from ._models_py3 import ACSChatThreadCreatedWithUserEventData - from ._models_py3 import ACSChatThreadEventBaseProperties - from ._models_py3 import ACSChatThreadMemberProperties - from ._models_py3 import ACSChatThreadPropertiesUpdatedPerUserEventData - from ._models_py3 import ACSChatThreadWithUserDeletedEventData - from ._models_py3 import ACSSMSDeliveryAttemptProperties - from ._models_py3 import ACSSMSDeliveryReportReceivedEventData - from ._models_py3 import ACSSMSEventBaseProperties - from ._models_py3 import ACSSMSReceivedEventData + from ._models_py3 import AcsChatEventBaseProperties + from ._models_py3 import AcsChatEventInThreadBaseProperties + from ._models_py3 import AcsChatMessageDeletedEventData + from ._models_py3 import AcsChatMessageDeletedInThreadEventData + from ._models_py3 import AcsChatMessageEditedEventData + from ._models_py3 import AcsChatMessageEditedInThreadEventData + from ._models_py3 import AcsChatMessageEventBaseProperties + from ._models_py3 import AcsChatMessageEventInThreadBaseProperties + from ._models_py3 import AcsChatMessageReceivedEventData + from ._models_py3 import AcsChatMessageReceivedInThreadEventData + from ._models_py3 import AcsChatParticipantAddedToThreadEventData + from ._models_py3 import AcsChatParticipantAddedToThreadWithUserEventData + from ._models_py3 import AcsChatParticipantRemovedFromThreadEventData + from ._models_py3 import AcsChatParticipantRemovedFromThreadWithUserEventData + from ._models_py3 import AcsChatThreadCreatedEventData + from ._models_py3 import AcsChatThreadCreatedWithUserEventData + from ._models_py3 import AcsChatThreadDeletedEventData + from ._models_py3 import AcsChatThreadEventBaseProperties + from ._models_py3 import AcsChatThreadEventInThreadBaseProperties + from ._models_py3 import AcsChatThreadParticipantProperties + from ._models_py3 import AcsChatThreadPropertiesUpdatedEventData + from ._models_py3 import AcsChatThreadPropertiesUpdatedPerUserEventData + from ._models_py3 import AcsChatThreadWithUserDeletedEventData + from ._models_py3 import AcsSmsDeliveryAttemptProperties + from ._models_py3 import AcsSmsDeliveryReportReceivedEventData + from ._models_py3 import AcsSmsEventBaseProperties + from ._models_py3 import AcsSmsReceivedEventData from ._models_py3 import AppConfigurationKeyValueDeletedEventData from ._models_py3 import AppConfigurationKeyValueModifiedEventData from ._models_py3 import AppEventTypeDetail from ._models_py3 import AppServicePlanEventTypeDetail from ._models_py3 import CloudEvent + from ._models_py3 import CommunicationIdentifierModel + from ._models_py3 import CommunicationUserIdentifierModel from ._models_py3 import ContainerRegistryArtifactEventData from ._models_py3 import ContainerRegistryArtifactEventTarget from ._models_py3 import ContainerRegistryChartDeletedEventData @@ -103,6 +116,8 @@ from ._models_py3 import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData from ._models_py3 import MediaLiveEventIngestHeartbeatEventData from ._models_py3 import MediaLiveEventTrackDiscontinuityDetectedEventData + from ._models_py3 import MicrosoftTeamsUserIdentifierModel + from ._models_py3 import PhoneNumberIdentifierModel from ._models_py3 import RedisExportRDBCompletedEventData from ._models_py3 import RedisImportRDBCompletedEventData from ._models_py3 import RedisPatchingCompletedEventData @@ -116,7 +131,9 @@ from ._models_py3 import ResourceWriteCancelData from ._models_py3 import ResourceWriteFailureData from ._models_py3 import ResourceWriteSuccessData + from ._models_py3 import ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData from ._models_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData + from ._models_py3 import ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData from ._models_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData from ._models_py3 import SignalRServiceClientConnectionConnectedEventData from ._models_py3 import SignalRServiceClientConnectionDisconnectedEventData @@ -146,27 +163,40 @@ from ._models_py3 import WebSlotSwapWithPreviewCancelledEventData from ._models_py3 import WebSlotSwapWithPreviewStartedEventData except (SyntaxError, ImportError): - from ._models import ACSChatEventBaseProperties # type: ignore - from ._models import ACSChatMemberAddedToThreadWithUserEventData # type: ignore - from ._models import ACSChatMemberRemovedFromThreadWithUserEventData # type: ignore - from ._models import ACSChatMessageDeletedEventData # type: ignore - from ._models import ACSChatMessageEditedEventData # type: ignore - from ._models import ACSChatMessageEventBaseProperties # type: ignore - from ._models import ACSChatMessageReceivedEventData # type: ignore - from ._models import ACSChatThreadCreatedWithUserEventData # type: ignore - from ._models import ACSChatThreadEventBaseProperties # type: ignore - from ._models import ACSChatThreadMemberProperties # type: ignore - from ._models import ACSChatThreadPropertiesUpdatedPerUserEventData # type: ignore - from ._models import ACSChatThreadWithUserDeletedEventData # type: ignore - from ._models import ACSSMSDeliveryAttemptProperties # type: ignore - from ._models import ACSSMSDeliveryReportReceivedEventData # type: ignore - from ._models import ACSSMSEventBaseProperties # type: ignore - from ._models import ACSSMSReceivedEventData # type: ignore + from ._models import AcsChatEventBaseProperties # type: ignore + from ._models import AcsChatEventInThreadBaseProperties # type: ignore + from ._models import AcsChatMessageDeletedEventData # type: ignore + from ._models import AcsChatMessageDeletedInThreadEventData # type: ignore + from ._models import AcsChatMessageEditedEventData # type: ignore + from ._models import AcsChatMessageEditedInThreadEventData # type: ignore + from ._models import AcsChatMessageEventBaseProperties # type: ignore + from ._models import AcsChatMessageEventInThreadBaseProperties # type: ignore + from ._models import AcsChatMessageReceivedEventData # type: ignore + from ._models import AcsChatMessageReceivedInThreadEventData # type: ignore + from ._models import AcsChatParticipantAddedToThreadEventData # type: ignore + from ._models import AcsChatParticipantAddedToThreadWithUserEventData # type: ignore + from ._models import AcsChatParticipantRemovedFromThreadEventData # type: ignore + from ._models import AcsChatParticipantRemovedFromThreadWithUserEventData # type: ignore + from ._models import AcsChatThreadCreatedEventData # type: ignore + from ._models import AcsChatThreadCreatedWithUserEventData # type: ignore + from ._models import AcsChatThreadDeletedEventData # type: ignore + from ._models import AcsChatThreadEventBaseProperties # type: ignore + from ._models import AcsChatThreadEventInThreadBaseProperties # type: ignore + from ._models import AcsChatThreadParticipantProperties # type: ignore + from ._models import AcsChatThreadPropertiesUpdatedEventData # type: ignore + from ._models import AcsChatThreadPropertiesUpdatedPerUserEventData # type: ignore + from ._models import AcsChatThreadWithUserDeletedEventData # type: ignore + from ._models import AcsSmsDeliveryAttemptProperties # type: ignore + from ._models import AcsSmsDeliveryReportReceivedEventData # type: ignore + from ._models import AcsSmsEventBaseProperties # type: ignore + from ._models import AcsSmsReceivedEventData # type: ignore from ._models import AppConfigurationKeyValueDeletedEventData # type: ignore from ._models import AppConfigurationKeyValueModifiedEventData # type: ignore from ._models import AppEventTypeDetail # type: ignore from ._models import AppServicePlanEventTypeDetail # type: ignore from ._models import CloudEvent # type: ignore + from ._models import CommunicationIdentifierModel # type: ignore + from ._models import CommunicationUserIdentifierModel # type: ignore from ._models import ContainerRegistryArtifactEventData # type: ignore from ._models import ContainerRegistryArtifactEventTarget # type: ignore from ._models import ContainerRegistryChartDeletedEventData # type: ignore @@ -242,6 +272,8 @@ from ._models import MediaLiveEventIncomingVideoStreamsOutOfSyncEventData # type: ignore from ._models import MediaLiveEventIngestHeartbeatEventData # type: ignore from ._models import MediaLiveEventTrackDiscontinuityDetectedEventData # type: ignore + from ._models import MicrosoftTeamsUserIdentifierModel # type: ignore + from ._models import PhoneNumberIdentifierModel # type: ignore from ._models import RedisExportRDBCompletedEventData # type: ignore from ._models import RedisImportRDBCompletedEventData # type: ignore from ._models import RedisPatchingCompletedEventData # type: ignore @@ -255,7 +287,9 @@ from ._models import ResourceWriteCancelData # type: ignore from ._models import ResourceWriteFailureData # type: ignore from ._models import ResourceWriteSuccessData # type: ignore + from ._models import ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData # type: ignore from ._models import ServiceBusActiveMessagesAvailableWithNoListenersEventData # type: ignore + from ._models import ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData # type: ignore from ._models import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData # type: ignore from ._models import SignalRServiceClientConnectionConnectedEventData # type: ignore from ._models import SignalRServiceClientConnectionDisconnectedEventData # type: ignore @@ -289,6 +323,7 @@ AppAction, AppServicePlanAction, AsyncStatus, + CommunicationCloudEnvironmentModel, MediaJobErrorCategory, MediaJobErrorCode, MediaJobRetry, @@ -297,27 +332,40 @@ ) __all__ = [ - 'ACSChatEventBaseProperties', - 'ACSChatMemberAddedToThreadWithUserEventData', - 'ACSChatMemberRemovedFromThreadWithUserEventData', - 'ACSChatMessageDeletedEventData', - 'ACSChatMessageEditedEventData', - 'ACSChatMessageEventBaseProperties', - 'ACSChatMessageReceivedEventData', - 'ACSChatThreadCreatedWithUserEventData', - 'ACSChatThreadEventBaseProperties', - 'ACSChatThreadMemberProperties', - 'ACSChatThreadPropertiesUpdatedPerUserEventData', - 'ACSChatThreadWithUserDeletedEventData', - 'ACSSMSDeliveryAttemptProperties', - 'ACSSMSDeliveryReportReceivedEventData', - 'ACSSMSEventBaseProperties', - 'ACSSMSReceivedEventData', + 'AcsChatEventBaseProperties', + 'AcsChatEventInThreadBaseProperties', + 'AcsChatMessageDeletedEventData', + 'AcsChatMessageDeletedInThreadEventData', + 'AcsChatMessageEditedEventData', + 'AcsChatMessageEditedInThreadEventData', + 'AcsChatMessageEventBaseProperties', + 'AcsChatMessageEventInThreadBaseProperties', + 'AcsChatMessageReceivedEventData', + 'AcsChatMessageReceivedInThreadEventData', + 'AcsChatParticipantAddedToThreadEventData', + 'AcsChatParticipantAddedToThreadWithUserEventData', + 'AcsChatParticipantRemovedFromThreadEventData', + 'AcsChatParticipantRemovedFromThreadWithUserEventData', + 'AcsChatThreadCreatedEventData', + 'AcsChatThreadCreatedWithUserEventData', + 'AcsChatThreadDeletedEventData', + 'AcsChatThreadEventBaseProperties', + 'AcsChatThreadEventInThreadBaseProperties', + 'AcsChatThreadParticipantProperties', + 'AcsChatThreadPropertiesUpdatedEventData', + 'AcsChatThreadPropertiesUpdatedPerUserEventData', + 'AcsChatThreadWithUserDeletedEventData', + 'AcsSmsDeliveryAttemptProperties', + 'AcsSmsDeliveryReportReceivedEventData', + 'AcsSmsEventBaseProperties', + 'AcsSmsReceivedEventData', 'AppConfigurationKeyValueDeletedEventData', 'AppConfigurationKeyValueModifiedEventData', 'AppEventTypeDetail', 'AppServicePlanEventTypeDetail', 'CloudEvent', + 'CommunicationIdentifierModel', + 'CommunicationUserIdentifierModel', 'ContainerRegistryArtifactEventData', 'ContainerRegistryArtifactEventTarget', 'ContainerRegistryChartDeletedEventData', @@ -393,6 +441,8 @@ 'MediaLiveEventIncomingVideoStreamsOutOfSyncEventData', 'MediaLiveEventIngestHeartbeatEventData', 'MediaLiveEventTrackDiscontinuityDetectedEventData', + 'MicrosoftTeamsUserIdentifierModel', + 'PhoneNumberIdentifierModel', 'RedisExportRDBCompletedEventData', 'RedisImportRDBCompletedEventData', 'RedisPatchingCompletedEventData', @@ -406,7 +456,9 @@ 'ResourceWriteCancelData', 'ResourceWriteFailureData', 'ResourceWriteSuccessData', + 'ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData', 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', + 'ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData', 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', 'SignalRServiceClientConnectionConnectedEventData', 'SignalRServiceClientConnectionDisconnectedEventData', @@ -438,6 +490,7 @@ 'AppAction', 'AppServicePlanAction', 'AsyncStatus', + 'CommunicationCloudEnvironmentModel', 'MediaJobErrorCategory', 'MediaJobErrorCode', 'MediaJobRetry', diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_event_grid_publisher_client_enums.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_event_grid_publisher_client_enums.py index ae2189a9dc2b..31d1e2d6d0ff 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_event_grid_publisher_client_enums.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_event_grid_publisher_client_enums.py @@ -30,75 +30,130 @@ class AppAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Type of action of the operation. """ - RESTARTED = "Restarted" #: Web app was restarted. - STOPPED = "Stopped" #: Web app was stopped. - CHANGED_APP_SETTINGS = "ChangedAppSettings" #: There was an operation to change app setting on the web app. - STARTED = "Started" #: The job has started. - COMPLETED = "Completed" #: The job has completed. - FAILED = "Failed" #: The job has failed to complete. + #: Web app was restarted. + RESTARTED = "Restarted" + #: Web app was stopped. + STOPPED = "Stopped" + #: There was an operation to change app setting on the web app. + CHANGED_APP_SETTINGS = "ChangedAppSettings" + #: The job has started. + STARTED = "Started" + #: The job has completed. + COMPLETED = "Completed" + #: The job has failed to complete. + FAILED = "Failed" class AppServicePlanAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Type of action on the app service plan. """ - UPDATED = "Updated" #: App Service plan is being updated. + #: App Service plan is being updated. + UPDATED = "Updated" class AsyncStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Asynchronous operation status of the operation on the app service plan. """ - STARTED = "Started" #: Async operation has started. - COMPLETED = "Completed" #: Async operation has completed. - FAILED = "Failed" #: Async operation failed to complete. + #: Async operation has started. + STARTED = "Started" + #: Async operation has completed. + COMPLETED = "Completed" + #: Async operation failed to complete. + FAILED = "Failed" + +class CommunicationCloudEnvironmentModel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The cloud that the identifier belongs to. + """ + + PUBLIC = "public" + DOD = "dod" + GCCH = "gcch" class MediaJobErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Helps with categorization of errors. """ - SERVICE = "Service" #: The error is service related. - DOWNLOAD = "Download" #: The error is download related. - UPLOAD = "Upload" #: The error is upload related. - CONFIGURATION = "Configuration" #: The error is configuration related. - CONTENT = "Content" #: The error is related to data in the input files. + #: The error is service related. + SERVICE = "Service" + #: The error is download related. + DOWNLOAD = "Download" + #: The error is upload related. + UPLOAD = "Upload" + #: The error is configuration related. + CONFIGURATION = "Configuration" + #: The error is related to data in the input files. + CONTENT = "Content" class MediaJobErrorCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Error code describing the error. """ - SERVICE_ERROR = "ServiceError" #: Fatal service error, please contact support. - SERVICE_TRANSIENT_ERROR = "ServiceTransientError" #: Transient error, please retry, if retry is unsuccessful, please contact support. - DOWNLOAD_NOT_ACCESSIBLE = "DownloadNotAccessible" #: While trying to download the input files, the files were not accessible, please check the availability of the source. - DOWNLOAD_TRANSIENT_ERROR = "DownloadTransientError" #: While trying to download the input files, there was an issue during transfer (storage service, network errors), see details and check your source. - UPLOAD_NOT_ACCESSIBLE = "UploadNotAccessible" #: While trying to upload the output files, the destination was not reachable, please check the availability of the destination. - UPLOAD_TRANSIENT_ERROR = "UploadTransientError" #: While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. - CONFIGURATION_UNSUPPORTED = "ConfigurationUnsupported" #: There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. - CONTENT_MALFORMED = "ContentMalformed" #: There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. - CONTENT_UNSUPPORTED = "ContentUnsupported" #: There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. + #: Fatal service error, please contact support. + SERVICE_ERROR = "ServiceError" + #: Transient error, please retry, if retry is unsuccessful, please contact support. + SERVICE_TRANSIENT_ERROR = "ServiceTransientError" + #: While trying to download the input files, the files were not accessible, please check the + #: availability of the source. + DOWNLOAD_NOT_ACCESSIBLE = "DownloadNotAccessible" + #: While trying to download the input files, there was an issue during transfer (storage service, + #: network errors), see details and check your source. + DOWNLOAD_TRANSIENT_ERROR = "DownloadTransientError" + #: While trying to upload the output files, the destination was not reachable, please check the + #: availability of the destination. + UPLOAD_NOT_ACCESSIBLE = "UploadNotAccessible" + #: While trying to upload the output files, there was an issue during transfer (storage service, + #: network errors), see details and check your destination. + UPLOAD_TRANSIENT_ERROR = "UploadTransientError" + #: There was a problem with the combination of input files and the configuration settings applied, + #: fix the configuration settings and retry with the same input, or change input to match the + #: configuration. + CONFIGURATION_UNSUPPORTED = "ConfigurationUnsupported" + #: There was a problem with the input content (for example: zero byte files, or corrupt/non- + #: decodable files), check the input files. + CONTENT_MALFORMED = "ContentMalformed" + #: There was a problem with the format of the input (not valid media file, or an unsupported + #: file/codec), check the validity of the input files. + CONTENT_UNSUPPORTED = "ContentUnsupported" class MediaJobRetry(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure support via Azure Portal. """ - DO_NOT_RETRY = "DoNotRetry" #: Issue needs to be investigated and then the job resubmitted with corrections or retried once the underlying issue has been corrected. - MAY_RETRY = "MayRetry" #: Issue may be resolved after waiting for a period of time and resubmitting the same Job. + #: Issue needs to be investigated and then the job resubmitted with corrections or retried once + #: the underlying issue has been corrected. + DO_NOT_RETRY = "DoNotRetry" + #: Issue may be resolved after waiting for a period of time and resubmitting the same Job. + MAY_RETRY = "MayRetry" class MediaJobState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The previous state of the Job. """ - CANCELED = "Canceled" #: The job was canceled. This is a final state for the job. - CANCELING = "Canceling" #: The job is in the process of being canceled. This is a transient state for the job. - ERROR = "Error" #: The job has encountered an error. This is a final state for the job. - FINISHED = "Finished" #: The job is finished. This is a final state for the job. - PROCESSING = "Processing" #: The job is processing. This is a transient state for the job. - QUEUED = "Queued" #: The job is in a queued state, waiting for resources to become available. This is a transient state. - SCHEDULED = "Scheduled" #: The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. + #: The job was canceled. This is a final state for the job. + CANCELED = "Canceled" + #: The job is in the process of being canceled. This is a transient state for the job. + CANCELING = "Canceling" + #: The job has encountered an error. This is a final state for the job. + ERROR = "Error" + #: The job is finished. This is a final state for the job. + FINISHED = "Finished" + #: The job is processing. This is a transient state for the job. + PROCESSING = "Processing" + #: The job is in a queued state, waiting for resources to become available. This is a transient + #: state. + QUEUED = "Queued" + #: The job is being scheduled to run on an available resource. This is a transient state, between + #: queued and processing states. + SCHEDULED = "Scheduled" class StampKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Kind of environment where app service plan is. """ - PUBLIC = "Public" #: App Service Plan is running on a public stamp. - ASE_V1 = "AseV1" #: App Service Plan is running on an App Service Environment V1. - ASE_V2 = "AseV2" #: App Service Plan is running on an App Service Environment V2. + #: App Service Plan is running on a public stamp. + PUBLIC = "Public" + #: App Service Plan is running on an App Service Environment V1. + ASE_V1 = "AseV1" + #: App Service Plan is running on an App Service Environment V2. + ASE_V2 = "AseV2" diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py index 3f67974affad..e1e8beff6a23 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py @@ -9,11 +9,12 @@ import msrest.serialization -class ACSChatEventBaseProperties(msrest.serialization.Model): +class AcsChatEventBaseProperties(msrest.serialization.Model): """Schema of common properties of all chat events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -21,7 +22,7 @@ class ACSChatEventBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, } @@ -30,141 +31,139 @@ def __init__( self, **kwargs ): - super(ACSChatEventBaseProperties, self).__init__(**kwargs) - self.recipient_id = kwargs.get('recipient_id', None) + super(AcsChatEventBaseProperties, self).__init__(**kwargs) + self.recipient_communication_identifier = kwargs.get('recipient_communication_identifier', None) self.transaction_id = kwargs.get('transaction_id', None) self.thread_id = kwargs.get('thread_id', None) -class ACSChatThreadEventBaseProperties(ACSChatEventBaseProperties): - """Schema of common properties of all chat thread events. +class AcsChatEventInThreadBaseProperties(msrest.serialization.Model): + """Schema of common properties of all thread-level chat events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, } def __init__( self, **kwargs ): - super(ACSChatThreadEventBaseProperties, self).__init__(**kwargs) - self.create_time = kwargs.get('create_time', None) - self.version = kwargs.get('version', None) + super(AcsChatEventInThreadBaseProperties, self).__init__(**kwargs) + self.thread_id = kwargs.get('thread_id', None) -class ACSChatMemberAddedToThreadWithUserEventData(ACSChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser event. +class AcsChatMessageEventBaseProperties(AcsChatEventBaseProperties): + """Schema of common properties of all chat message events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int - :param time: The time at which the user was added to the thread. - :type time: ~datetime.datetime - :param added_by: The MRI of the user who added the user. - :type added_by: str - :param member_added: The details of the user who was added. - :type member_added: ~event_grid_publisher_client.models.ACSChatThreadMemberProperties + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'added_by': {'key': 'addedBy', 'type': 'str'}, - 'member_added': {'key': 'memberAdded', 'type': 'ACSChatThreadMemberProperties'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, } def __init__( self, **kwargs ): - super(ACSChatMemberAddedToThreadWithUserEventData, self).__init__(**kwargs) - self.time = kwargs.get('time', None) - self.added_by = kwargs.get('added_by', None) - self.member_added = kwargs.get('member_added', None) + super(AcsChatMessageEventBaseProperties, self).__init__(**kwargs) + self.message_id = kwargs.get('message_id', None) + self.sender_communication_identifier = kwargs.get('sender_communication_identifier', None) + self.sender_display_name = kwargs.get('sender_display_name', None) + self.compose_time = kwargs.get('compose_time', None) + self.type = kwargs.get('type', None) + self.version = kwargs.get('version', None) -class ACSChatMemberRemovedFromThreadWithUserEventData(ACSChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadWithUser event. +class AcsChatMessageDeletedEventData(AcsChatMessageEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int - :param time: The time at which the user was removed to the thread. - :type time: ~datetime.datetime - :param removed_by: The MRI of the user who removed the user. - :type removed_by: str - :param member_removed: The details of the user who was removed. - :type member_removed: ~event_grid_publisher_client.models.ACSChatThreadMemberProperties + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param delete_time: The time at which the message was deleted. + :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'removed_by': {'key': 'removedBy', 'type': 'str'}, - 'member_removed': {'key': 'memberRemoved', 'type': 'ACSChatThreadMemberProperties'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(ACSChatMemberRemovedFromThreadWithUserEventData, self).__init__(**kwargs) - self.time = kwargs.get('time', None) - self.removed_by = kwargs.get('removed_by', None) - self.member_removed = kwargs.get('member_removed', None) + super(AcsChatMessageDeletedEventData, self).__init__(**kwargs) + self.delete_time = kwargs.get('delete_time', None) -class ACSChatMessageEventBaseProperties(ACSChatEventBaseProperties): - """Schema of common properties of all chat message events. +class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): + """Schema of common properties of all thread-level chat message events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -172,47 +171,42 @@ class ACSChatMessageEventBaseProperties(ACSChatEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, } def __init__( self, **kwargs ): - super(ACSChatMessageEventBaseProperties, self).__init__(**kwargs) + super(AcsChatMessageEventInThreadBaseProperties, self).__init__(**kwargs) self.message_id = kwargs.get('message_id', None) - self.sender_id = kwargs.get('sender_id', None) + self.sender_communication_identifier = kwargs.get('sender_communication_identifier', None) self.sender_display_name = kwargs.get('sender_display_name', None) self.compose_time = kwargs.get('compose_time', None) self.type = kwargs.get('type', None) self.version = kwargs.get('version', None) -class ACSChatMessageDeletedEventData(ACSChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. +class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeletedInThread event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -220,21 +214,19 @@ class ACSChatMessageDeletedEventData(ACSChatMessageEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long :param delete_time: The time at which the message was deleted. :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } @@ -242,23 +234,25 @@ def __init__( self, **kwargs ): - super(ACSChatMessageDeletedEventData, self).__init__(**kwargs) + super(AcsChatMessageDeletedInThreadEventData, self).__init__(**kwargs) self.delete_time = kwargs.get('delete_time', None) -class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): +class AcsChatMessageEditedEventData(AcsChatMessageEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -266,7 +260,7 @@ class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long :param message_body: The body of the chat message. :type message_body: str :param edit_time: The time at which the message was edited. @@ -274,15 +268,15 @@ class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, 'message_body': {'key': 'messageBody', 'type': 'str'}, 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, } @@ -291,24 +285,71 @@ def __init__( self, **kwargs ): - super(ACSChatMessageEditedEventData, self).__init__(**kwargs) + super(AcsChatMessageEditedEventData, self).__init__(**kwargs) self.message_body = kwargs.get('message_body', None) self.edit_time = kwargs.get('edit_time', None) -class ACSChatMessageReceivedEventData(ACSChatMessageEventBaseProperties): +class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEditedInThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param message_body: The body of the chat message. + :type message_body: str + :param edit_time: The time at which the message was edited. + :type edit_time: ~datetime.datetime + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatMessageEditedInThreadEventData, self).__init__(**kwargs) + self.message_body = kwargs.get('message_body', None) + self.edit_time = kwargs.get('edit_time', None) + + +class AcsChatMessageReceivedEventData(AcsChatMessageEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -316,21 +357,62 @@ class ACSChatMessageReceivedEventData(ACSChatMessageEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long :param message_body: The body of the chat message. :type message_body: str """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatMessageReceivedEventData, self).__init__(**kwargs) + self.message_body = kwargs.get('message_body', None) + + +class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceivedInThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param message_body: The body of the chat message. + :type message_body: str + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, 'message_body': {'key': 'messageBody', 'type': 'str'}, } @@ -338,15 +420,278 @@ def __init__( self, **kwargs ): - super(ACSChatMessageReceivedEventData, self).__init__(**kwargs) + super(AcsChatMessageReceivedInThreadEventData, self).__init__(**kwargs) self.message_body = kwargs.get('message_body', None) -class ACSChatThreadCreatedWithUserEventData(ACSChatThreadEventBaseProperties): +class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param time: The time at which the user was added to the thread. + :type time: ~datetime.datetime + :param added_by_communication_identifier: The communication identifier of the user who added + the user. + :type added_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_added: The details of the user who was added. + :type participant_added: ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_added': {'key': 'participantAdded', 'type': 'AcsChatThreadParticipantProperties'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatParticipantAddedToThreadEventData, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.added_by_communication_identifier = kwargs.get('added_by_communication_identifier', None) + self.participant_added = kwargs.get('participant_added', None) + self.version = kwargs.get('version', None) + + +class AcsChatThreadEventBaseProperties(AcsChatEventBaseProperties): + """Schema of common properties of all chat thread events. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatThreadEventBaseProperties, self).__init__(**kwargs) + self.create_time = kwargs.get('create_time', None) + self.version = kwargs.get('version', None) + + +class AcsChatParticipantAddedToThreadWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param time: The time at which the user was added to the thread. + :type time: ~datetime.datetime + :param added_by_communication_identifier: The communication identifier of the user who added + the user. + :type added_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_added: The details of the user who was added. + :type participant_added: ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_added': {'key': 'participantAdded', 'type': 'AcsChatThreadParticipantProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatParticipantAddedToThreadWithUserEventData, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.added_by_communication_identifier = kwargs.get('added_by_communication_identifier', None) + self.participant_added = kwargs.get('participant_added', None) + + +class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param time: The time at which the user was removed to the thread. + :type time: ~datetime.datetime + :param removed_by_communication_identifier: The communication identifier of the user who + removed the user. + :type removed_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_removed: The details of the user who was removed. + :type participant_removed: + ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_removed': {'key': 'participantRemoved', 'type': 'AcsChatThreadParticipantProperties'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatParticipantRemovedFromThreadEventData, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.removed_by_communication_identifier = kwargs.get('removed_by_communication_identifier', None) + self.participant_removed = kwargs.get('participant_removed', None) + self.version = kwargs.get('version', None) + + +class AcsChatParticipantRemovedFromThreadWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param time: The time at which the user was removed to the thread. + :type time: ~datetime.datetime + :param removed_by_communication_identifier: The communication identifier of the user who + removed the user. + :type removed_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_removed: The details of the user who was removed. + :type participant_removed: + ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_removed': {'key': 'participantRemoved', 'type': 'AcsChatThreadParticipantProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatParticipantRemovedFromThreadWithUserEventData, self).__init__(**kwargs) + self.time = kwargs.get('time', None) + self.removed_by_communication_identifier = kwargs.get('removed_by_communication_identifier', None) + self.participant_removed = kwargs.get('participant_removed', None) + + +class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): + """Schema of common properties of all chat thread events. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatThreadEventInThreadBaseProperties, self).__init__(**kwargs) + self.create_time = kwargs.get('create_time', None) + self.version = kwargs.get('version', None) + + +class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param created_by_communication_identifier: The communication identifier of the user who + created the thread. + :type created_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param properties: The thread properties. + :type properties: dict[str, object] + :param participants: The list of properties of participants who are part of the thread. + :type participants: + list[~event_grid_publisher_client.models.AcsChatThreadParticipantProperties] + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'created_by_communication_identifier': {'key': 'createdByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + 'participants': {'key': 'participants', 'type': '[AcsChatThreadParticipantProperties]'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatThreadCreatedEventData, self).__init__(**kwargs) + self.created_by_communication_identifier = kwargs.get('created_by_communication_identifier', None) + self.properties = kwargs.get('properties', None) + self.participants = kwargs.get('participants', None) + + +class AcsChatThreadCreatedWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -354,64 +699,141 @@ class ACSChatThreadCreatedWithUserEventData(ACSChatThreadEventBaseProperties): :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param created_by: The MRI of the creator of the thread. - :type created_by: str + :type version: long + :param created_by_communication_identifier: The communication identifier of the user who + created the thread. + :type created_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param properties: The thread properties. :type properties: dict[str, object] - :param members: The list of properties of users who are part of the thread. - :type members: list[~event_grid_publisher_client.models.ACSChatThreadMemberProperties] + :param participants: The list of properties of participants who are part of the thread. + :type participants: + list[~event_grid_publisher_client.models.AcsChatThreadParticipantProperties] """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'created_by_communication_identifier': {'key': 'createdByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'properties': {'key': 'properties', 'type': '{object}'}, - 'members': {'key': 'members', 'type': '[ACSChatThreadMemberProperties]'}, + 'participants': {'key': 'participants', 'type': '[AcsChatThreadParticipantProperties]'}, } def __init__( self, **kwargs ): - super(ACSChatThreadCreatedWithUserEventData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) + super(AcsChatThreadCreatedWithUserEventData, self).__init__(**kwargs) + self.created_by_communication_identifier = kwargs.get('created_by_communication_identifier', None) self.properties = kwargs.get('properties', None) - self.members = kwargs.get('members', None) + self.participants = kwargs.get('participants', None) + + +class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadDeleted event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param deleted_by_communication_identifier: The communication identifier of the user who + deleted the thread. + :type deleted_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param delete_time: The deletion time of the thread. + :type delete_time: ~datetime.datetime + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'deleted_by_communication_identifier': {'key': 'deletedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(AcsChatThreadDeletedEventData, self).__init__(**kwargs) + self.deleted_by_communication_identifier = kwargs.get('deleted_by_communication_identifier', None) + self.delete_time = kwargs.get('delete_time', None) -class ACSChatThreadMemberProperties(msrest.serialization.Model): - """Schema of the chat thread member. +class AcsChatThreadParticipantProperties(msrest.serialization.Model): + """Schema of the chat thread participant. :param display_name: The name of the user. :type display_name: str - :param member_id: The MRI of the user. - :type member_id: str + :param participant_communication_identifier: The communication identifier of the user. + :type participant_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, - 'member_id': {'key': 'memberId', 'type': 'str'}, + 'participant_communication_identifier': {'key': 'participantCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, } def __init__( self, **kwargs ): - super(ACSChatThreadMemberProperties, self).__init__(**kwargs) + super(AcsChatThreadParticipantProperties, self).__init__(**kwargs) self.display_name = kwargs.get('display_name', None) - self.member_id = kwargs.get('member_id', None) + self.participant_communication_identifier = kwargs.get('participant_communication_identifier', None) + + +class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdated event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param edited_by_communication_identifier: The communication identifier of the user who updated + the thread properties. + :type edited_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param edit_time: The time at which the properties of the thread were updated. + :type edit_time: ~datetime.datetime + :param properties: The updated thread properties. + :type properties: dict[str, object] + """ + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'edited_by_communication_identifier': {'key': 'editedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } -class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBaseProperties): + def __init__( + self, + **kwargs + ): + super(AcsChatThreadPropertiesUpdatedEventData, self).__init__(**kwargs) + self.edited_by_communication_identifier = kwargs.get('edited_by_communication_identifier', None) + self.edit_time = kwargs.get('edit_time', None) + self.properties = kwargs.get('properties', None) + + +class AcsChatThreadPropertiesUpdatedPerUserEventData(AcsChatThreadEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -419,9 +841,11 @@ class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBasePrope :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param edited_by: The MRI of the user who updated the thread properties. - :type edited_by: str + :type version: long + :param edited_by_communication_identifier: The communication identifier of the user who updated + the thread properties. + :type edited_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param edit_time: The time at which the properties of the thread were updated. :type edit_time: ~datetime.datetime :param properties: The updated thread properties. @@ -429,12 +853,12 @@ class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBasePrope """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'edited_by': {'key': 'editedBy', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'edited_by_communication_identifier': {'key': 'editedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': '{object}'}, } @@ -443,17 +867,18 @@ def __init__( self, **kwargs ): - super(ACSChatThreadPropertiesUpdatedPerUserEventData, self).__init__(**kwargs) - self.edited_by = kwargs.get('edited_by', None) + super(AcsChatThreadPropertiesUpdatedPerUserEventData, self).__init__(**kwargs) + self.edited_by_communication_identifier = kwargs.get('edited_by_communication_identifier', None) self.edit_time = kwargs.get('edit_time', None) self.properties = kwargs.get('properties', None) -class ACSChatThreadWithUserDeletedEventData(ACSChatThreadEventBaseProperties): +class AcsChatThreadWithUserDeletedEventData(AcsChatThreadEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -461,20 +886,22 @@ class ACSChatThreadWithUserDeletedEventData(ACSChatThreadEventBaseProperties): :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param deleted_by: The MRI of the user who deleted the thread. - :type deleted_by: str + :type version: long + :param deleted_by_communication_identifier: The communication identifier of the user who + deleted the thread. + :type deleted_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param delete_time: The deletion time of the thread. :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'deleted_by_communication_identifier': {'key': 'deletedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } @@ -482,12 +909,12 @@ def __init__( self, **kwargs ): - super(ACSChatThreadWithUserDeletedEventData, self).__init__(**kwargs) - self.deleted_by = kwargs.get('deleted_by', None) + super(AcsChatThreadWithUserDeletedEventData, self).__init__(**kwargs) + self.deleted_by_communication_identifier = kwargs.get('deleted_by_communication_identifier', None) self.delete_time = kwargs.get('delete_time', None) -class ACSSMSDeliveryAttemptProperties(msrest.serialization.Model): +class AcsSmsDeliveryAttemptProperties(msrest.serialization.Model): """Schema for details of a delivery attempt. :param timestamp: TimeStamp when delivery was attempted. @@ -508,13 +935,13 @@ def __init__( self, **kwargs ): - super(ACSSMSDeliveryAttemptProperties, self).__init__(**kwargs) + super(AcsSmsDeliveryAttemptProperties, self).__init__(**kwargs) self.timestamp = kwargs.get('timestamp', None) self.segments_succeeded = kwargs.get('segments_succeeded', None) self.segments_failed = kwargs.get('segments_failed', None) -class ACSSMSEventBaseProperties(msrest.serialization.Model): +class AcsSmsEventBaseProperties(msrest.serialization.Model): """Schema of common properties of all SMS events. :param message_id: The identity of the SMS message. @@ -535,13 +962,13 @@ def __init__( self, **kwargs ): - super(ACSSMSEventBaseProperties, self).__init__(**kwargs) + super(AcsSmsEventBaseProperties, self).__init__(**kwargs) self.message_id = kwargs.get('message_id', None) self.from_property = kwargs.get('from_property', None) self.to = kwargs.get('to', None) -class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): +class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. :param message_id: The identity of the SMS message. @@ -556,7 +983,7 @@ class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): :type delivery_status_details: str :param delivery_attempts: List of details of delivery attempts made. :type delivery_attempts: - list[~event_grid_publisher_client.models.ACSSMSDeliveryAttemptProperties] + list[~event_grid_publisher_client.models.AcsSmsDeliveryAttemptProperties] :param received_timestamp: The time at which the SMS delivery report was received. :type received_timestamp: ~datetime.datetime """ @@ -567,7 +994,7 @@ class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): 'to': {'key': 'to', 'type': 'str'}, 'delivery_status': {'key': 'deliveryStatus', 'type': 'str'}, 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, - 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[ACSSMSDeliveryAttemptProperties]'}, + 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[AcsSmsDeliveryAttemptProperties]'}, 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, } @@ -575,14 +1002,14 @@ def __init__( self, **kwargs ): - super(ACSSMSDeliveryReportReceivedEventData, self).__init__(**kwargs) + super(AcsSmsDeliveryReportReceivedEventData, self).__init__(**kwargs) self.delivery_status = kwargs.get('delivery_status', None) self.delivery_status_details = kwargs.get('delivery_status_details', None) self.delivery_attempts = kwargs.get('delivery_attempts', None) self.received_timestamp = kwargs.get('received_timestamp', None) -class ACSSMSReceivedEventData(ACSSMSEventBaseProperties): +class AcsSmsReceivedEventData(AcsSmsEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. :param message_id: The identity of the SMS message. @@ -609,7 +1036,7 @@ def __init__( self, **kwargs ): - super(ACSSMSReceivedEventData, self).__init__(**kwargs) + super(AcsSmsReceivedEventData, self).__init__(**kwargs) self.message = kwargs.get('message', None) self.received_timestamp = kwargs.get('received_timestamp', None) @@ -623,12 +1050,15 @@ class AppConfigurationKeyValueDeletedEventData(msrest.serialization.Model): :type label: str :param etag: The etag representing the key-value that was deleted. :type etag: str + :param sync_token: The sync token representing the server state after the event. + :type sync_token: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sync_token': {'key': 'syncToken', 'type': 'str'}, } def __init__( @@ -639,6 +1069,7 @@ def __init__( self.key = kwargs.get('key', None) self.label = kwargs.get('label', None) self.etag = kwargs.get('etag', None) + self.sync_token = kwargs.get('sync_token', None) class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): @@ -650,12 +1081,15 @@ class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): :type label: str :param etag: The etag representing the new state of the key-value. :type etag: str + :param sync_token: The sync token representing the server state after the event. + :type sync_token: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sync_token': {'key': 'syncToken', 'type': 'str'}, } def __init__( @@ -666,6 +1100,7 @@ def __init__( self.key = kwargs.get('key', None) self.label = kwargs.get('label', None) self.etag = kwargs.get('etag', None) + self.sync_token = kwargs.get('sync_token', None) class AppEventTypeDetail(msrest.serialization.Model): @@ -790,6 +1225,63 @@ def __init__( self.subject = kwargs.get('subject', None) +class CommunicationIdentifierModel(msrest.serialization.Model): + """Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. + + :param raw_id: Raw Id of the identifier. Optional in requests, required in responses. + :type raw_id: str + :param communication_user: The communication user. + :type communication_user: ~event_grid_publisher_client.models.CommunicationUserIdentifierModel + :param phone_number: The phone number. + :type phone_number: ~event_grid_publisher_client.models.PhoneNumberIdentifierModel + :param microsoft_teams_user: The Microsoft Teams user. + :type microsoft_teams_user: + ~event_grid_publisher_client.models.MicrosoftTeamsUserIdentifierModel + """ + + _attribute_map = { + 'raw_id': {'key': 'rawId', 'type': 'str'}, + 'communication_user': {'key': 'communicationUser', 'type': 'CommunicationUserIdentifierModel'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'PhoneNumberIdentifierModel'}, + 'microsoft_teams_user': {'key': 'microsoftTeamsUser', 'type': 'MicrosoftTeamsUserIdentifierModel'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunicationIdentifierModel, self).__init__(**kwargs) + self.raw_id = kwargs.get('raw_id', None) + self.communication_user = kwargs.get('communication_user', None) + self.phone_number = kwargs.get('phone_number', None) + self.microsoft_teams_user = kwargs.get('microsoft_teams_user', None) + + +class CommunicationUserIdentifierModel(msrest.serialization.Model): + """A user that got created with an Azure Communication Services resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The Id of the communication user. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunicationUserIdentifierModel, self).__init__(**kwargs) + self.id = kwargs['id'] + + class ContainerRegistryArtifactEventData(msrest.serialization.Model): """The content of the event request message. @@ -3637,6 +4129,67 @@ def __init__( self.discontinuity_gap = None +class MicrosoftTeamsUserIdentifierModel(msrest.serialization.Model): + """A Microsoft Teams user. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. The Id of the Microsoft Teams user. If not anonymous, this is the AAD + object Id of the user. + :type user_id: str + :param is_anonymous: True if the Microsoft Teams user is anonymous. By default false if + missing. + :type is_anonymous: bool + :param cloud: The cloud that the Microsoft Teams user belongs to. By default 'public' if + missing. Possible values include: "public", "dod", "gcch". + :type cloud: str or ~event_grid_publisher_client.models.CommunicationCloudEnvironmentModel + """ + + _validation = { + 'user_id': {'required': True}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, + 'cloud': {'key': 'cloud', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MicrosoftTeamsUserIdentifierModel, self).__init__(**kwargs) + self.user_id = kwargs['user_id'] + self.is_anonymous = kwargs.get('is_anonymous', None) + self.cloud = kwargs.get('cloud', None) + + +class PhoneNumberIdentifierModel(msrest.serialization.Model): + """A phone number. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The phone number in E.164 format. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PhoneNumberIdentifierModel, self).__init__(**kwargs) + self.value = kwargs['value'] + + class RedisExportRDBCompletedEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ExportRDBCompleted event. @@ -4276,6 +4829,49 @@ def __init__( self.http_request = kwargs.get('http_request', None) +class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. Could be one of + 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the entity type is of type + 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the entity type is of type + 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's subscription. If the + entity type is of type 'queue', then this value will be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData, self).__init__(**kwargs) + self.namespace_name = kwargs.get('namespace_name', None) + self.request_uri = kwargs.get('request_uri', None) + self.entity_type = kwargs.get('entity_type', None) + self.queue_name = kwargs.get('queue_name', None) + self.topic_name = kwargs.get('topic_name', None) + self.subscription_name = kwargs.get('subscription_name', None) + + class ServiceBusActiveMessagesAvailableWithNoListenersEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. @@ -4319,6 +4915,49 @@ def __init__( self.subscription_name = kwargs.get('subscription_name', None) +class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. Could be one of + 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the entity type is of type + 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the entity type is of type + 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's subscription. If the + entity type is of type 'queue', then this value will be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData, self).__init__(**kwargs) + self.namespace_name = kwargs.get('namespace_name', None) + self.request_uri = kwargs.get('request_uri', None) + self.entity_type = kwargs.get('entity_type', None) + self.queue_name = kwargs.get('queue_name', None) + self.topic_name = kwargs.get('topic_name', None) + self.subscription_name = kwargs.get('subscription_name', None) + + class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py index d42f73e45e78..43219b81e591 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models_py3.py @@ -14,11 +14,12 @@ from ._event_grid_publisher_client_enums import * -class ACSChatEventBaseProperties(msrest.serialization.Model): +class AcsChatEventBaseProperties(msrest.serialization.Model): """Schema of common properties of all chat events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -26,7 +27,7 @@ class ACSChatEventBaseProperties(msrest.serialization.Model): """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, } @@ -34,170 +35,167 @@ class ACSChatEventBaseProperties(msrest.serialization.Model): def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, **kwargs ): - super(ACSChatEventBaseProperties, self).__init__(**kwargs) - self.recipient_id = recipient_id + super(AcsChatEventBaseProperties, self).__init__(**kwargs) + self.recipient_communication_identifier = recipient_communication_identifier self.transaction_id = transaction_id self.thread_id = thread_id -class ACSChatThreadEventBaseProperties(ACSChatEventBaseProperties): - """Schema of common properties of all chat thread events. +class AcsChatEventInThreadBaseProperties(msrest.serialization.Model): + """Schema of common properties of all thread-level chat events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, } def __init__( self, *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, thread_id: Optional[str] = None, - create_time: Optional[datetime.datetime] = None, - version: Optional[int] = None, **kwargs ): - super(ACSChatThreadEventBaseProperties, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, **kwargs) - self.create_time = create_time - self.version = version + super(AcsChatEventInThreadBaseProperties, self).__init__(**kwargs) + self.thread_id = thread_id -class ACSChatMemberAddedToThreadWithUserEventData(ACSChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser event. +class AcsChatMessageEventBaseProperties(AcsChatEventBaseProperties): + """Schema of common properties of all chat message events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int - :param time: The time at which the user was added to the thread. - :type time: ~datetime.datetime - :param added_by: The MRI of the user who added the user. - :type added_by: str - :param member_added: The details of the user who was added. - :type member_added: ~event_grid_publisher_client.models.ACSChatThreadMemberProperties + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'added_by': {'key': 'addedBy', 'type': 'str'}, - 'member_added': {'key': 'memberAdded', 'type': 'ACSChatThreadMemberProperties'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, } def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, - create_time: Optional[datetime.datetime] = None, + message_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + sender_display_name: Optional[str] = None, + compose_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, version: Optional[int] = None, - time: Optional[datetime.datetime] = None, - added_by: Optional[str] = None, - member_added: Optional["ACSChatThreadMemberProperties"] = None, **kwargs ): - super(ACSChatMemberAddedToThreadWithUserEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) - self.time = time - self.added_by = added_by - self.member_added = member_added + super(AcsChatMessageEventBaseProperties, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, **kwargs) + self.message_id = message_id + self.sender_communication_identifier = sender_communication_identifier + self.sender_display_name = sender_display_name + self.compose_time = compose_time + self.type = type + self.version = version -class ACSChatMemberRemovedFromThreadWithUserEventData(ACSChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadWithUser event. +class AcsChatMessageDeletedEventData(AcsChatMessageEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param create_time: The original creation time of the thread. - :type create_time: ~datetime.datetime - :param version: The version of the thread. - :type version: int - :param time: The time at which the user was removed to the thread. - :type time: ~datetime.datetime - :param removed_by: The MRI of the user who removed the user. - :type removed_by: str - :param member_removed: The details of the user who was removed. - :type member_removed: ~event_grid_publisher_client.models.ACSChatThreadMemberProperties + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param delete_time: The time at which the message was deleted. + :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'removed_by': {'key': 'removedBy', 'type': 'str'}, - 'member_removed': {'key': 'memberRemoved', 'type': 'ACSChatThreadMemberProperties'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, - create_time: Optional[datetime.datetime] = None, + message_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + sender_display_name: Optional[str] = None, + compose_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, version: Optional[int] = None, - time: Optional[datetime.datetime] = None, - removed_by: Optional[str] = None, - member_removed: Optional["ACSChatThreadMemberProperties"] = None, + delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(ACSChatMemberRemovedFromThreadWithUserEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) - self.time = time - self.removed_by = removed_by - self.member_removed = member_removed + super(AcsChatMessageDeletedEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + self.delete_time = delete_time -class ACSChatMessageEventBaseProperties(ACSChatEventBaseProperties): - """Schema of common properties of all chat message events. +class AcsChatMessageEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): + """Schema of common properties of all thread-level chat message events. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -205,57 +203,50 @@ class ACSChatMessageEventBaseProperties(ACSChatEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, } def __init__( self, *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, - sender_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, sender_display_name: Optional[str] = None, compose_time: Optional[datetime.datetime] = None, type: Optional[str] = None, version: Optional[int] = None, **kwargs ): - super(ACSChatMessageEventBaseProperties, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, **kwargs) + super(AcsChatMessageEventInThreadBaseProperties, self).__init__(thread_id=thread_id, **kwargs) self.message_id = message_id - self.sender_id = sender_id + self.sender_communication_identifier = sender_communication_identifier self.sender_display_name = sender_display_name self.compose_time = compose_time self.type = type self.version = version -class ACSChatMessageDeletedEventData(ACSChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeleted event. +class AcsChatMessageDeletedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageDeletedInThread event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -263,32 +254,28 @@ class ACSChatMessageDeletedEventData(ACSChatMessageEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long :param delete_time: The time at which the message was deleted. :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } def __init__( self, *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, - sender_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, sender_display_name: Optional[str] = None, compose_time: Optional[datetime.datetime] = None, type: Optional[str] = None, @@ -296,23 +283,25 @@ def __init__( delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(ACSChatMessageDeletedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + super(AcsChatMessageDeletedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) self.delete_time = delete_time -class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): +class AcsChatMessageEditedEventData(AcsChatMessageEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEdited event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param message_id: The chat message id. :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param sender_display_name: The display name of the sender. :type sender_display_name: str :param compose_time: The original compose time of the message. @@ -320,7 +309,7 @@ class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): :param type: The type of the message. :type type: str :param version: The version of the message. - :type version: int + :type version: long :param message_body: The body of the chat message. :type message_body: str :param edit_time: The time at which the message was edited. @@ -328,15 +317,15 @@ class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, + 'version': {'key': 'version', 'type': 'long'}, 'message_body': {'key': 'messageBody', 'type': 'str'}, 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, } @@ -344,11 +333,11 @@ class ACSChatMessageEditedEventData(ACSChatMessageEventBaseProperties): def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, message_id: Optional[str] = None, - sender_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, sender_display_name: Optional[str] = None, compose_time: Optional[datetime.datetime] = None, type: Optional[str] = None, @@ -357,150 +346,657 @@ def __init__( edit_time: Optional[datetime.datetime] = None, **kwargs ): - super(ACSChatMessageEditedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) - self.message_body = message_body - self.edit_time = edit_time + super(AcsChatMessageEditedEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + self.message_body = message_body + self.edit_time = edit_time + + +class AcsChatMessageEditedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageEditedInThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param message_body: The body of the chat message. + :type message_body: str + :param edit_time: The time at which the message was edited. + :type edit_time: ~datetime.datetime + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + message_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + sender_display_name: Optional[str] = None, + compose_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, + version: Optional[int] = None, + message_body: Optional[str] = None, + edit_time: Optional[datetime.datetime] = None, + **kwargs + ): + super(AcsChatMessageEditedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + self.message_body = message_body + self.edit_time = edit_time + + +class AcsChatMessageReceivedEventData(AcsChatMessageEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param message_body: The body of the chat message. + :type message_body: str + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + } + + def __init__( + self, + *, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + transaction_id: Optional[str] = None, + thread_id: Optional[str] = None, + message_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + sender_display_name: Optional[str] = None, + compose_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, + version: Optional[int] = None, + message_body: Optional[str] = None, + **kwargs + ): + super(AcsChatMessageReceivedEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + self.message_body = message_body + + +class AcsChatMessageReceivedInThreadEventData(AcsChatMessageEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceivedInThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param message_id: The chat message id. + :type message_id: str + :param sender_communication_identifier: The communication identifier of the sender. + :type sender_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param sender_display_name: The display name of the sender. + :type sender_display_name: str + :param compose_time: The original compose time of the message. + :type compose_time: ~datetime.datetime + :param type: The type of the message. + :type type: str + :param version: The version of the message. + :type version: long + :param message_body: The body of the chat message. + :type message_body: str + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'message_id': {'key': 'messageId', 'type': 'str'}, + 'sender_communication_identifier': {'key': 'senderCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, + 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + message_id: Optional[str] = None, + sender_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + sender_display_name: Optional[str] = None, + compose_time: Optional[datetime.datetime] = None, + type: Optional[str] = None, + version: Optional[int] = None, + message_body: Optional[str] = None, + **kwargs + ): + super(AcsChatMessageReceivedInThreadEventData, self).__init__(thread_id=thread_id, message_id=message_id, sender_communication_identifier=sender_communication_identifier, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) + self.message_body = message_body + + +class AcsChatParticipantAddedToThreadEventData(AcsChatEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param time: The time at which the user was added to the thread. + :type time: ~datetime.datetime + :param added_by_communication_identifier: The communication identifier of the user who added + the user. + :type added_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_added: The details of the user who was added. + :type participant_added: ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_added': {'key': 'participantAdded', 'type': 'AcsChatThreadParticipantProperties'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + time: Optional[datetime.datetime] = None, + added_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + participant_added: Optional["AcsChatThreadParticipantProperties"] = None, + version: Optional[int] = None, + **kwargs + ): + super(AcsChatParticipantAddedToThreadEventData, self).__init__(thread_id=thread_id, **kwargs) + self.time = time + self.added_by_communication_identifier = added_by_communication_identifier + self.participant_added = participant_added + self.version = version + + +class AcsChatThreadEventBaseProperties(AcsChatEventBaseProperties): + """Schema of common properties of all chat thread events. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + *, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + transaction_id: Optional[str] = None, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + **kwargs + ): + super(AcsChatThreadEventBaseProperties, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, **kwargs) + self.create_time = create_time + self.version = version + + +class AcsChatParticipantAddedToThreadWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantAddedToThreadWithUser event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param time: The time at which the user was added to the thread. + :type time: ~datetime.datetime + :param added_by_communication_identifier: The communication identifier of the user who added + the user. + :type added_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_added: The details of the user who was added. + :type participant_added: ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'added_by_communication_identifier': {'key': 'addedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_added': {'key': 'participantAdded', 'type': 'AcsChatThreadParticipantProperties'}, + } + + def __init__( + self, + *, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + transaction_id: Optional[str] = None, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + time: Optional[datetime.datetime] = None, + added_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + participant_added: Optional["AcsChatThreadParticipantProperties"] = None, + **kwargs + ): + super(AcsChatParticipantAddedToThreadWithUserEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.time = time + self.added_by_communication_identifier = added_by_communication_identifier + self.participant_added = participant_added + + +class AcsChatParticipantRemovedFromThreadEventData(AcsChatEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThread event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param time: The time at which the user was removed to the thread. + :type time: ~datetime.datetime + :param removed_by_communication_identifier: The communication identifier of the user who + removed the user. + :type removed_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_removed: The details of the user who was removed. + :type participant_removed: + ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_removed': {'key': 'participantRemoved', 'type': 'AcsChatThreadParticipantProperties'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + time: Optional[datetime.datetime] = None, + removed_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + participant_removed: Optional["AcsChatThreadParticipantProperties"] = None, + version: Optional[int] = None, + **kwargs + ): + super(AcsChatParticipantRemovedFromThreadEventData, self).__init__(thread_id=thread_id, **kwargs) + self.time = time + self.removed_by_communication_identifier = removed_by_communication_identifier + self.participant_removed = participant_removed + self.version = version + + +class AcsChatParticipantRemovedFromThreadWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatParticipantRemovedFromThreadWithUser event. + + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param transaction_id: The transaction id will be used as co-relation vector. + :type transaction_id: str + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param time: The time at which the user was removed to the thread. + :type time: ~datetime.datetime + :param removed_by_communication_identifier: The communication identifier of the user who + removed the user. + :type removed_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param participant_removed: The details of the user who was removed. + :type participant_removed: + ~event_grid_publisher_client.models.AcsChatThreadParticipantProperties + """ + + _attribute_map = { + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'transaction_id': {'key': 'transactionId', 'type': 'str'}, + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'time': {'key': 'time', 'type': 'iso-8601'}, + 'removed_by_communication_identifier': {'key': 'removedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'participant_removed': {'key': 'participantRemoved', 'type': 'AcsChatThreadParticipantProperties'}, + } + + def __init__( + self, + *, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + transaction_id: Optional[str] = None, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + time: Optional[datetime.datetime] = None, + removed_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + participant_removed: Optional["AcsChatThreadParticipantProperties"] = None, + **kwargs + ): + super(AcsChatParticipantRemovedFromThreadWithUserEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.time = time + self.removed_by_communication_identifier = removed_by_communication_identifier + self.participant_removed = participant_removed + + +class AcsChatThreadEventInThreadBaseProperties(AcsChatEventInThreadBaseProperties): + """Schema of common properties of all chat thread events. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + **kwargs + ): + super(AcsChatThreadEventInThreadBaseProperties, self).__init__(thread_id=thread_id, **kwargs) + self.create_time = create_time + self.version = version + + +class AcsChatThreadCreatedEventData(AcsChatThreadEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param created_by_communication_identifier: The communication identifier of the user who + created the thread. + :type created_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param properties: The thread properties. + :type properties: dict[str, object] + :param participants: The list of properties of participants who are part of the thread. + :type participants: + list[~event_grid_publisher_client.models.AcsChatThreadParticipantProperties] + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'created_by_communication_identifier': {'key': 'createdByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + 'participants': {'key': 'participants', 'type': '[AcsChatThreadParticipantProperties]'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + created_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + properties: Optional[Dict[str, object]] = None, + participants: Optional[List["AcsChatThreadParticipantProperties"]] = None, + **kwargs + ): + super(AcsChatThreadCreatedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.created_by_communication_identifier = created_by_communication_identifier + self.properties = properties + self.participants = participants -class ACSChatMessageReceivedEventData(ACSChatMessageEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMessageReceived event. +class AcsChatThreadCreatedWithUserEventData(AcsChatThreadEventBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str - :param message_id: The chat message id. - :type message_id: str - :param sender_id: The MRI of the sender. - :type sender_id: str - :param sender_display_name: The display name of the sender. - :type sender_display_name: str - :param compose_time: The original compose time of the message. - :type compose_time: ~datetime.datetime - :param type: The type of the message. - :type type: str - :param version: The version of the message. - :type version: int - :param message_body: The body of the chat message. - :type message_body: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param created_by_communication_identifier: The communication identifier of the user who + created the thread. + :type created_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param properties: The thread properties. + :type properties: dict[str, object] + :param participants: The list of properties of participants who are part of the thread. + :type participants: + list[~event_grid_publisher_client.models.AcsChatThreadParticipantProperties] """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'type': {'key': 'type', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'created_by_communication_identifier': {'key': 'createdByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + 'participants': {'key': 'participants', 'type': '[AcsChatThreadParticipantProperties]'}, } def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, - message_id: Optional[str] = None, - sender_id: Optional[str] = None, - sender_display_name: Optional[str] = None, - compose_time: Optional[datetime.datetime] = None, - type: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, - message_body: Optional[str] = None, + created_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + properties: Optional[Dict[str, object]] = None, + participants: Optional[List["AcsChatThreadParticipantProperties"]] = None, **kwargs ): - super(ACSChatMessageReceivedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, type=type, version=version, **kwargs) - self.message_body = message_body + super(AcsChatThreadCreatedWithUserEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.created_by_communication_identifier = created_by_communication_identifier + self.properties = properties + self.participants = participants -class ACSChatThreadCreatedWithUserEventData(ACSChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadCreatedWithUser event. +class AcsChatThreadDeletedEventData(AcsChatThreadEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadDeleted event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str - :param transaction_id: The transaction id will be used as co-relation vector. - :type transaction_id: str :param thread_id: The chat thread id. :type thread_id: str :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param created_by: The MRI of the creator of the thread. - :type created_by: str - :param properties: The thread properties. - :type properties: dict[str, object] - :param members: The list of properties of users who are part of the thread. - :type members: list[~event_grid_publisher_client.models.ACSChatThreadMemberProperties] + :type version: long + :param deleted_by_communication_identifier: The communication identifier of the user who + deleted the thread. + :type deleted_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param delete_time: The deletion time of the thread. + :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'members': {'key': 'members', 'type': '[ACSChatThreadMemberProperties]'}, + 'version': {'key': 'version', 'type': 'long'}, + 'deleted_by_communication_identifier': {'key': 'deletedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } def __init__( self, *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, - created_by: Optional[str] = None, - properties: Optional[Dict[str, object]] = None, - members: Optional[List["ACSChatThreadMemberProperties"]] = None, + deleted_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(ACSChatThreadCreatedWithUserEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) - self.created_by = created_by - self.properties = properties - self.members = members + super(AcsChatThreadDeletedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.deleted_by_communication_identifier = deleted_by_communication_identifier + self.delete_time = delete_time -class ACSChatThreadMemberProperties(msrest.serialization.Model): - """Schema of the chat thread member. +class AcsChatThreadParticipantProperties(msrest.serialization.Model): + """Schema of the chat thread participant. :param display_name: The name of the user. :type display_name: str - :param member_id: The MRI of the user. - :type member_id: str + :param participant_communication_identifier: The communication identifier of the user. + :type participant_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, - 'member_id': {'key': 'memberId', 'type': 'str'}, + 'participant_communication_identifier': {'key': 'participantCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, } def __init__( self, *, display_name: Optional[str] = None, - member_id: Optional[str] = None, + participant_communication_identifier: Optional["CommunicationIdentifierModel"] = None, **kwargs ): - super(ACSChatThreadMemberProperties, self).__init__(**kwargs) + super(AcsChatThreadParticipantProperties, self).__init__(**kwargs) self.display_name = display_name - self.member_id = member_id + self.participant_communication_identifier = participant_communication_identifier + + +class AcsChatThreadPropertiesUpdatedEventData(AcsChatThreadEventInThreadBaseProperties): + """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdated event. + + :param thread_id: The chat thread id. + :type thread_id: str + :param create_time: The original creation time of the thread. + :type create_time: ~datetime.datetime + :param version: The version of the thread. + :type version: long + :param edited_by_communication_identifier: The communication identifier of the user who updated + the thread properties. + :type edited_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel + :param edit_time: The time at which the properties of the thread were updated. + :type edit_time: ~datetime.datetime + :param properties: The updated thread properties. + :type properties: dict[str, object] + """ + + _attribute_map = { + 'thread_id': {'key': 'threadId', 'type': 'str'}, + 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, + 'version': {'key': 'version', 'type': 'long'}, + 'edited_by_communication_identifier': {'key': 'editedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, + 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__( + self, + *, + thread_id: Optional[str] = None, + create_time: Optional[datetime.datetime] = None, + version: Optional[int] = None, + edited_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, + edit_time: Optional[datetime.datetime] = None, + properties: Optional[Dict[str, object]] = None, + **kwargs + ): + super(AcsChatThreadPropertiesUpdatedEventData, self).__init__(thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.edited_by_communication_identifier = edited_by_communication_identifier + self.edit_time = edit_time + self.properties = properties -class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBaseProperties): +class AcsChatThreadPropertiesUpdatedPerUserEventData(AcsChatThreadEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadPropertiesUpdatedPerUser event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -508,9 +1004,11 @@ class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBasePrope :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param edited_by: The MRI of the user who updated the thread properties. - :type edited_by: str + :type version: long + :param edited_by_communication_identifier: The communication identifier of the user who updated + the thread properties. + :type edited_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param edit_time: The time at which the properties of the thread were updated. :type edit_time: ~datetime.datetime :param properties: The updated thread properties. @@ -518,12 +1016,12 @@ class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBasePrope """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'edited_by': {'key': 'editedBy', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'edited_by_communication_identifier': {'key': 'editedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': '{object}'}, } @@ -531,27 +1029,28 @@ class ACSChatThreadPropertiesUpdatedPerUserEventData(ACSChatThreadEventBasePrope def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, - edited_by: Optional[str] = None, + edited_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, edit_time: Optional[datetime.datetime] = None, properties: Optional[Dict[str, object]] = None, **kwargs ): - super(ACSChatThreadPropertiesUpdatedPerUserEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) - self.edited_by = edited_by + super(AcsChatThreadPropertiesUpdatedPerUserEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.edited_by_communication_identifier = edited_by_communication_identifier self.edit_time = edit_time self.properties = properties -class ACSChatThreadWithUserDeletedEventData(ACSChatThreadEventBaseProperties): +class AcsChatThreadWithUserDeletedEventData(AcsChatThreadEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatThreadWithUserDeleted event. - :param recipient_id: The MRI of the target user. - :type recipient_id: str + :param recipient_communication_identifier: The communication identifier of the target user. + :type recipient_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param transaction_id: The transaction id will be used as co-relation vector. :type transaction_id: str :param thread_id: The chat thread id. @@ -559,41 +1058,43 @@ class ACSChatThreadWithUserDeletedEventData(ACSChatThreadEventBaseProperties): :param create_time: The original creation time of the thread. :type create_time: ~datetime.datetime :param version: The version of the thread. - :type version: int - :param deleted_by: The MRI of the user who deleted the thread. - :type deleted_by: str + :type version: long + :param deleted_by_communication_identifier: The communication identifier of the user who + deleted the thread. + :type deleted_by_communication_identifier: + ~event_grid_publisher_client.models.CommunicationIdentifierModel :param delete_time: The deletion time of the thread. :type delete_time: ~datetime.datetime """ _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, + 'recipient_communication_identifier': {'key': 'recipientCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'transaction_id': {'key': 'transactionId', 'type': 'str'}, 'thread_id': {'key': 'threadId', 'type': 'str'}, 'create_time': {'key': 'createTime', 'type': 'iso-8601'}, - 'version': {'key': 'version', 'type': 'int'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'long'}, + 'deleted_by_communication_identifier': {'key': 'deletedByCommunicationIdentifier', 'type': 'CommunicationIdentifierModel'}, 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, } def __init__( self, *, - recipient_id: Optional[str] = None, + recipient_communication_identifier: Optional["CommunicationIdentifierModel"] = None, transaction_id: Optional[str] = None, thread_id: Optional[str] = None, create_time: Optional[datetime.datetime] = None, version: Optional[int] = None, - deleted_by: Optional[str] = None, + deleted_by_communication_identifier: Optional["CommunicationIdentifierModel"] = None, delete_time: Optional[datetime.datetime] = None, **kwargs ): - super(ACSChatThreadWithUserDeletedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) - self.deleted_by = deleted_by + super(AcsChatThreadWithUserDeletedEventData, self).__init__(recipient_communication_identifier=recipient_communication_identifier, transaction_id=transaction_id, thread_id=thread_id, create_time=create_time, version=version, **kwargs) + self.deleted_by_communication_identifier = deleted_by_communication_identifier self.delete_time = delete_time -class ACSSMSDeliveryAttemptProperties(msrest.serialization.Model): +class AcsSmsDeliveryAttemptProperties(msrest.serialization.Model): """Schema for details of a delivery attempt. :param timestamp: TimeStamp when delivery was attempted. @@ -618,13 +1119,13 @@ def __init__( segments_failed: Optional[int] = None, **kwargs ): - super(ACSSMSDeliveryAttemptProperties, self).__init__(**kwargs) + super(AcsSmsDeliveryAttemptProperties, self).__init__(**kwargs) self.timestamp = timestamp self.segments_succeeded = segments_succeeded self.segments_failed = segments_failed -class ACSSMSEventBaseProperties(msrest.serialization.Model): +class AcsSmsEventBaseProperties(msrest.serialization.Model): """Schema of common properties of all SMS events. :param message_id: The identity of the SMS message. @@ -649,13 +1150,13 @@ def __init__( to: Optional[str] = None, **kwargs ): - super(ACSSMSEventBaseProperties, self).__init__(**kwargs) + super(AcsSmsEventBaseProperties, self).__init__(**kwargs) self.message_id = message_id self.from_property = from_property self.to = to -class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): +class AcsSmsDeliveryReportReceivedEventData(AcsSmsEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. :param message_id: The identity of the SMS message. @@ -670,7 +1171,7 @@ class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): :type delivery_status_details: str :param delivery_attempts: List of details of delivery attempts made. :type delivery_attempts: - list[~event_grid_publisher_client.models.ACSSMSDeliveryAttemptProperties] + list[~event_grid_publisher_client.models.AcsSmsDeliveryAttemptProperties] :param received_timestamp: The time at which the SMS delivery report was received. :type received_timestamp: ~datetime.datetime """ @@ -681,7 +1182,7 @@ class ACSSMSDeliveryReportReceivedEventData(ACSSMSEventBaseProperties): 'to': {'key': 'to', 'type': 'str'}, 'delivery_status': {'key': 'deliveryStatus', 'type': 'str'}, 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, - 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[ACSSMSDeliveryAttemptProperties]'}, + 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[AcsSmsDeliveryAttemptProperties]'}, 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, } @@ -693,18 +1194,18 @@ def __init__( to: Optional[str] = None, delivery_status: Optional[str] = None, delivery_status_details: Optional[str] = None, - delivery_attempts: Optional[List["ACSSMSDeliveryAttemptProperties"]] = None, + delivery_attempts: Optional[List["AcsSmsDeliveryAttemptProperties"]] = None, received_timestamp: Optional[datetime.datetime] = None, **kwargs ): - super(ACSSMSDeliveryReportReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) + super(AcsSmsDeliveryReportReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) self.delivery_status = delivery_status self.delivery_status_details = delivery_status_details self.delivery_attempts = delivery_attempts self.received_timestamp = received_timestamp -class ACSSMSReceivedEventData(ACSSMSEventBaseProperties): +class AcsSmsReceivedEventData(AcsSmsEventBaseProperties): """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. :param message_id: The identity of the SMS message. @@ -737,7 +1238,7 @@ def __init__( received_timestamp: Optional[datetime.datetime] = None, **kwargs ): - super(ACSSMSReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) + super(AcsSmsReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) self.message = message self.received_timestamp = received_timestamp @@ -751,12 +1252,15 @@ class AppConfigurationKeyValueDeletedEventData(msrest.serialization.Model): :type label: str :param etag: The etag representing the key-value that was deleted. :type etag: str + :param sync_token: The sync token representing the server state after the event. + :type sync_token: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sync_token': {'key': 'syncToken', 'type': 'str'}, } def __init__( @@ -765,12 +1269,14 @@ def __init__( key: Optional[str] = None, label: Optional[str] = None, etag: Optional[str] = None, + sync_token: Optional[str] = None, **kwargs ): super(AppConfigurationKeyValueDeletedEventData, self).__init__(**kwargs) self.key = key self.label = label self.etag = etag + self.sync_token = sync_token class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): @@ -782,12 +1288,15 @@ class AppConfigurationKeyValueModifiedEventData(msrest.serialization.Model): :type label: str :param etag: The etag representing the new state of the key-value. :type etag: str + :param sync_token: The sync token representing the server state after the event. + :type sync_token: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'sync_token': {'key': 'syncToken', 'type': 'str'}, } def __init__( @@ -796,12 +1305,14 @@ def __init__( key: Optional[str] = None, label: Optional[str] = None, etag: Optional[str] = None, + sync_token: Optional[str] = None, **kwargs ): super(AppConfigurationKeyValueModifiedEventData, self).__init__(**kwargs) self.key = key self.label = label self.etag = etag + self.sync_token = sync_token class AppEventTypeDetail(msrest.serialization.Model): @@ -944,6 +1455,70 @@ def __init__( self.subject = subject +class CommunicationIdentifierModel(msrest.serialization.Model): + """Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model must be interpreted as a union: Apart from rawId, at most one further property may be set. + + :param raw_id: Raw Id of the identifier. Optional in requests, required in responses. + :type raw_id: str + :param communication_user: The communication user. + :type communication_user: ~event_grid_publisher_client.models.CommunicationUserIdentifierModel + :param phone_number: The phone number. + :type phone_number: ~event_grid_publisher_client.models.PhoneNumberIdentifierModel + :param microsoft_teams_user: The Microsoft Teams user. + :type microsoft_teams_user: + ~event_grid_publisher_client.models.MicrosoftTeamsUserIdentifierModel + """ + + _attribute_map = { + 'raw_id': {'key': 'rawId', 'type': 'str'}, + 'communication_user': {'key': 'communicationUser', 'type': 'CommunicationUserIdentifierModel'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'PhoneNumberIdentifierModel'}, + 'microsoft_teams_user': {'key': 'microsoftTeamsUser', 'type': 'MicrosoftTeamsUserIdentifierModel'}, + } + + def __init__( + self, + *, + raw_id: Optional[str] = None, + communication_user: Optional["CommunicationUserIdentifierModel"] = None, + phone_number: Optional["PhoneNumberIdentifierModel"] = None, + microsoft_teams_user: Optional["MicrosoftTeamsUserIdentifierModel"] = None, + **kwargs + ): + super(CommunicationIdentifierModel, self).__init__(**kwargs) + self.raw_id = raw_id + self.communication_user = communication_user + self.phone_number = phone_number + self.microsoft_teams_user = microsoft_teams_user + + +class CommunicationUserIdentifierModel(msrest.serialization.Model): + """A user that got created with an Azure Communication Services resource. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The Id of the communication user. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + **kwargs + ): + super(CommunicationUserIdentifierModel, self).__init__(**kwargs) + self.id = id + + class ContainerRegistryArtifactEventData(msrest.serialization.Model): """The content of the event request message. @@ -4130,6 +4705,73 @@ def __init__( self.discontinuity_gap = None +class MicrosoftTeamsUserIdentifierModel(msrest.serialization.Model): + """A Microsoft Teams user. + + All required parameters must be populated in order to send to Azure. + + :param user_id: Required. The Id of the Microsoft Teams user. If not anonymous, this is the AAD + object Id of the user. + :type user_id: str + :param is_anonymous: True if the Microsoft Teams user is anonymous. By default false if + missing. + :type is_anonymous: bool + :param cloud: The cloud that the Microsoft Teams user belongs to. By default 'public' if + missing. Possible values include: "public", "dod", "gcch". + :type cloud: str or ~event_grid_publisher_client.models.CommunicationCloudEnvironmentModel + """ + + _validation = { + 'user_id': {'required': True}, + } + + _attribute_map = { + 'user_id': {'key': 'userId', 'type': 'str'}, + 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, + 'cloud': {'key': 'cloud', 'type': 'str'}, + } + + def __init__( + self, + *, + user_id: str, + is_anonymous: Optional[bool] = None, + cloud: Optional[Union[str, "CommunicationCloudEnvironmentModel"]] = None, + **kwargs + ): + super(MicrosoftTeamsUserIdentifierModel, self).__init__(**kwargs) + self.user_id = user_id + self.is_anonymous = is_anonymous + self.cloud = cloud + + +class PhoneNumberIdentifierModel(msrest.serialization.Model): + """A phone number. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The phone number in E.164 format. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + value: str, + **kwargs + ): + super(PhoneNumberIdentifierModel, self).__init__(**kwargs) + self.value = value + + class RedisExportRDBCompletedEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an Microsoft.Cache.ExportRDBCompleted event. @@ -4893,6 +5535,56 @@ def __init__( self.http_request = http_request +class ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailablePeriodicNotifications event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. Could be one of + 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the entity type is of type + 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the entity type is of type + 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's subscription. If the + entity type is of type 'queue', then this value will be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__( + self, + *, + namespace_name: Optional[str] = None, + request_uri: Optional[str] = None, + entity_type: Optional[str] = None, + queue_name: Optional[str] = None, + topic_name: Optional[str] = None, + subscription_name: Optional[str] = None, + **kwargs + ): + super(ServiceBusActiveMessagesAvailablePeriodicNotificationsEventData, self).__init__(**kwargs) + self.namespace_name = namespace_name + self.request_uri = request_uri + self.entity_type = entity_type + self.queue_name = queue_name + self.topic_name = topic_name + self.subscription_name = subscription_name + + class ServiceBusActiveMessagesAvailableWithNoListenersEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. @@ -4943,6 +5635,56 @@ def __init__( self.subscription_name = subscription_name +class ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailablePeriodicNotifications event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. Could be one of + 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the entity type is of type + 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the entity type is of type + 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's subscription. If the + entity type is of type 'queue', then this value will be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__( + self, + *, + namespace_name: Optional[str] = None, + request_uri: Optional[str] = None, + entity_type: Optional[str] = None, + queue_name: Optional[str] = None, + topic_name: Optional[str] = None, + subscription_name: Optional[str] = None, + **kwargs + ): + super(ServiceBusDeadletterMessagesAvailablePeriodicNotificationsEventData, self).__init__(**kwargs) + self.namespace_name = namespace_name + self.request_uri = request_uri + self.entity_type = entity_type + self.queue_name = queue_name + self.topic_name = topic_name + self.subscription_name = subscription_name + + class ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for a Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py index 2e894cbcd5d5..24de6628e62f 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/operations/_event_grid_publisher_client_operations.py @@ -8,11 +8,11 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -26,7 +26,7 @@ class EventGridPublisherClientOperationsMixin(object): def publish_events( self, topic_hostname, # type: str - events, # type: List["models.EventGridEvent"] + events, # type: List["_models.EventGridEvent"] **kwargs # type: Any ): # type: (...) -> None @@ -42,7 +42,9 @@ def publish_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/json") @@ -66,7 +68,6 @@ def publish_events( body_content = self._serialize.body(events, '[EventGridEvent]') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -82,7 +83,7 @@ def publish_events( def publish_cloud_event_events( self, topic_hostname, # type: str - events, # type: List["models.CloudEvent"] + events, # type: List["_models.CloudEvent"] **kwargs # type: Any ): # type: (...) -> None @@ -98,7 +99,9 @@ def publish_cloud_event_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/cloudevents-batch+json; charset=utf-8") @@ -122,7 +125,6 @@ def publish_cloud_event_events( body_content = self._serialize.body(events, '[CloudEvent]') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -154,7 +156,9 @@ def publish_custom_event_events( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" content_type = kwargs.pop("content_type", "application/json") @@ -178,7 +182,6 @@ def publish_custom_event_events( body_content = self._serialize.body(events, '[object]') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md index 2fe605e17b5e..adc05e03307e 100644 --- a/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md +++ b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md @@ -13,8 +13,8 @@ no-namespace-folders: true output-folder: ../azure/eventgrid/_generated source-code-folder-path: ./azure/eventgrid/_generated input-file: - - https://github.com/ellismg/azure-rest-api-specs/blob/4bb5b76cb8401896b15f1be3fdaac6bd5d299b17/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json - - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json + - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json + - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.AppConfiguration/stable/2018-01-01/AppConfiguration.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Cache/stable/2018-01-01/RedisCache.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json @@ -27,10 +27,10 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Resources/stable/2018-01-01/Resources.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.ServiceBus/stable/2018-01-01/ServiceBus.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.SignalRService/stable/2018-01-01/SignalRService.json + - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Storage/stable/2018-01-01/Storage.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Web/stable/2018-01-01/Web.json - - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Communication/stable/2018-01-01/AzureCommunicationServices.json python: true v3: true -use: "@autorest/python@5.1.0-preview.7" +use: "@autorest/python@5.6.4" ``` \ No newline at end of file diff --git a/sdk/eventgrid/azure-eventgrid/tests/test_serialization.py b/sdk/eventgrid/azure-eventgrid/tests/test_serialization.py index 5bed9c1c9212..d84d61f55cb4 100644 --- a/sdk/eventgrid/azure-eventgrid/tests/test_serialization.py +++ b/sdk/eventgrid/azure-eventgrid/tests/test_serialization.py @@ -112,7 +112,7 @@ def test_event_grid_event_raises_on_no_data(self): ) def test_import_from_sytem_events(self): - var = SystemEventNames.ACSChatMemberAddedToThreadWithUserEventName + var = SystemEventNames.AcsChatMemberAddedToThreadWithUserEventName assert var == "Microsoft.Communication.ChatMemberAddedToThreadWithUser" assert SystemEventNames.KeyVaultKeyNearExpiryEventName == "Microsoft.KeyVault.KeyNearExpiry" var = SystemEventNames.ServiceBusActiveMessagesAvailableWithNoListenersEventName