From b9f34c8c28a472448341fa71bbd312d08db02513 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Fri, 4 Sep 2020 12:17:25 -0700 Subject: [PATCH 1/3] Regenrate swagger --- .../eventgrid/_generated/aio/__init__.py | 2 +- .../_generated/aio/_configuration.py | 46 + .../aio/_event_grid_publisher_client.py | 45 + .../_generated/aio/operations/__init__.py | 13 + ..._event_grid_publisher_client_operations.py | 182 ++++ .../eventgrid/_generated/models/__init__.py | 51 +- .../eventgrid/_generated/models/_models.py | 673 +-------------- .../_generated/models/_models_py3.py | 812 ++---------------- ..._event_grid_publisher_client_operations.py | 3 - .../swagger/README.PYTHON_T2.md | 5 +- 10 files changed, 386 insertions(+), 1446 deletions(-) create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/__init__.py create mode 100644 sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py 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/_configuration.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration.py new file mode 100644 index 000000000000..2fe719e6da1c --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_configuration.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +VERSION = "unknown" + +class EventGridPublisherClientConfiguration(Configuration): + """Configuration for EventGridPublisherClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + super(EventGridPublisherClientConfiguration, self).__init__(**kwargs) + + self.api_version = "2018-01-01" + kwargs.setdefault('sdk_moniker', 'eventgridpublisherclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') 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 new file mode 100644 index 000000000000..e09e5d1c10c7 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/_event_grid_publisher_client.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration import EventGridPublisherClientConfiguration +from .operations import EventGridPublisherClientOperationsMixin +from .. import models + + +class EventGridPublisherClient(EventGridPublisherClientOperationsMixin): + """EventGrid Python Publisher Client. + + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + base_url = 'https://{topicHostname}' + self._config = EventGridPublisherClientConfiguration(**kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "EventGridPublisherClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/__init__.py new file mode 100644 index 000000000000..842b4ec6d735 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._event_grid_publisher_client_operations import EventGridPublisherClientOperationsMixin + +__all__ = [ + 'EventGridPublisherClientOperationsMixin', +] 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 new file mode 100644 index 000000000000..151e83d4b3b0 --- /dev/null +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/aio/operations/_event_grid_publisher_client_operations.py @@ -0,0 +1,182 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +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.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EventGridPublisherClientOperationsMixin: + + async def publish_events( + self, + topic_hostname: str, + events: List["models.EventGridEvent"], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.EventGridEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + 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 = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_events.metadata = {'url': '/api/events'} # type: ignore + + async def publish_cloud_event_events( + self, + topic_hostname: str, + events: List["models.CloudEvent"], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[~event_grid_publisher_client.models.CloudEvent] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {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") + + # Construct URL + url = self.publish_cloud_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + 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 = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_cloud_event_events.metadata = {'url': '/api/events'} # type: ignore + + async def publish_custom_event_events( + self, + topic_hostname: str, + events: List[object], + **kwargs + ) -> None: + """Publishes a batch of events to an Azure Event Grid topic. + + :param topic_hostname: The host name of the topic, e.g. topic1.westus2-1.eventgrid.azure.net. + :type topic_hostname: str + :param events: An array of events to be published to Event Grid. + :type events: list[object] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-01-01" + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.publish_custom_event_events.metadata['url'] # type: ignore + path_format_arguments = { + 'topicHostname': self._serialize.url("topic_hostname", topic_hostname, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + 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 = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) + + publish_custom_event_events.metadata = {'url': '/api/events'} # type: ignore 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 884541520e44..efdada6fd12e 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/__init__.py @@ -11,18 +11,6 @@ from ._models_py3 import AppConfigurationKeyValueModifiedEventData from ._models_py3 import AppEventTypeDetail from ._models_py3 import AppServicePlanEventTypeDetail - from ._models_py3 import ChatEventBaseProperties - from ._models_py3 import ChatMemberAddedToThreadWithUserEventData - from ._models_py3 import ChatMemberRemovedFromThreadForWithUserEventData - from ._models_py3 import ChatMessageDeletedEventData - from ._models_py3 import ChatMessageEditedEventData - from ._models_py3 import ChatMessageEventBaseProperties - from ._models_py3 import ChatMessageReceivedEventData - from ._models_py3 import ChatThreadCreatedWithUserEventData - from ._models_py3 import ChatThreadEventBaseProperties - from ._models_py3 import ChatThreadMemberProperties - from ._models_py3 import ChatThreadPropertiesUpdatedPerUserEventData - from ._models_py3 import ChatThreadWithUserDeletedEventData from ._models_py3 import CloudEvent from ._models_py3 import ContainerRegistryArtifactEventData from ._models_py3 import ContainerRegistryArtifactEventTarget @@ -51,6 +39,7 @@ from ._models_py3 import IotHubDeviceDeletedEventData from ._models_py3 import IotHubDeviceDisconnectedEventData from ._models_py3 import IotHubDeviceTelemetryEventData + from ._models_py3 import KeyVaultAccessPolicyChangedEventData from ._models_py3 import KeyVaultCertificateExpiredEventData from ._models_py3 import KeyVaultCertificateNearExpiryEventData from ._models_py3 import KeyVaultCertificateNewVersionCreatedEventData @@ -111,10 +100,6 @@ from ._models_py3 import ResourceWriteCancelData from ._models_py3 import ResourceWriteFailureData from ._models_py3 import ResourceWriteSuccessData - from ._models_py3 import SMSDeliveryAttemptProperties - from ._models_py3 import SMSDeliveryReportReceivedEventData - from ._models_py3 import SMSEventBaseProperties - from ._models_py3 import SMSReceivedEventData from ._models_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData from ._models_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData from ._models_py3 import SignalRServiceClientConnectionConnectedEventData @@ -149,18 +134,6 @@ from ._models import AppConfigurationKeyValueModifiedEventData # type: ignore from ._models import AppEventTypeDetail # type: ignore from ._models import AppServicePlanEventTypeDetail # type: ignore - from ._models import ChatEventBaseProperties # type: ignore - from ._models import ChatMemberAddedToThreadWithUserEventData # type: ignore - from ._models import ChatMemberRemovedFromThreadForWithUserEventData # type: ignore - from ._models import ChatMessageDeletedEventData # type: ignore - from ._models import ChatMessageEditedEventData # type: ignore - from ._models import ChatMessageEventBaseProperties # type: ignore - from ._models import ChatMessageReceivedEventData # type: ignore - from ._models import ChatThreadCreatedWithUserEventData # type: ignore - from ._models import ChatThreadEventBaseProperties # type: ignore - from ._models import ChatThreadMemberProperties # type: ignore - from ._models import ChatThreadPropertiesUpdatedPerUserEventData # type: ignore - from ._models import ChatThreadWithUserDeletedEventData # type: ignore from ._models import CloudEvent # type: ignore from ._models import ContainerRegistryArtifactEventData # type: ignore from ._models import ContainerRegistryArtifactEventTarget # type: ignore @@ -189,6 +162,7 @@ from ._models import IotHubDeviceDeletedEventData # type: ignore from ._models import IotHubDeviceDisconnectedEventData # type: ignore from ._models import IotHubDeviceTelemetryEventData # type: ignore + from ._models import KeyVaultAccessPolicyChangedEventData # type: ignore from ._models import KeyVaultCertificateExpiredEventData # type: ignore from ._models import KeyVaultCertificateNearExpiryEventData # type: ignore from ._models import KeyVaultCertificateNewVersionCreatedEventData # type: ignore @@ -249,10 +223,6 @@ from ._models import ResourceWriteCancelData # type: ignore from ._models import ResourceWriteFailureData # type: ignore from ._models import ResourceWriteSuccessData # type: ignore - from ._models import SMSDeliveryAttemptProperties # type: ignore - from ._models import SMSDeliveryReportReceivedEventData # type: ignore - from ._models import SMSEventBaseProperties # type: ignore - from ._models import SMSReceivedEventData # type: ignore from ._models import ServiceBusActiveMessagesAvailableWithNoListenersEventData # type: ignore from ._models import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData # type: ignore from ._models import SignalRServiceClientConnectionConnectedEventData # type: ignore @@ -299,18 +269,6 @@ 'AppConfigurationKeyValueModifiedEventData', 'AppEventTypeDetail', 'AppServicePlanEventTypeDetail', - 'ChatEventBaseProperties', - 'ChatMemberAddedToThreadWithUserEventData', - 'ChatMemberRemovedFromThreadForWithUserEventData', - 'ChatMessageDeletedEventData', - 'ChatMessageEditedEventData', - 'ChatMessageEventBaseProperties', - 'ChatMessageReceivedEventData', - 'ChatThreadCreatedWithUserEventData', - 'ChatThreadEventBaseProperties', - 'ChatThreadMemberProperties', - 'ChatThreadPropertiesUpdatedPerUserEventData', - 'ChatThreadWithUserDeletedEventData', 'CloudEvent', 'ContainerRegistryArtifactEventData', 'ContainerRegistryArtifactEventTarget', @@ -339,6 +297,7 @@ 'IotHubDeviceDeletedEventData', 'IotHubDeviceDisconnectedEventData', 'IotHubDeviceTelemetryEventData', + 'KeyVaultAccessPolicyChangedEventData', 'KeyVaultCertificateExpiredEventData', 'KeyVaultCertificateNearExpiryEventData', 'KeyVaultCertificateNewVersionCreatedEventData', @@ -399,10 +358,6 @@ 'ResourceWriteCancelData', 'ResourceWriteFailureData', 'ResourceWriteSuccessData', - 'SMSDeliveryAttemptProperties', - 'SMSDeliveryReportReceivedEventData', - 'SMSEventBaseProperties', - 'SMSReceivedEventData', 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', 'SignalRServiceClientConnectionConnectedEventData', 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 5562dadfd074..6b0fb8fefb96 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/_generated/models/_models.py @@ -112,514 +112,6 @@ def __init__( self.status = kwargs.get('status', None) -class ChatEventBaseProperties(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 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 - """ - - _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, - 'thread_id': {'key': 'threadId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatEventBaseProperties, self).__init__(**kwargs) - self.recipient_id = kwargs.get('recipient_id', None) - self.transaction_id = kwargs.get('transaction_id', None) - self.thread_id = kwargs.get('thread_id', None) - - -class ChatThreadEventBaseProperties(ChatEventBaseProperties): - """Schema of common properties of all chat thread 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(ChatThreadEventBaseProperties, self).__init__(**kwargs) - self.create_time = kwargs.get('create_time', None) - self.version = kwargs.get('version', None) - - -class ChatMemberAddedToThreadWithUserEventData(ChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser 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 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: The details of the user who was added. - :type member: ~event_grid_publisher_client.models.ChatThreadMemberProperties - """ - - _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'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'added_by': {'key': 'addedBy', 'type': 'str'}, - 'member': {'key': 'member', 'type': 'ChatThreadMemberProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMemberAddedToThreadWithUserEventData, self).__init__(**kwargs) - self.time = kwargs.get('time', None) - self.added_by = kwargs.get('added_by', None) - self.member = kwargs.get('member', None) - - -class ChatMemberRemovedFromThreadForWithUserEventData(ChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadForWithUser 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 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: The details of the user who was removed. - :type member: ~event_grid_publisher_client.models.ChatThreadMemberProperties - """ - - _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'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'removed_by': {'key': 'removedBy', 'type': 'str'}, - 'member': {'key': 'member', 'type': 'ChatThreadMemberProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMemberRemovedFromThreadForWithUserEventData, self).__init__(**kwargs) - self.time = kwargs.get('time', None) - self.removed_by = kwargs.get('removed_by', None) - self.member = kwargs.get('member', None) - - -class ChatMessageEventBaseProperties(ChatEventBaseProperties): - """Schema of common properties of all 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_type: str - :param version: The version of the message. - :type version: int - """ - - _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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMessageEventBaseProperties, self).__init__(**kwargs) - self.message_id = kwargs.get('message_id', None) - self.collapse_id = kwargs.get('collapse_id', None) - self.client_message_id = kwargs.get('client_message_id', None) - self.sender_id = kwargs.get('sender_id', None) - self.sender_display_name = kwargs.get('sender_display_name', None) - self.compose_time = kwargs.get('compose_time', None) - self.message_type = kwargs.get('message_type', None) - self.version = kwargs.get('version', None) - - -class ChatMessageDeletedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_type: str - :param version: The version of the message. - :type version: int - :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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMessageDeletedEventData, self).__init__(**kwargs) - self.delete_time = kwargs.get('delete_time', None) - - -class ChatMessageEditedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_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 edit_time: The time at which the message was edited. - :type edit_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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMessageEditedEventData, self).__init__(**kwargs) - self.message_body = kwargs.get('message_body', None) - self.edit_time = kwargs.get('edit_time', None) - - -class ChatMessageReceivedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_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 - """ - - _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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatMessageReceivedEventData, self).__init__(**kwargs) - self.message_body = kwargs.get('message_body', None) - - -class ChatThreadCreatedWithUserEventData(ChatThreadEventBaseProperties): - """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 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 thread_type: The type of the thread. - :type thread_type: 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.ChatThreadMemberProperties] - """ - - _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'}, - 'thread_type': {'key': 'threadType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'members': {'key': 'members', 'type': '[ChatThreadMemberProperties]'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatThreadCreatedWithUserEventData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.thread_type = kwargs.get('thread_type', None) - self.properties = kwargs.get('properties', None) - self.members = kwargs.get('members', None) - - -class ChatThreadMemberProperties(msrest.serialization.Model): - """Schema of the chat thread member. - - :param friendly_name: The name of the user. - :type friendly_name: str - :param member_id: The MRI of the user. - :type member_id: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'member_id': {'key': 'memberId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatThreadMemberProperties, self).__init__(**kwargs) - self.friendly_name = kwargs.get('friendly_name', None) - self.member_id = kwargs.get('member_id', None) - - -class ChatThreadPropertiesUpdatedPerUserEventData(ChatThreadEventBaseProperties): - """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 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 edited_by: The MRI of the user who updated the thread properties. - :type edited_by: str - :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 = { - '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'}, - 'edited_by': {'key': 'editedBy', 'type': 'str'}, - 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatThreadPropertiesUpdatedPerUserEventData, self).__init__(**kwargs) - self.edited_by = kwargs.get('edited_by', None) - self.edit_time = kwargs.get('edit_time', None) - self.properties = kwargs.get('properties', None) - - -class ChatThreadWithUserDeletedEventData(ChatThreadEventBaseProperties): - """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 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 deleted_by: The MRI of the user who deleted the thread. - :type deleted_by: str - :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'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, - 'delete_time': {'key': 'deleteTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(ChatThreadWithUserDeletedEventData, self).__init__(**kwargs) - self.deleted_by = kwargs.get('deleted_by', None) - self.delete_time = kwargs.get('delete_time', None) - - class CloudEvent(msrest.serialization.Model): """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. @@ -1590,6 +1082,49 @@ def __init__( super(IotHubDeviceTelemetryEventData, self).__init__(**kwargs) +class KeyVaultAccessPolicyChangedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an VaultAccessPolicyChanged event. + + :param id: The id of the object that triggered this event. + :type id: str + :param vault_name: Key vault name of the object that triggered this event. + :type vault_name: str + :param object_type: The type of the object that triggered this event. + :type object_type: str + :param object_name: The name of the object that triggered this event. + :type object_name: str + :param version: The version of the object that triggered this event. + :type version: str + :param nbf: Not before date of the object that triggered this event. + :type nbf: float + :param exp: The expiration date of the object that triggered this event. + :type exp: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'object_name': {'key': 'objectName', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'nbf': {'key': 'nbf', 'type': 'float'}, + 'exp': {'key': 'exp', 'type': 'float'}, + } + + def __init__( + self, + **kwargs + ): + super(KeyVaultAccessPolicyChangedEventData, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.vault_name = kwargs.get('vault_name', None) + self.object_type = kwargs.get('object_type', None) + self.object_name = kwargs.get('object_name', None) + self.version = kwargs.get('version', None) + self.nbf = kwargs.get('nbf', None) + self.exp = kwargs.get('exp', None) + + class KeyVaultCertificateExpiredEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an CertificateExpired event. @@ -4288,128 +3823,6 @@ def __init__( self.error_message = kwargs.get('error_message', None) -class SMSDeliveryAttemptProperties(msrest.serialization.Model): - """Schema for details of a delivery attempt. - - :param timestamp: TimeStamp when delivery was attempted. - :type timestamp: ~datetime.datetime - :param segments_succeeded: Number of segments that were successfully delivered. - :type segments_succeeded: int - :param segments_failed: Number of segments whose delivery failed. - :type segments_failed: int - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'segments_succeeded': {'key': 'segmentsSucceeded', 'type': 'int'}, - 'segments_failed': {'key': 'segmentsFailed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(SMSDeliveryAttemptProperties, 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 SMSEventBaseProperties(msrest.serialization.Model): - """Schema of common properties of all SMS events. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SMSEventBaseProperties, 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 SMSDeliveryReportReceivedEventData(SMSEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - :param delivery_status: Status of Delivery. - :type delivery_status: str - :param delivery_status_details: Details about Delivery Status. - :type delivery_status_details: str - :param delivery_attempts: List of details of delivery attempts made. - :type delivery_attempts: list[~event_grid_publisher_client.models.SMSDeliveryAttemptProperties] - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - 'delivery_status': {'key': 'deliveryStatus', 'type': 'str'}, - 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, - 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[SMSDeliveryAttemptProperties]'}, - } - - def __init__( - self, - **kwargs - ): - super(SMSDeliveryReportReceivedEventData, 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) - - -class SMSReceivedEventData(SMSEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - :param message: The SMS content. - :type message: str - :param received_timestamp: The time at which the SMS was received. - :type received_timestamp: ~datetime.datetime - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SMSReceivedEventData, self).__init__(**kwargs) - self.message = kwargs.get('message', None) - self.received_timestamp = kwargs.get('received_timestamp', None) - - class StorageBlobCreatedEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated 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 7646d84b4620..7bf5d9bb317a 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 @@ -131,624 +131,6 @@ def __init__( self.status = status -class ChatEventBaseProperties(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 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 - """ - - _attribute_map = { - 'recipient_id': {'key': 'recipientId', 'type': 'str'}, - 'transaction_id': {'key': 'transactionId', 'type': 'str'}, - 'thread_id': {'key': 'threadId', 'type': 'str'}, - } - - def __init__( - self, - *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, - thread_id: Optional[str] = None, - **kwargs - ): - super(ChatEventBaseProperties, self).__init__(**kwargs) - self.recipient_id = recipient_id - self.transaction_id = transaction_id - self.thread_id = thread_id - - -class ChatThreadEventBaseProperties(ChatEventBaseProperties): - """Schema of common properties of all chat thread 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(ChatThreadEventBaseProperties, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, **kwargs) - self.create_time = create_time - self.version = version - - -class ChatMemberAddedToThreadWithUserEventData(ChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberAddedToThreadWithUser 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 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: The details of the user who was added. - :type member: ~event_grid_publisher_client.models.ChatThreadMemberProperties - """ - - _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'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'added_by': {'key': 'addedBy', 'type': 'str'}, - 'member': {'key': 'member', 'type': 'ChatThreadMemberProperties'}, - } - - 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, - time: Optional[datetime.datetime] = None, - added_by: Optional[str] = None, - member: Optional["ChatThreadMemberProperties"] = None, - **kwargs - ): - super(ChatMemberAddedToThreadWithUserEventData, 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 = member - - -class ChatMemberRemovedFromThreadForWithUserEventData(ChatThreadEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.ChatMemberRemovedFromThreadForWithUser 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 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: The details of the user who was removed. - :type member: ~event_grid_publisher_client.models.ChatThreadMemberProperties - """ - - _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'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - 'removed_by': {'key': 'removedBy', 'type': 'str'}, - 'member': {'key': 'member', 'type': 'ChatThreadMemberProperties'}, - } - - 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, - time: Optional[datetime.datetime] = None, - removed_by: Optional[str] = None, - member: Optional["ChatThreadMemberProperties"] = None, - **kwargs - ): - super(ChatMemberRemovedFromThreadForWithUserEventData, 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 = member - - -class ChatMessageEventBaseProperties(ChatEventBaseProperties): - """Schema of common properties of all 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_type: str - :param version: The version of the message. - :type version: int - """ - - _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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - } - - def __init__( - self, - *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, - thread_id: Optional[str] = None, - message_id: Optional[str] = None, - collapse_id: Optional[str] = None, - client_message_id: Optional[str] = None, - sender_id: Optional[str] = None, - sender_display_name: Optional[str] = None, - compose_time: Optional[datetime.datetime] = None, - message_type: Optional[str] = None, - version: Optional[int] = None, - **kwargs - ): - super(ChatMessageEventBaseProperties, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, **kwargs) - self.message_id = message_id - self.collapse_id = collapse_id - self.client_message_id = client_message_id - self.sender_id = sender_id - self.sender_display_name = sender_display_name - self.compose_time = compose_time - self.message_type = message_type - self.version = version - - -class ChatMessageDeletedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_type: str - :param version: The version of the message. - :type version: int - :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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - '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, - collapse_id: Optional[str] = None, - client_message_id: Optional[str] = None, - sender_id: Optional[str] = None, - sender_display_name: Optional[str] = None, - compose_time: Optional[datetime.datetime] = None, - message_type: Optional[str] = None, - version: Optional[int] = None, - delete_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(ChatMessageDeletedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, collapse_id=collapse_id, client_message_id=client_message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, message_type=message_type, version=version, **kwargs) - self.delete_time = delete_time - - -class ChatMessageEditedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_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 edit_time: The time at which the message was edited. - :type edit_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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - 'edit_time': {'key': 'editTime', '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, - collapse_id: Optional[str] = None, - client_message_id: Optional[str] = None, - sender_id: Optional[str] = None, - sender_display_name: Optional[str] = None, - compose_time: Optional[datetime.datetime] = None, - message_type: Optional[str] = None, - version: Optional[int] = None, - message_body: Optional[str] = None, - edit_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(ChatMessageEditedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, collapse_id=collapse_id, client_message_id=client_message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, message_type=message_type, version=version, **kwargs) - self.message_body = message_body - self.edit_time = edit_time - - -class ChatMessageReceivedEventData(ChatMessageEventBaseProperties): - """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 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 collapse_id: The collapse id is used to identify the message threads. - :type collapse_id: str - :param client_message_id: The messaged Id generated by the sending client. - :type client_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 message_type: The type of the message. - :type message_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 - """ - - _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'}, - 'collapse_id': {'key': 'collapseId', 'type': 'str'}, - 'client_message_id': {'key': 'clientMessageId', 'type': 'str'}, - 'sender_id': {'key': 'senderId', 'type': 'str'}, - 'sender_display_name': {'key': 'senderDisplayName', 'type': 'str'}, - 'compose_time': {'key': 'composeTime', 'type': 'iso-8601'}, - 'message_type': {'key': 'messageType', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'message_body': {'key': 'messageBody', 'type': 'str'}, - } - - def __init__( - self, - *, - recipient_id: Optional[str] = None, - transaction_id: Optional[str] = None, - thread_id: Optional[str] = None, - message_id: Optional[str] = None, - collapse_id: Optional[str] = None, - client_message_id: Optional[str] = None, - sender_id: Optional[str] = None, - sender_display_name: Optional[str] = None, - compose_time: Optional[datetime.datetime] = None, - message_type: Optional[str] = None, - version: Optional[int] = None, - message_body: Optional[str] = None, - **kwargs - ): - super(ChatMessageReceivedEventData, self).__init__(recipient_id=recipient_id, transaction_id=transaction_id, thread_id=thread_id, message_id=message_id, collapse_id=collapse_id, client_message_id=client_message_id, sender_id=sender_id, sender_display_name=sender_display_name, compose_time=compose_time, message_type=message_type, version=version, **kwargs) - self.message_body = message_body - - -class ChatThreadCreatedWithUserEventData(ChatThreadEventBaseProperties): - """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 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 thread_type: The type of the thread. - :type thread_type: 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.ChatThreadMemberProperties] - """ - - _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'}, - 'thread_type': {'key': 'threadType', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - 'members': {'key': 'members', 'type': '[ChatThreadMemberProperties]'}, - } - - 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, - thread_type: Optional[str] = None, - properties: Optional[Dict[str, object]] = None, - members: Optional[List["ChatThreadMemberProperties"]] = None, - **kwargs - ): - super(ChatThreadCreatedWithUserEventData, 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.thread_type = thread_type - self.properties = properties - self.members = members - - -class ChatThreadMemberProperties(msrest.serialization.Model): - """Schema of the chat thread member. - - :param friendly_name: The name of the user. - :type friendly_name: str - :param member_id: The MRI of the user. - :type member_id: str - """ - - _attribute_map = { - 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, - 'member_id': {'key': 'memberId', 'type': 'str'}, - } - - def __init__( - self, - *, - friendly_name: Optional[str] = None, - member_id: Optional[str] = None, - **kwargs - ): - super(ChatThreadMemberProperties, self).__init__(**kwargs) - self.friendly_name = friendly_name - self.member_id = member_id - - -class ChatThreadPropertiesUpdatedPerUserEventData(ChatThreadEventBaseProperties): - """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 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 edited_by: The MRI of the user who updated the thread properties. - :type edited_by: str - :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 = { - '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'}, - 'edited_by': {'key': 'editedBy', 'type': 'str'}, - 'edit_time': {'key': 'editTime', 'type': 'iso-8601'}, - 'properties': {'key': 'properties', 'type': '{object}'}, - } - - 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, - edited_by: Optional[str] = None, - edit_time: Optional[datetime.datetime] = None, - properties: Optional[Dict[str, object]] = None, - **kwargs - ): - super(ChatThreadPropertiesUpdatedPerUserEventData, 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 - self.edit_time = edit_time - self.properties = properties - - -class ChatThreadWithUserDeletedEventData(ChatThreadEventBaseProperties): - """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 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 deleted_by: The MRI of the user who deleted the thread. - :type deleted_by: str - :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'}, - 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, - '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, - deleted_by: Optional[str] = None, - delete_time: Optional[datetime.datetime] = None, - **kwargs - ): - super(ChatThreadWithUserDeletedEventData, 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 - self.delete_time = delete_time - - class CloudEvent(msrest.serialization.Model): """Properties of an event published to an Event Grid topic using the CloudEvent 1.0 Schema. @@ -1875,6 +1257,57 @@ def __init__( super(IotHubDeviceTelemetryEventData, self).__init__(body=body, properties=properties, system_properties=system_properties, **kwargs) +class KeyVaultAccessPolicyChangedEventData(msrest.serialization.Model): + """Schema of the Data property of an EventGridEvent for an VaultAccessPolicyChanged event. + + :param id: The id of the object that triggered this event. + :type id: str + :param vault_name: Key vault name of the object that triggered this event. + :type vault_name: str + :param object_type: The type of the object that triggered this event. + :type object_type: str + :param object_name: The name of the object that triggered this event. + :type object_name: str + :param version: The version of the object that triggered this event. + :type version: str + :param nbf: Not before date of the object that triggered this event. + :type nbf: float + :param exp: The expiration date of the object that triggered this event. + :type exp: float + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'vault_name': {'key': 'vaultName', 'type': 'str'}, + 'object_type': {'key': 'objectType', 'type': 'str'}, + 'object_name': {'key': 'objectName', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'nbf': {'key': 'nbf', 'type': 'float'}, + 'exp': {'key': 'exp', 'type': 'float'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + vault_name: Optional[str] = None, + object_type: Optional[str] = None, + object_name: Optional[str] = None, + version: Optional[str] = None, + nbf: Optional[float] = None, + exp: Optional[float] = None, + **kwargs + ): + super(KeyVaultAccessPolicyChangedEventData, self).__init__(**kwargs) + self.id = id + self.vault_name = vault_name + self.object_type = object_type + self.object_name = object_name + self.version = version + self.nbf = nbf + self.exp = exp + + class KeyVaultCertificateExpiredEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an CertificateExpired event. @@ -4909,149 +4342,6 @@ def __init__( self.error_message = error_message -class SMSDeliveryAttemptProperties(msrest.serialization.Model): - """Schema for details of a delivery attempt. - - :param timestamp: TimeStamp when delivery was attempted. - :type timestamp: ~datetime.datetime - :param segments_succeeded: Number of segments that were successfully delivered. - :type segments_succeeded: int - :param segments_failed: Number of segments whose delivery failed. - :type segments_failed: int - """ - - _attribute_map = { - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'segments_succeeded': {'key': 'segmentsSucceeded', 'type': 'int'}, - 'segments_failed': {'key': 'segmentsFailed', 'type': 'int'}, - } - - def __init__( - self, - *, - timestamp: Optional[datetime.datetime] = None, - segments_succeeded: Optional[int] = None, - segments_failed: Optional[int] = None, - **kwargs - ): - super(SMSDeliveryAttemptProperties, self).__init__(**kwargs) - self.timestamp = timestamp - self.segments_succeeded = segments_succeeded - self.segments_failed = segments_failed - - -class SMSEventBaseProperties(msrest.serialization.Model): - """Schema of common properties of all SMS events. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - } - - def __init__( - self, - *, - message_id: Optional[str] = None, - from_property: Optional[str] = None, - to: Optional[str] = None, - **kwargs - ): - super(SMSEventBaseProperties, self).__init__(**kwargs) - self.message_id = message_id - self.from_property = from_property - self.to = to - - -class SMSDeliveryReportReceivedEventData(SMSEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSDeliveryReportReceived event. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - :param delivery_status: Status of Delivery. - :type delivery_status: str - :param delivery_status_details: Details about Delivery Status. - :type delivery_status_details: str - :param delivery_attempts: List of details of delivery attempts made. - :type delivery_attempts: list[~event_grid_publisher_client.models.SMSDeliveryAttemptProperties] - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - 'delivery_status': {'key': 'deliveryStatus', 'type': 'str'}, - 'delivery_status_details': {'key': 'deliveryStatusDetails', 'type': 'str'}, - 'delivery_attempts': {'key': 'deliveryAttempts', 'type': '[SMSDeliveryAttemptProperties]'}, - } - - def __init__( - self, - *, - message_id: Optional[str] = None, - from_property: Optional[str] = None, - to: Optional[str] = None, - delivery_status: Optional[str] = None, - delivery_status_details: Optional[str] = None, - delivery_attempts: Optional[List["SMSDeliveryAttemptProperties"]] = None, - **kwargs - ): - super(SMSDeliveryReportReceivedEventData, 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 - - -class SMSReceivedEventData(SMSEventBaseProperties): - """Schema of the Data property of an EventGridEvent for an Microsoft.Communication.SMSReceived event. - - :param message_id: The identity of the SMS message. - :type message_id: str - :param from_property: The identity of SMS message sender. - :type from_property: str - :param to: The identity of SMS message receiver. - :type to: str - :param message: The SMS content. - :type message: str - :param received_timestamp: The time at which the SMS was received. - :type received_timestamp: ~datetime.datetime - """ - - _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'from_property': {'key': 'from', 'type': 'str'}, - 'to': {'key': 'to', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'received_timestamp': {'key': 'receivedTimestamp', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - message_id: Optional[str] = None, - from_property: Optional[str] = None, - to: Optional[str] = None, - message: Optional[str] = None, - received_timestamp: Optional[datetime.datetime] = None, - **kwargs - ): - super(SMSReceivedEventData, self).__init__(message_id=message_id, from_property=from_property, to=to, **kwargs) - self.message = message - self.received_timestamp = received_timestamp - - class StorageBlobCreatedEventData(msrest.serialization.Model): """Schema of the Data property of an EventGridEvent for an Microsoft.Storage.BlobCreated 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..d374ae6d8b8d 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 @@ -66,7 +66,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 @@ -122,7 +121,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 @@ -178,7 +176,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 158cf41dde19..8f766335dfd8 100644 --- a/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md +++ b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md @@ -13,11 +13,10 @@ no-namespace-folders: true output-folder: ../azure/eventgrid/_generated source-code-folder-path: ./azure/eventgrid/_generated input-file: - - https://raw.githubusercontent.com/t-swpill/azure-rest-api-specs/add-cloud-event-publish-to-event-grid/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json + - 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.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.Communication/stable/2018-01-01/AzureCommunicationServices.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.ContainerRegistry/stable/2018-01-01/ContainerRegistry.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.Devices/stable/2018-01-01/IotHub.json - https://github.com/Azure/azure-rest-api-specs/blob/master/specification/eventgrid/data-plane/Microsoft.EventHub/stable/2018-01-01/EventHub.json @@ -32,5 +31,5 @@ input-file: python: true v3: true -use: "@autorest/python@5.1.0-preview.1" +use: "@autorest/python@5.2.0-preview.1" ``` \ No newline at end of file From 6d16eefbeda05ddd5ab0226f05a1a2c1f4bced1b Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Fri, 4 Sep 2020 12:44:43 -0700 Subject: [PATCH 2/3] fix import --- .../azure/eventgrid/models/__init__.py | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py index c89dbc17e927..b806045ad175 100644 --- a/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/sdk/eventgrid/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -9,18 +9,6 @@ AppConfigurationKeyValueModifiedEventData, AppEventTypeDetail, AppServicePlanEventTypeDetail, - ChatEventBaseProperties, - ChatMemberAddedToThreadWithUserEventData, - ChatMemberRemovedFromThreadForWithUserEventData, - ChatMessageDeletedEventData, - ChatMessageEditedEventData, - ChatMessageEventBaseProperties, - ChatMessageReceivedEventData, - ChatThreadCreatedWithUserEventData, - ChatThreadEventBaseProperties, - ChatThreadMemberProperties, - ChatThreadPropertiesUpdatedPerUserEventData, - ChatThreadWithUserDeletedEventData, ContainerRegistryArtifactEventData, ContainerRegistryArtifactEventTarget, ContainerRegistryChartDeletedEventData, @@ -107,10 +95,6 @@ ResourceWriteCancelData, ResourceWriteFailureData, ResourceWriteSuccessData, - SMSDeliveryAttemptProperties, - SMSDeliveryReportReceivedEventData, - SMSEventBaseProperties, - SMSReceivedEventData, ServiceBusActiveMessagesAvailableWithNoListenersEventData, ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, SignalRServiceClientConnectionConnectedEventData, @@ -158,18 +142,6 @@ 'AppConfigurationKeyValueModifiedEventData', 'AppEventTypeDetail', 'AppServicePlanEventTypeDetail', - 'ChatEventBaseProperties', - 'ChatMemberAddedToThreadWithUserEventData', - 'ChatMemberRemovedFromThreadForWithUserEventData', - 'ChatMessageDeletedEventData', - 'ChatMessageEditedEventData', - 'ChatMessageEventBaseProperties', - 'ChatMessageReceivedEventData', - 'ChatThreadCreatedWithUserEventData', - 'ChatThreadEventBaseProperties', - 'ChatThreadMemberProperties', - 'ChatThreadPropertiesUpdatedPerUserEventData', - 'ChatThreadWithUserDeletedEventData', 'ContainerRegistryArtifactEventData', 'ContainerRegistryArtifactEventTarget', 'ContainerRegistryChartDeletedEventData', @@ -256,10 +228,6 @@ 'ResourceWriteCancelData', 'ResourceWriteFailureData', 'ResourceWriteSuccessData', - 'SMSDeliveryAttemptProperties', - 'SMSDeliveryReportReceivedEventData', - 'SMSEventBaseProperties', - 'SMSReceivedEventData', 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', 'SignalRServiceClientConnectionConnectedEventData', From 8ce5179448e7c30dba021f0a8f960c3911d7df42 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Fri, 4 Sep 2020 12:58:27 -0700 Subject: [PATCH 3/3] regen --- .../azure-eventgrid/azure/eventgrid/_generated/aio/__init__.py | 2 +- .../operations/_event_grid_publisher_client_operations.py | 3 +++ sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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 eeec885ee412..6a44d89d724a 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 import EventGridPublisherClient +from ._event_grid_publisher_client_async import EventGridPublisherClient __all__ = ['EventGridPublisherClient'] 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 d374ae6d8b8d..2e894cbcd5d5 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 @@ -66,6 +66,7 @@ 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 @@ -121,6 +122,7 @@ 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 @@ -176,6 +178,7 @@ 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 8f766335dfd8..e37648c2e829 100644 --- a/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md +++ b/sdk/eventgrid/azure-eventgrid/swagger/README.PYTHON_T2.md @@ -31,5 +31,5 @@ input-file: python: true v3: true -use: "@autorest/python@5.2.0-preview.1" +use: "@autorest/python@5.1.0-preview.7" ``` \ No newline at end of file