From b7560127ff877b731f802078b267ddb86aa45f93 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 28 Mar 2019 09:47:10 -0700 Subject: [PATCH] [AutoPR datafactory/resource-manager] Webhook activity (#4675) * Generated from 1e5988d39eb2da25f1da3cf97e1b433524e1aa2d Added webhook activity * Generated from eaee060e46df3cc4882580e9c92109fb252cb14f update type to string * Generated from e66e21c84311006dea2c15b0c874024497edd5bc Update description --- .../azure/mgmt/datafactory/models/__init__.py | 5 + .../datafactory/models/control_activity.py | 8 +- .../models/control_activity_py3.py | 8 +- .../data_factory_management_client_enums.py | 5 + .../datafactory/models/web_hook_activity.py | 92 +++++++++++++++++++ .../models/web_hook_activity_py3.py | 92 +++++++++++++++++++ 6 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity.py create mode 100644 azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity_py3.py diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py index 963649cf0e30..f9204d4d739f 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py @@ -374,6 +374,7 @@ from .copy_sink_py3 import CopySink from .copy_activity_py3 import CopyActivity from .execution_activity_py3 import ExecutionActivity + from .web_hook_activity_py3 import WebHookActivity from .append_variable_activity_py3 import AppendVariableActivity from .set_variable_activity_py3 import SetVariableActivity from .filter_activity_py3 import FilterActivity @@ -773,6 +774,7 @@ from .copy_sink import CopySink from .copy_activity import CopyActivity from .execution_activity import ExecutionActivity + from .web_hook_activity import WebHookActivity from .append_variable_activity import AppendVariableActivity from .set_variable_activity import SetVariableActivity from .filter_activity import FilterActivity @@ -869,6 +871,7 @@ CopyBehaviorType, PolybaseSettingsRejectType, SapCloudForCustomerSinkWriteBehavior, + WebHookActivityMethod, IntegrationRuntimeType, SelfHostedIntegrationRuntimeNodeStatus, IntegrationRuntimeUpdateResult, @@ -1246,6 +1249,7 @@ 'CopySink', 'CopyActivity', 'ExecutionActivity', + 'WebHookActivity', 'AppendVariableActivity', 'SetVariableActivity', 'FilterActivity', @@ -1341,6 +1345,7 @@ 'CopyBehaviorType', 'PolybaseSettingsRejectType', 'SapCloudForCustomerSinkWriteBehavior', + 'WebHookActivityMethod', 'IntegrationRuntimeType', 'SelfHostedIntegrationRuntimeNodeStatus', 'IntegrationRuntimeUpdateResult', diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity.py index 16581581786b..bed4cccad5e5 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity.py @@ -16,9 +16,9 @@ class ControlActivity(Activity): """Base class for all control activities like IfCondition, ForEach , Until. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AppendVariableActivity, SetVariableActivity, - FilterActivity, UntilActivity, WaitActivity, ForEachActivity, - IfConditionActivity, ExecutePipelineActivity + sub-classes are: WebHookActivity, AppendVariableActivity, + SetVariableActivity, FilterActivity, UntilActivity, WaitActivity, + ForEachActivity, IfConditionActivity, ExecutePipelineActivity All required parameters must be populated in order to send to Azure. @@ -52,7 +52,7 @@ class ControlActivity(Activity): } _subtype_map = { - 'type': {'AppendVariable': 'AppendVariableActivity', 'SetVariable': 'SetVariableActivity', 'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'} + 'type': {'WebHook': 'WebHookActivity', 'AppendVariable': 'AppendVariableActivity', 'SetVariable': 'SetVariableActivity', 'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity_py3.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity_py3.py index 739d8b9c311b..fce63d0cba62 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity_py3.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/control_activity_py3.py @@ -16,9 +16,9 @@ class ControlActivity(Activity): """Base class for all control activities like IfCondition, ForEach , Until. You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AppendVariableActivity, SetVariableActivity, - FilterActivity, UntilActivity, WaitActivity, ForEachActivity, - IfConditionActivity, ExecutePipelineActivity + sub-classes are: WebHookActivity, AppendVariableActivity, + SetVariableActivity, FilterActivity, UntilActivity, WaitActivity, + ForEachActivity, IfConditionActivity, ExecutePipelineActivity All required parameters must be populated in order to send to Azure. @@ -52,7 +52,7 @@ class ControlActivity(Activity): } _subtype_map = { - 'type': {'AppendVariable': 'AppendVariableActivity', 'SetVariable': 'SetVariableActivity', 'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'} + 'type': {'WebHook': 'WebHookActivity', 'AppendVariable': 'AppendVariableActivity', 'SetVariable': 'SetVariableActivity', 'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'} } def __init__(self, *, name: str, additional_properties=None, description: str=None, depends_on=None, user_properties=None, **kwargs) -> None: diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/data_factory_management_client_enums.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/data_factory_management_client_enums.py index c5c828d24367..b372cb91d8ef 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/data_factory_management_client_enums.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/data_factory_management_client_enums.py @@ -420,6 +420,11 @@ class SapCloudForCustomerSinkWriteBehavior(str, Enum): update = "Update" +class WebHookActivityMethod(str, Enum): + + post = "POST" + + class IntegrationRuntimeType(str, Enum): managed = "Managed" diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity.py new file mode 100644 index 000000000000..1c648c42c3e2 --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity.py @@ -0,0 +1,92 @@ +# 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 .control_activity import ControlActivity + + +class WebHookActivity(ControlActivity): + """WebHook activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Activity name. + :type name: str + :param description: Activity description. + :type description: str + :param depends_on: Activity depends on condition. + :type depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency] + :param user_properties: Activity user properties. + :type user_properties: list[~azure.mgmt.datafactory.models.UserProperty] + :param type: Required. Constant filled by server. + :type type: str + :ivar method: Required. Rest API method for target endpoint. Default + value: "POST" . + :vartype method: str + :param url: Required. WebHook activity target endpoint and path. Type: + string (or Expression with resultType string). + :type url: object + :param timeout: The timeout within which the webhook should be called + back. If there is no value specified, it defaults to 10 minutes. Type: + string. Pattern: ((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + :type timeout: str + :param headers: Represents the headers that will be sent to the request. + For example, to set the language and type on a request: "headers" : { + "Accept-Language": "en-us", "Content-Type": "application/json" }. Type: + string (or Expression with resultType string). + :type headers: object + :param body: Represents the payload that will be sent to the endpoint. + Required for POST/PUT method, not allowed for GET method Type: string (or + Expression with resultType string). + :type body: object + :param authentication: Authentication method used for calling the + endpoint. + :type authentication: + ~azure.mgmt.datafactory.models.WebActivityAuthentication + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'method': {'required': True, 'constant': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[ActivityDependency]'}, + 'user_properties': {'key': 'userProperties', 'type': '[UserProperty]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method': {'key': 'typeProperties.method', 'type': 'str'}, + 'url': {'key': 'typeProperties.url', 'type': 'object'}, + 'timeout': {'key': 'typeProperties.timeout', 'type': 'str'}, + 'headers': {'key': 'typeProperties.headers', 'type': 'object'}, + 'body': {'key': 'typeProperties.body', 'type': 'object'}, + 'authentication': {'key': 'typeProperties.authentication', 'type': 'WebActivityAuthentication'}, + } + + method = "POST" + + def __init__(self, **kwargs): + super(WebHookActivity, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.timeout = kwargs.get('timeout', None) + self.headers = kwargs.get('headers', None) + self.body = kwargs.get('body', None) + self.authentication = kwargs.get('authentication', None) + self.type = 'WebHook' diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity_py3.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity_py3.py new file mode 100644 index 000000000000..40cdc6f732da --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_hook_activity_py3.py @@ -0,0 +1,92 @@ +# 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 .control_activity_py3 import ControlActivity + + +class WebHookActivity(ControlActivity): + """WebHook activity. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param name: Required. Activity name. + :type name: str + :param description: Activity description. + :type description: str + :param depends_on: Activity depends on condition. + :type depends_on: list[~azure.mgmt.datafactory.models.ActivityDependency] + :param user_properties: Activity user properties. + :type user_properties: list[~azure.mgmt.datafactory.models.UserProperty] + :param type: Required. Constant filled by server. + :type type: str + :ivar method: Required. Rest API method for target endpoint. Default + value: "POST" . + :vartype method: str + :param url: Required. WebHook activity target endpoint and path. Type: + string (or Expression with resultType string). + :type url: object + :param timeout: The timeout within which the webhook should be called + back. If there is no value specified, it defaults to 10 minutes. Type: + string. Pattern: ((\\d+)\\.)?(\\d\\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + :type timeout: str + :param headers: Represents the headers that will be sent to the request. + For example, to set the language and type on a request: "headers" : { + "Accept-Language": "en-us", "Content-Type": "application/json" }. Type: + string (or Expression with resultType string). + :type headers: object + :param body: Represents the payload that will be sent to the endpoint. + Required for POST/PUT method, not allowed for GET method Type: string (or + Expression with resultType string). + :type body: object + :param authentication: Authentication method used for calling the + endpoint. + :type authentication: + ~azure.mgmt.datafactory.models.WebActivityAuthentication + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + 'method': {'required': True, 'constant': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[ActivityDependency]'}, + 'user_properties': {'key': 'userProperties', 'type': '[UserProperty]'}, + 'type': {'key': 'type', 'type': 'str'}, + 'method': {'key': 'typeProperties.method', 'type': 'str'}, + 'url': {'key': 'typeProperties.url', 'type': 'object'}, + 'timeout': {'key': 'typeProperties.timeout', 'type': 'str'}, + 'headers': {'key': 'typeProperties.headers', 'type': 'object'}, + 'body': {'key': 'typeProperties.body', 'type': 'object'}, + 'authentication': {'key': 'typeProperties.authentication', 'type': 'WebActivityAuthentication'}, + } + + method = "POST" + + def __init__(self, *, name: str, url, additional_properties=None, description: str=None, depends_on=None, user_properties=None, timeout: str=None, headers=None, body=None, authentication=None, **kwargs) -> None: + super(WebHookActivity, self).__init__(additional_properties=additional_properties, name=name, description=description, depends_on=depends_on, user_properties=user_properties, **kwargs) + self.url = url + self.timeout = timeout + self.headers = headers + self.body = body + self.authentication = authentication + self.type = 'WebHook'