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 datafactory/resource-manager] Add Pipeline Variables / Set Variable Activity / Append Variable Activity #3465

Merged
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
11 changes: 11 additions & 0 deletions azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from .activity_dependency_py3 import ActivityDependency
from .user_property_py3 import UserProperty
from .activity_py3 import Activity
from .variable_specification_py3 import VariableSpecification
from .pipeline_folder_py3 import PipelineFolder
from .pipeline_resource_py3 import PipelineResource
from .trigger_py3 import Trigger
Expand Down Expand Up @@ -325,6 +326,8 @@
from .copy_sink_py3 import CopySink
from .copy_activity_py3 import CopyActivity
from .execution_activity_py3 import ExecutionActivity
from .append_variable_activity_py3 import AppendVariableActivity
from .set_variable_activity_py3 import SetVariableActivity
from .filter_activity_py3 import FilterActivity
from .until_activity_py3 import UntilActivity
from .wait_activity_py3 import WaitActivity
Expand Down Expand Up @@ -385,6 +388,7 @@
from .activity_dependency import ActivityDependency
from .user_property import UserProperty
from .activity import Activity
from .variable_specification import VariableSpecification
from .pipeline_folder import PipelineFolder
from .pipeline_resource import PipelineResource
from .trigger import Trigger
Expand Down Expand Up @@ -671,6 +675,8 @@
from .copy_sink import CopySink
from .copy_activity import CopyActivity
from .execution_activity import ExecutionActivity
from .append_variable_activity import AppendVariableActivity
from .set_variable_activity import SetVariableActivity
from .filter_activity import FilterActivity
from .until_activity import UntilActivity
from .wait_activity import WaitActivity
Expand Down Expand Up @@ -713,6 +719,7 @@
IntegrationRuntimeAutoUpdate,
ParameterType,
DependencyCondition,
VariableType,
TriggerRuntimeState,
RunQueryFilterOperand,
RunQueryFilterOperator,
Expand Down Expand Up @@ -799,6 +806,7 @@
'ActivityDependency',
'UserProperty',
'Activity',
'VariableSpecification',
'PipelineFolder',
'PipelineResource',
'Trigger',
Expand Down Expand Up @@ -1085,6 +1093,8 @@
'CopySink',
'CopyActivity',
'ExecutionActivity',
'AppendVariableActivity',
'SetVariableActivity',
'FilterActivity',
'UntilActivity',
'WaitActivity',
Expand Down Expand Up @@ -1126,6 +1136,7 @@
'IntegrationRuntimeAutoUpdate',
'ParameterType',
'DependencyCondition',
'VariableType',
'TriggerRuntimeState',
'RunQueryFilterOperand',
'RunQueryFilterOperator',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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 AppendVariableActivity(ControlActivity):
"""Append value for a Variable of type Array.

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 variable_name: Name of the variable whose value needs to be
appended to.
:type variable_name: str
:param value: Value to be appended. Could be a static value or Expression
:type value: object
"""

_validation = {
'name': {'required': True},
'type': {'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'},
'variable_name': {'key': 'typeProperties.variableName', 'type': 'str'},
'value': {'key': 'typeProperties.value', 'type': 'object'},
}

def __init__(self, **kwargs):
super(AppendVariableActivity, self).__init__(**kwargs)
self.variable_name = kwargs.get('variable_name', None)
self.value = kwargs.get('value', None)
self.type = 'AppendVariable'
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 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 AppendVariableActivity(ControlActivity):
"""Append value for a Variable of type Array.

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 variable_name: Name of the variable whose value needs to be
appended to.
:type variable_name: str
:param value: Value to be appended. Could be a static value or Expression
:type value: object
"""

_validation = {
'name': {'required': True},
'type': {'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'},
'variable_name': {'key': 'typeProperties.variableName', 'type': 'str'},
'value': {'key': 'typeProperties.value', 'type': 'object'},
}

def __init__(self, *, name: str, additional_properties=None, description: str=None, depends_on=None, user_properties=None, variable_name: str=None, value=None, **kwargs) -> None:
super(AppendVariableActivity, self).__init__(additional_properties=additional_properties, name=name, description=description, depends_on=depends_on, user_properties=user_properties, **kwargs)
self.variable_name = variable_name
self.value = value
self.type = 'AppendVariable'
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +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: FilterActivity, UntilActivity, WaitActivity,
ForEachActivity, IfConditionActivity, ExecutePipelineActivity
sub-classes are: AppendVariableActivity, SetVariableActivity,
FilterActivity, UntilActivity, WaitActivity, ForEachActivity,
IfConditionActivity, ExecutePipelineActivity

All required parameters must be populated in order to send to Azure.

Expand Down Expand Up @@ -51,7 +52,7 @@ class ControlActivity(Activity):
}

