Skip to content

Commit

Permalink
[AutoPR datafactory/resource-manager] [Datafactory] Add Azure Functio…
Browse files Browse the repository at this point in the history
…n to Swagger (#4146)

* Generated from fe85d670b4a1a49325414614087c0c4558353da6

Azure Function changes

* Generated from 19263c53213686a6807712e57fb85b1ab1840266

update defn

* Generated from 41fb59ae051421c105bddd407e98a3605d17e297

update object to secret base
  • Loading branch information
AutorestCI authored Jan 18, 2019
1 parent a220bc0 commit 97918c8
Show file tree
Hide file tree
Showing 10 changed files with 375 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
from .schedule_trigger_recurrence_py3 import ScheduleTriggerRecurrence
from .schedule_trigger_py3 import ScheduleTrigger
from .multiple_pipeline_trigger_py3 import MultiplePipelineTrigger
from .azure_function_linked_service_py3 import AzureFunctionLinkedService
from .responsys_linked_service_py3 import ResponsysLinkedService
from .azure_databricks_linked_service_py3 import AzureDatabricksLinkedService
from .azure_data_lake_analytics_linked_service_py3 import AzureDataLakeAnalyticsLinkedService
Expand Down Expand Up @@ -236,6 +237,7 @@
from .azure_blob_dataset_py3 import AzureBlobDataset
from .amazon_s3_dataset_py3 import AmazonS3Dataset
from .activity_policy_py3 import ActivityPolicy
from .azure_function_activity_py3 import AzureFunctionActivity
from .databricks_spark_python_activity_py3 import DatabricksSparkPythonActivity
from .databricks_spark_jar_activity_py3 import DatabricksSparkJarActivity
from .databricks_notebook_activity_py3 import DatabricksNotebookActivity
Expand Down Expand Up @@ -458,6 +460,7 @@
from .schedule_trigger_recurrence import ScheduleTriggerRecurrence
from .schedule_trigger import ScheduleTrigger
from .multiple_pipeline_trigger import MultiplePipelineTrigger
from .azure_function_linked_service import AzureFunctionLinkedService
from .responsys_linked_service import ResponsysLinkedService
from .azure_databricks_linked_service import AzureDatabricksLinkedService
from .azure_data_lake_analytics_linked_service import AzureDataLakeAnalyticsLinkedService
Expand Down Expand Up @@ -600,6 +603,7 @@
from .azure_blob_dataset import AzureBlobDataset
from .amazon_s3_dataset import AmazonS3Dataset
from .activity_policy import ActivityPolicy
from .azure_function_activity import AzureFunctionActivity
from .databricks_spark_python_activity import DatabricksSparkPythonActivity
from .databricks_spark_jar_activity import DatabricksSparkJarActivity
from .databricks_notebook_activity import DatabricksNotebookActivity
Expand Down Expand Up @@ -785,6 +789,7 @@
SybaseAuthenticationType,
DatasetCompressionLevel,
JsonFormatFilePattern,
AzureFunctionActivityMethod,
WebActivityMethod,
CassandraSourceReadConsistencyLevels,
StoredProcedureParameterType,
Expand Down Expand Up @@ -892,6 +897,7 @@
'ScheduleTriggerRecurrence',
'ScheduleTrigger',
'MultiplePipelineTrigger',
'AzureFunctionLinkedService',
'ResponsysLinkedService',
'AzureDatabricksLinkedService',
'AzureDataLakeAnalyticsLinkedService',
Expand Down Expand Up @@ -1034,6 +1040,7 @@
'AzureBlobDataset',
'AmazonS3Dataset',
'ActivityPolicy',
'AzureFunctionActivity',
'DatabricksSparkPythonActivity',
'DatabricksSparkJarActivity',
'DatabricksNotebookActivity',
Expand Down Expand Up @@ -1218,6 +1225,7 @@
'SybaseAuthenticationType',
'DatasetCompressionLevel',
'JsonFormatFilePattern',
'AzureFunctionActivityMethod',
'WebActivityMethod',
'CassandraSourceReadConsistencyLevels',
'StoredProcedureParameterType',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 .execution_activity import ExecutionActivity


class AzureFunctionActivity(ExecutionActivity):
"""Azure Function activity.
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
:param linked_service_name: Linked service reference.
:type linked_service_name:
~azure.mgmt.datafactory.models.LinkedServiceReference
:param policy: Activity policy.
:type policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:param method: Required. Rest API method for target endpoint. Possible
values include: 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'TRACE'
:type method: str or
~azure.mgmt.datafactory.models.AzureFunctionActivityMethod
:param function_name: Required. Name of the Function that the Azure
Function Activity will call. Type: string (or Expression with resultType
string)
:type function_name: object
: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
"""

_validation = {
'name': {'required': True},
'type': {'required': True},
'method': {'required': True},
'function_name': {'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'},
'linked_service_name': {'key': 'linkedServiceName', 'type': 'LinkedServiceReference'},
'policy': {'key': 'policy', 'type': 'ActivityPolicy'},
'method': {'key': 'typeProperties.method', 'type': 'str'},
'function_name': {'key': 'typeProperties.functionName', 'type': 'object'},
'headers': {'key': 'typeProperties.headers', 'type': 'object'},
'body': {'key': 'typeProperties.body', 'type': 'object'},
}

def __init__(self, **kwargs):
super(AzureFunctionActivity, self).__init__(**kwargs)
self.method = kwargs.get('method', None)
self.function_name = kwargs.get('function_name', None)
self.headers = kwargs.get('headers', None)
self.body = kwargs.get('body', None)
self.type = 'AzureFunctionActivity'
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 .execution_activity_py3 import ExecutionActivity


class AzureFunctionActivity(ExecutionActivity):
"""Azure Function activity.
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
:param linked_service_name: Linked service reference.
:type linked_service_name:
~azure.mgmt.datafactory.models.LinkedServiceReference
:param policy: Activity policy.
:type policy: ~azure.mgmt.datafactory.models.ActivityPolicy
:param method: Required. Rest API method for target endpoint. Possible
values include: 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'TRACE'
:type method: str or
~azure.mgmt.datafactory.models.AzureFunctionActivityMethod
:param function_name: Required. Name of the Function that the Azure
Function Activity will call. Type: string (or Expression with resultType
string)
:type function_name: object
: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
"""

_validation = {
'name': {'required': True},
'type': {'required': True},
'method': {'required': True},
'function_name': {'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'},
'linked_service_name': {'key': 'linkedServiceName', 'type': 'LinkedServiceReference'},
'policy': {'key': 'policy', 'type': 'ActivityPolicy'},
'method': {'key': 'typeProperties.method', 'type': 'str'},
'function_name': {'key': 'typeProperties.functionName', 'type': 'object'},
'headers': {'key': 'typeProperties.headers', 'type': 'object'},
'body': {'key': 'typeProperties.body', 'type': 'object'},
}

def __init__(self, *, name: str, method, function_name, additional_properties=None, description: str=None, depends_on=None, user_properties=None, linked_service_name=None, policy=None, headers=None, body=None, **kwargs) -> None:
super(AzureFunctionActivity, self).__init__(additional_properties=additional_properties, name=name, description=description, depends_on=depends_on, user_properties=user_properties, linked_service_name=linked_service_name, policy=policy, **kwargs)
self.method = method
self.function_name = function_name
self.headers = headers
self.body = body
self.type = 'AzureFunctionActivity'
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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 .linked_service import LinkedService


class AzureFunctionLinkedService(LinkedService):
"""Azure Function linked service.
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 connect_via: The integration runtime reference.
:type connect_via:
~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:param description: Linked service description.
:type description: str
:param parameters: Parameters for linked service.
:type parameters: dict[str,
~azure.mgmt.datafactory.models.ParameterSpecification]
:param annotations: List of tags that can be used for describing the
Dataset.
:type annotations: list[object]
:param type: Required. Constant filled by server.
:type type: str
:param function_app_url: Required. The endpoint of the Azure Function App.
URL will be in the format https://<accountName>.azurewebsites.net.
:type function_app_url: object
:param function_key: Function or Host key for Azure Function App.
:type function_key: ~azure.mgmt.datafactory.models.SecretBase
:param encrypted_credential: The encrypted credential used for
authentication. Credentials are encrypted using the integration runtime
credential manager. Type: string (or Expression with resultType string).
:type encrypted_credential: object
"""

_validation = {
'type': {'required': True},
'function_app_url': {'required': True},
}

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'connect_via': {'key': 'connectVia', 'type': 'IntegrationRuntimeReference'},
'description': {'key': 'description', 'type': 'str'},
'parameters': {'key': 'parameters', 'type': '{ParameterSpecification}'},
'annotations': {'key': 'annotations', 'type': '[object]'},
'type': {'key': 'type', 'type': 'str'},
'function_app_url': {'key': 'typeProperties.functionAppUrl', 'type': 'object'},
'function_key': {'key': 'typeProperties.functionKey', 'type': 'SecretBase'},
'encrypted_credential': {'key': 'typeProperties.encryptedCredential', 'type': 'object'},
}

