diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py index fdd54957b36f..ed790633bf18 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py @@ -18,6 +18,7 @@ from .azure_key_vault_secret_reference_py3 import AzureKeyVaultSecretReference from .secret_base_py3 import SecretBase from .factory_identity_py3 import FactoryIdentity + from .factory_vsts_configuration_py3 import FactoryVSTSConfiguration from .factory_py3 import Factory from .integration_runtime_py3 import IntegrationRuntime from .integration_runtime_resource_py3 import IntegrationRuntimeResource @@ -39,6 +40,7 @@ from .trigger_resource_py3 import TriggerResource from .create_run_response_py3 import CreateRunResponse from .error_response_py3 import ErrorResponse, ErrorResponseException + from .factory_repo_update_py3 import FactoryRepoUpdate from .pipeline_reference_py3 import PipelineReference from .trigger_pipeline_reference_py3 import TriggerPipelineReference from .factory_update_parameters_py3 import FactoryUpdateParameters @@ -343,6 +345,7 @@ from .azure_key_vault_secret_reference import AzureKeyVaultSecretReference from .secret_base import SecretBase from .factory_identity import FactoryIdentity + from .factory_vsts_configuration import FactoryVSTSConfiguration from .factory import Factory from .integration_runtime import IntegrationRuntime from .integration_runtime_resource import IntegrationRuntimeResource @@ -364,6 +367,7 @@ from .trigger_resource import TriggerResource from .create_run_response import CreateRunResponse from .error_response import ErrorResponse, ErrorResponseException + from .factory_repo_update import FactoryRepoUpdate from .pipeline_reference import PipelineReference from .trigger_pipeline_reference import TriggerPipelineReference from .factory_update_parameters import FactoryUpdateParameters @@ -737,6 +741,7 @@ 'AzureKeyVaultSecretReference', 'SecretBase', 'FactoryIdentity', + 'FactoryVSTSConfiguration', 'Factory', 'IntegrationRuntime', 'IntegrationRuntimeResource', @@ -758,6 +763,7 @@ 'TriggerResource', 'CreateRunResponse', 'ErrorResponse', 'ErrorResponseException', + 'FactoryRepoUpdate', 'PipelineReference', 'TriggerPipelineReference', 'FactoryUpdateParameters', diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py index 3c1fdbada034..eaeaa060605e 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py @@ -39,6 +39,9 @@ class Factory(Resource): :vartype create_time: datetime :ivar version: Version of the factory. :vartype version: str + :param vsts_configuration: VSTS repo information of the factory. + :type vsts_configuration: + ~azure.mgmt.datafactory.models.FactoryVSTSConfiguration """ _validation = { @@ -61,6 +64,7 @@ class Factory(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'version': {'key': 'properties.version', 'type': 'str'}, + 'vsts_configuration': {'key': 'properties.vstsConfiguration', 'type': 'FactoryVSTSConfiguration'}, } def __init__(self, **kwargs): @@ -70,3 +74,4 @@ def __init__(self, **kwargs): self.provisioning_state = None self.create_time = None self.version = None + self.vsts_configuration = kwargs.get('vsts_configuration', None) diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_py3.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_py3.py index 5dd8f2e502ea..b718282c585a 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_py3.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_py3.py @@ -39,6 +39,9 @@ class Factory(Resource): :vartype create_time: datetime :ivar version: Version of the factory. :vartype version: str + :param vsts_configuration: VSTS repo information of the factory. + :type vsts_configuration: + ~azure.mgmt.datafactory.models.FactoryVSTSConfiguration """ _validation = { @@ -61,12 +64,14 @@ class Factory(Resource): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, 'version': {'key': 'properties.version', 'type': 'str'}, + 'vsts_configuration': {'key': 'properties.vstsConfiguration', 'type': 'FactoryVSTSConfiguration'}, } - def __init__(self, *, location: str=None, tags=None, additional_properties=None, identity=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, additional_properties=None, identity=None, vsts_configuration=None, **kwargs) -> None: super(Factory, self).__init__(location=location, tags=tags, **kwargs) self.additional_properties = additional_properties self.identity = identity self.provisioning_state = None self.create_time = None self.version = None + self.vsts_configuration = vsts_configuration diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update.py new file mode 100644 index 000000000000..7651442cd45c --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update.py @@ -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 FactoryRepoUpdate(Model): + """Factory's VSTS repo information. + + :param factory_resource_id: The factory resource id. + :type factory_resource_id: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vsts_configuration: VSTS repo information of the factory. + :type vsts_configuration: + ~azure.mgmt.datafactory.models.FactoryVSTSConfiguration + """ + + _attribute_map = { + 'factory_resource_id': {'key': 'factoryResourceId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vsts_configuration': {'key': 'vstsConfiguration', 'type': 'FactoryVSTSConfiguration'}, + } + + def __init__(self, **kwargs): + super(FactoryRepoUpdate, self).__init__(**kwargs) + self.factory_resource_id = kwargs.get('factory_resource_id', None) + self.resource_group_name = kwargs.get('resource_group_name', None) + self.vsts_configuration = kwargs.get('vsts_configuration', None) diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update_py3.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update_py3.py new file mode 100644 index 000000000000..160f3f80ea28 --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_repo_update_py3.py @@ -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 FactoryRepoUpdate(Model): + """Factory's VSTS repo information. + + :param factory_resource_id: The factory resource id. + :type factory_resource_id: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param vsts_configuration: VSTS repo information of the factory. + :type vsts_configuration: + ~azure.mgmt.datafactory.models.FactoryVSTSConfiguration + """ + + _attribute_map = { + 'factory_resource_id': {'key': 'factoryResourceId', 'type': 'str'}, + 'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'}, + 'vsts_configuration': {'key': 'vstsConfiguration', 'type': 'FactoryVSTSConfiguration'}, + } + + def __init__(self, *, factory_resource_id: str=None, resource_group_name: str=None, vsts_configuration=None, **kwargs) -> None: + super(FactoryRepoUpdate, self).__init__(**kwargs) + self.factory_resource_id = factory_resource_id + self.resource_group_name = resource_group_name + self.vsts_configuration = vsts_configuration diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration.py new file mode 100644 index 000000000000..c2c017197398 --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration.py @@ -0,0 +1,52 @@ +# 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 FactoryVSTSConfiguration(Model): + """Factory's VSTS repo information. + + :param account_name: VSTS account name. + :type account_name: str + :param project_name: VSTS project name. + :type project_name: str + :param repository_name: VSTS repository name. + :type repository_name: str + :param collaboration_branch: VSTS collaboration branch. + :type collaboration_branch: str + :param root_folder: VSTS root folder. + :type root_folder: str + :param last_commit_id: VSTS last commit id. + :type last_commit_id: str + :param tenant_id: VSTS tenant id. + :type tenant_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'}, + 'root_folder': {'key': 'rootFolder', 'type': 'str'}, + 'last_commit_id': {'key': 'lastCommitId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(FactoryVSTSConfiguration, self).__init__(**kwargs) + self.account_name = kwargs.get('account_name', None) + self.project_name = kwargs.get('project_name', None) + self.repository_name = kwargs.get('repository_name', None) + self.collaboration_branch = kwargs.get('collaboration_branch', None) + self.root_folder = kwargs.get('root_folder', None) + self.last_commit_id = kwargs.get('last_commit_id', None) + self.tenant_id = kwargs.get('tenant_id', None) diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration_py3.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration_py3.py new file mode 100644 index 000000000000..49d6fe8b7a29 --- /dev/null +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_vsts_configuration_py3.py @@ -0,0 +1,52 @@ +# 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 FactoryVSTSConfiguration(Model): + """Factory's VSTS repo information. + + :param account_name: VSTS account name. + :type account_name: str + :param project_name: VSTS project name. + :type project_name: str + :param repository_name: VSTS repository name. + :type repository_name: str + :param collaboration_branch: VSTS collaboration branch. + :type collaboration_branch: str + :param root_folder: VSTS root folder. + :type root_folder: str + :param last_commit_id: VSTS last commit id. + :type last_commit_id: str + :param tenant_id: VSTS tenant id. + :type tenant_id: str + """ + + _attribute_map = { + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'}, + 'root_folder': {'key': 'rootFolder', 'type': 'str'}, + 'last_commit_id': {'key': 'lastCommitId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, account_name: str=None, project_name: str=None, repository_name: str=None, collaboration_branch: str=None, root_folder: str=None, last_commit_id: str=None, tenant_id: str=None, **kwargs) -> None: + super(FactoryVSTSConfiguration, self).__init__(**kwargs) + self.account_name = account_name + self.project_name = project_name + self.repository_name = repository_name + self.collaboration_branch = collaboration_branch + self.root_folder = root_folder + self.last_commit_id = last_commit_id + self.tenant_id = tenant_id diff --git a/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/factories_operations.py b/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/factories_operations.py index 2714690eda35..0a64dbac9083 100644 --- a/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/factories_operations.py +++ b/azure-mgmt-datafactory/azure/mgmt/datafactory/operations/factories_operations.py @@ -100,6 +100,71 @@ def internal_paging(next_link=None, raw=False): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories'} + def configure_factory_repo( + self, location_id, factory_repo_update, custom_headers=None, raw=False, **operation_config): + """Updates a factory's repo information. + + :param location_id: The location identifier. + :type location_id: str + :param factory_repo_update: Update factory repo request definition. + :type factory_repo_update: + ~azure.mgmt.datafactory.models.FactoryRepoUpdate + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Factory or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.datafactory.models.Factory or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.configure_factory_repo.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'locationId': self._serialize.url("location_id", location_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(factory_repo_update, 'FactoryRepoUpdate') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Factory', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + configure_factory_repo.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo'} + def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists factories.