Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR eventgrid/data-plane] EventGrid Dataplane: Added schemas corresponding to SubscriptionValidationEvent/Response and SubscriptionDeletedEvent #2571

Merged
merged 1 commit into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions azure-eventgrid/azure/eventgrid/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from .resource_delete_failure_data_py3 import ResourceDeleteFailureData
from .resource_delete_cancel_data_py3 import ResourceDeleteCancelData
from .event_grid_event_py3 import EventGridEvent
from .subscription_validation_event_data_py3 import SubscriptionValidationEventData
from .subscription_validation_response_py3 import SubscriptionValidationResponse
from .subscription_deleted_event_data_py3 import SubscriptionDeletedEventData
from .iot_hub_device_created_event_data_py3 import IotHubDeviceCreatedEventData
from .iot_hub_device_deleted_event_data_py3 import IotHubDeviceDeletedEventData
from .device_twin_metadata_py3 import DeviceTwinMetadata
Expand Down Expand Up @@ -48,6 +51,9 @@
from .resource_delete_failure_data import ResourceDeleteFailureData
from .resource_delete_cancel_data import ResourceDeleteCancelData
from .event_grid_event import EventGridEvent
from .subscription_validation_event_data import SubscriptionValidationEventData
from .subscription_validation_response import SubscriptionValidationResponse
from .subscription_deleted_event_data import SubscriptionDeletedEventData
from .iot_hub_device_created_event_data import IotHubDeviceCreatedEventData
from .iot_hub_device_deleted_event_data import IotHubDeviceDeletedEventData
from .device_twin_metadata import DeviceTwinMetadata
Expand Down Expand Up @@ -77,6 +83,9 @@
'ResourceDeleteFailureData',
'ResourceDeleteCancelData',
'EventGridEvent',
'SubscriptionValidationEventData',
'SubscriptionValidationResponse',
'SubscriptionDeletedEventData',
'IotHubDeviceCreatedEventData',
'IotHubDeviceDeletedEventData',
'DeviceTwinMetadata',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .container_registry_event_data import ContainerRegistryEventData
from .container_registry_event_data_py3 import ContainerRegistryEventData


class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .container_registry_event_data import ContainerRegistryEventData
from .container_registry_event_data_py3 import ContainerRegistryEventData


class ContainerRegistryImagePushedEventData(ContainerRegistryEventData):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties
from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties


class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties
from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties


class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 msrest.serialization import Model


class SubscriptionDeletedEventData(Model):
"""Schema of the Data property of an EventGridEvent for a
Microsoft.EventGrid.SubscriptionDeletedEvent.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar event_subscription_id: The Azure resource ID of the deleted event
subscription.
:vartype event_subscription_id: str
"""

_validation = {
'event_subscription_id': {'readonly': True},
}

_attribute_map = {
'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SubscriptionDeletedEventData, self).__init__(**kwargs)
self.event_subscription_id = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 msrest.serialization import Model


class SubscriptionDeletedEventData(Model):
"""Schema of the Data property of an EventGridEvent for a
Microsoft.EventGrid.SubscriptionDeletedEvent.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar event_subscription_id: The Azure resource ID of the deleted event
subscription.
:vartype event_subscription_id: str
"""

_validation = {
'event_subscription_id': {'readonly': True},
}

_attribute_map = {
'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(SubscriptionDeletedEventData, self).__init__(**kwargs)
self.event_subscription_id = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 msrest.serialization import Model


class SubscriptionValidationEventData(Model):
"""Schema of the Data property of an EventGridEvent for a
Microsoft.EventGrid.SubscriptionValidationEvent.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar validation_code: The validation code sent by Azure Event Grid to
validate an event subscription. To complete the validation handshake, the
subscriber must either respond with this validation code as part of the
validation response, or perform a GET request on the validationUrl
(available starting version 2018-05-01-preview).
:vartype validation_code: str
:ivar validation_url: The validation URL sent by Azure Event Grid
(available starting version 2018-05-01-preview). To complete the
validation handshake, the subscriber must either respond with the
validationCode as part of the validation response, or perform a GET
request on the validationUrl (available starting version
2018-05-01-preview).
:vartype validation_url: str
"""

_validation = {
'validation_code': {'readonly': True},
'validation_url': {'readonly': True},
}

_attribute_map = {
'validation_code': {'key': 'validationCode', 'type': 'str'},
'validation_url': {'key': 'validationUrl', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SubscriptionValidationEventData, self).__init__(**kwargs)
self.validation_code = None
self.validation_url = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 msrest.serialization import Model


class SubscriptionValidationEventData(Model):
"""Schema of the Data property of an EventGridEvent for a
Microsoft.EventGrid.SubscriptionValidationEvent.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar validation_code: The validation code sent by Azure Event Grid to
validate an event subscription. To complete the validation handshake, the
subscriber must either respond with this validation code as part of the
validation response, or perform a GET request on the validationUrl
(available starting version 2018-05-01-preview).
:vartype validation_code: str
:ivar validation_url: The validation URL sent by Azure Event Grid
(available starting version 2018-05-01-preview). To complete the
validation handshake, the subscriber must either respond with the
validationCode as part of the validation response, or perform a GET
request on the validationUrl (available starting version
2018-05-01-preview).
:vartype validation_url: str
"""

_validation = {
'validation_code': {'readonly': True},
'validation_url': {'readonly': True},
}

_attribute_map = {
'validation_code': {'key': 'validationCode', 'type': 'str'},
'validation_url': {'key': 'validationUrl', 'type': 'str'},
}

def __init__(self, **kwargs) -> None:
super(SubscriptionValidationEventData, self).__init__(**kwargs)
self.validation_code = None
self.validation_url = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 msrest.serialization import Model


class SubscriptionValidationResponse(Model):
"""To complete an event subscription validation handshake, a subscriber can
use either the validationCode or the validationUrl received in a
SubscriptionValidationEvent. When the validationCode is used, the
SubscriptionValidationResponse can be used to build the response.

:param validation_response: The validation response sent by the subscriber
to Azure Event Grid to complete the validation of an event subscription.
:type validation_response: str
"""

_attribute_map = {
'validation_response': {'key': 'validationResponse', 'type': 'str'},
}

def __init__(self, **kwargs):
super(SubscriptionValidationResponse, self).__init__(**kwargs)
self.validation_response = kwargs.get('validation_response', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 msrest.serialization import Model


class SubscriptionValidationResponse(Model):
"""To complete an event subscription validation handshake, a subscriber can
use either the validationCode or the validationUrl received in a
SubscriptionValidationEvent. When the validationCode is used, the
SubscriptionValidationResponse can be used to build the response.

:param validation_response: The validation response sent by the subscriber
to Azure Event Grid to complete the validation of an event subscription.
:type validation_response: str
"""

_attribute_map = {
'validation_response': {'key': 'validationResponse', 'type': 'str'},
}

def __init__(self, *, validation_response: str=None, **kwargs) -> None:
super(SubscriptionValidationResponse, self).__init__(**kwargs)
self.validation_response = validation_response