def __init__(self, **kwargs):
super(AzureFunctionLinkedService, self).__init__(**kwargs)
self.function_app_url = kwargs.get('function_app_url', None)
self.function_key = kwargs.get('function_key', None)
self.encrypted_credential = kwargs.get('encrypted_credential', None)
self.type = 'AzureFunction'
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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 .linked_service_py3 import LinkedService


class AzureFunctionLinkedService(LinkedService):
"""Azure Function linked service.
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 connect_via: The integration runtime reference.
:type connect_via:
~azure.mgmt.datafactory.models.IntegrationRuntimeReference
:param description: Linked service description.
:type description: str
:param parameters: Parameters for linked service.
:type parameters: dict[str,
~azure.mgmt.datafactory.models.ParameterSpecification]
:param annotations: List of tags that can be used for describing the
Dataset.
:type annotations: list[object]
:param type: Required. Constant filled by server.
:type type: str
:param function_app_url: Required. The endpoint of the Azure Function App.
URL will be in the format https://<accountName>.azurewebsites.net.
:type function_app_url: object
:param function_key: Function or Host key for Azure Function App.
:type function_key: ~azure.mgmt.datafactory.models.SecretBase
:param encrypted_credential: The encrypted credential used for
authentication. Credentials are encrypted using the integration runtime
credential manager. Type: string (or Expression with resultType string).
:type encrypted_credential: object
"""