_subtype_map = {
'type': {'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'}
'type': {'AppendVariable': 'AppendVariableActivity', 'SetVariable': 'SetVariableActivity', 'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'}
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +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: FilterActivity, UntilActivity, WaitActivity,
ForEachActivity, IfConditionActivity, ExecutePipelineActivity
sub-classes are: AppendVariableActivity, SetVariableActivity,
FilterActivity, UntilActivity, WaitActivity, ForEachActivity,
IfConditionActivity, ExecutePipelineActivity

All required parameters must be populated in order to send to Azure.

Expand Down Expand Up @@ -51,7 +52,7 @@ class ControlActivity(Activity):
}

_subtype_map = {
'type': {'Filter': 'FilterActivity', 'Until': 'UntilActivity', 'Wait': 'WaitActivity', 'ForEach': 'ForEachActivity', 'IfCondition': 'IfConditionActivity', 'ExecutePipeline': 'ExecutePipelineActivity'}
'type': {'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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ class DependencyCondition(str, Enum):
completed = "Completed"


class VariableType(str, Enum):

string = "String"
bool_enum = "Bool"
array = "Array"


class TriggerRuntimeState(str, Enum):

started = "Started"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class PipelineResource(SubResource):
:param parameters: List of parameters for pipeline.
:type parameters: dict[str,
~azure.mgmt.datafactory.models.ParameterSpecification]
:param variables: List of variables for pipeline.
:type variables: dict[str,
~azure.mgmt.datafactory.models.VariableSpecification]
:param concurrency: The max number of concurrent runs for the pipeline.
:type concurrency: int
:param annotations: List of tags that can be used for describing the
Expand Down Expand Up @@ -63,6 +66,7 @@ class PipelineResource(SubResource):
'description': {'key': 'properties.description', 'type': 'str'},
'activities': {'key': 'properties.activities', 'type': '[Activity]'},
'parameters': {'key': 'properties.parameters', 'type': '{ParameterSpecification}'},
'variables': {'key': 'properties.variables', 'type': '{VariableSpecification}'},
'concurrency': {'key': 'properties.concurrency', 'type': 'int'},
'annotations': {'key': 'properties.annotations', 'type': '[object]'},
'folder': {'key': 'properties.folder', 'type': 'PipelineFolder'},
Expand All @@ -74,6 +78,7 @@ def __init__(self, **kwargs):
self.description = kwargs.get('description', None)
self.activities = kwargs.get('activities', None)
self.parameters = kwargs.get('parameters', None)
self.variables = kwargs.get('variables', None)
self.concurrency = kwargs.get('concurrency', None)
self.annotations = kwargs.get('annotations', None)
self.folder = kwargs.get('folder', None)
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class PipelineResource(SubResource):
:param parameters: List of parameters for pipeline.
:type parameters: dict[str,
~azure.mgmt.datafactory.models.ParameterSpecification]
:param variables: List of variables for pipeline.
:type variables: dict[str,
~azure.mgmt.datafactory.models.VariableSpecification]
:param concurrency: The max number of concurrent runs for the pipeline.
:type concurrency: int
:param annotations: List of tags that can be used for describing the
Expand Down Expand Up @@ -63,17 +66,19 @@ class PipelineResource(SubResource):
'description': {'key': 'properties.description', 'type': 'str'},
'activities': {'key': 'properties.activities', 'type': '[Activity]'},
'parameters': {'key': 'properties.parameters', 'type': '{ParameterSpecification}'},
'variables': {'key': 'properties.variables', 'type': '{VariableSpecification}'},
'concurrency': {'key': 'properties.concurrency', 'type': 'int'},
'annotations': {'key': 'properties.annotations', 'type': '[object]'},
'folder': {'key': 'properties.folder', 'type': 'PipelineFolder'},
}

def __init__(self, *, additional_properties=None, description: str=None, activities=None, parameters=None, concurrency: int=None, annotations=None, folder=None, **kwargs) -> None:
def __init__(self, *, additional_properties=None, description: str=None, activities=None, parameters=None, variables=None, concurrency: int=None, annotations=None, folder=None, **kwargs) -> None:
super(PipelineResource, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.description = description
self.activities = activities
self.parameters = parameters
self.variables = variables
self.concurrency = concurrency
self.annotations = annotations
self.folder = folder
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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 SetVariableActivity(ControlActivity):
"""Set value for a Variable.

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 variable_name: Name of the variable whose value needs to be set.
:type variable_name: str
:param value: Value to be set. Could be a static value or Expression
:type value: object
"""

_validation = {
'name': {'required': True},
'type': {'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'},
'variable_name': {'key': 'typeProperties.variableName', 'type': 'str'},
'value': {'key': 'typeProperties.value', 'type': 'object'},
}

def __init__(self, **kwargs):
super(SetVariableActivity, self).__init__(**kwargs)
self.variable_name = kwargs.get('variable_name', None)
self.value = kwargs.get('value', None)
self.type = 'SetVariable'
Loading