_validation = {
'type': {'required': True},
'function_app_url': {'required': True},
}

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'connect_via': {'key': 'connectVia', 'type': 'IntegrationRuntimeReference'},
'description': {'key': 'description', 'type': 'str'},
'parameters': {'key': 'parameters', 'type': '{ParameterSpecification}'},
'annotations': {'key': 'annotations', 'type': '[object]'},
'type': {'key': 'type', 'type': 'str'},
'function_app_url': {'key': 'typeProperties.functionAppUrl', 'type': 'object'},
'function_key': {'key': 'typeProperties.functionKey', 'type': 'SecretBase'},
'encrypted_credential': {'key': 'typeProperties.encryptedCredential', 'type': 'object'},
}

def __init__(self, *, function_app_url, additional_properties=None, connect_via=None, description: str=None, parameters=None, annotations=None, function_key=None, encrypted_credential=None, **kwargs) -> None:
super(AzureFunctionLinkedService, self).__init__(additional_properties=additional_properties, connect_via=connect_via, description=description, parameters=parameters, annotations=annotations, **kwargs)
self.function_app_url = function_app_url
self.function_key = function_key
self.encrypted_credential = encrypted_credential
self.type = 'AzureFunction'
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@ class JsonFormatFilePattern(str, Enum):
array_of_objects = "arrayOfObjects"


class AzureFunctionActivityMethod(str, Enum):

get = "GET"
post = "POST"
put = "PUT"
delete = "DELETE"
options = "OPTIONS"
head = "HEAD"
trace = "TRACE"


class WebActivityMethod(str, Enum):

get = "GET"
Expand Down
Loading

0 comments on commit 97918c8

Please sign in to comment.