Skip to content

Commit e28deb2

Browse files
authored
[AutoPR datafactory/resource-manager] add configure repo api swagger (#2392)
* Generated from d7f5567289add61a8368ce9bf1a710264183366c add configure repo api swagger * Generated from 42b127de426d2e7e62893799af31cfac6a58b07d fixing autorest issue * Generated from 27d71a427c73a4adfd90f2347ba5c0a9e0403e7d change route * Generated from 2c233a59f11801e38916d47e13019b26ea4566ed fix per comments * Generated from fa5757e279b6732dedc799857b4b8cbaac22a663 change factoryId for factoryResourceId * Generated from 47d1905337fe73deee6e623add5eaafb62caf5d0 rename example * Generated from 47d1905337fe73deee6e623add5eaafb62caf5d0 rename example
1 parent 5475faa commit e28deb2

File tree

8 files changed

+260
-1
lines changed

8 files changed

+260
-1
lines changed

azure-mgmt-datafactory/azure/mgmt/datafactory/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .azure_key_vault_secret_reference_py3 import AzureKeyVaultSecretReference
1919
from .secret_base_py3 import SecretBase
2020
from .factory_identity_py3 import FactoryIdentity
21+
from .factory_vsts_configuration_py3 import FactoryVSTSConfiguration
2122
from .factory_py3 import Factory
2223
from .integration_runtime_py3 import IntegrationRuntime
2324
from .integration_runtime_resource_py3 import IntegrationRuntimeResource
@@ -39,6 +40,7 @@
3940
from .trigger_resource_py3 import TriggerResource
4041
from .create_run_response_py3 import CreateRunResponse
4142
from .error_response_py3 import ErrorResponse, ErrorResponseException
43+
from .factory_repo_update_py3 import FactoryRepoUpdate
4244
from .pipeline_reference_py3 import PipelineReference
4345
from .trigger_pipeline_reference_py3 import TriggerPipelineReference
4446
from .factory_update_parameters_py3 import FactoryUpdateParameters
@@ -343,6 +345,7 @@
343345
from .azure_key_vault_secret_reference import AzureKeyVaultSecretReference
344346
from .secret_base import SecretBase
345347
from .factory_identity import FactoryIdentity
348+
from .factory_vsts_configuration import FactoryVSTSConfiguration
346349
from .factory import Factory
347350
from .integration_runtime import IntegrationRuntime
348351
from .integration_runtime_resource import IntegrationRuntimeResource
@@ -364,6 +367,7 @@
364367
from .trigger_resource import TriggerResource
365368
from .create_run_response import CreateRunResponse
366369
from .error_response import ErrorResponse, ErrorResponseException
370+
from .factory_repo_update import FactoryRepoUpdate
367371
from .pipeline_reference import PipelineReference
368372
from .trigger_pipeline_reference import TriggerPipelineReference
369373
from .factory_update_parameters import FactoryUpdateParameters
@@ -737,6 +741,7 @@
737741
'AzureKeyVaultSecretReference',
738742
'SecretBase',
739743
'FactoryIdentity',
744+
'FactoryVSTSConfiguration',
740745
'Factory',
741746
'IntegrationRuntime',
742747
'IntegrationRuntimeResource',
@@ -758,6 +763,7 @@
758763
'TriggerResource',
759764
'CreateRunResponse',
760765
'ErrorResponse', 'ErrorResponseException',
766+
'FactoryRepoUpdate',
761767
'PipelineReference',
762768
'TriggerPipelineReference',
763769
'FactoryUpdateParameters',

azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class Factory(Resource):
3939
:vartype create_time: datetime
4040
:ivar version: Version of the factory.
4141
:vartype version: str
42+
:param vsts_configuration: VSTS repo information of the factory.
43+
:type vsts_configuration:
44+
~azure.mgmt.datafactory.models.FactoryVSTSConfiguration
4245
"""
4346

4447
_validation = {
@@ -61,6 +64,7 @@ class Factory(Resource):
6164
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
6265
'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'},
6366
'version': {'key': 'properties.version', 'type': 'str'},
67+
'vsts_configuration': {'key': 'properties.vstsConfiguration', 'type': 'FactoryVSTSConfiguration'},
6468
}
6569

6670
def __init__(self, **kwargs):
@@ -70,3 +74,4 @@ def __init__(self, **kwargs):
7074
self.provisioning_state = None
7175
self.create_time = None
7276
self.version = None
77+
self.vsts_configuration = kwargs.get('vsts_configuration', None)

azure-mgmt-datafactory/azure/mgmt/datafactory/models/factory_py3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class Factory(Resource):
3939
:vartype create_time: datetime
4040
:ivar version: Version of the factory.
4141
:vartype version: str
42+
:param vsts_configuration: VSTS repo information of the factory.
43+
:type vsts_configuration:
44+
~azure.mgmt.datafactory.models.FactoryVSTSConfiguration
4245
"""
4346

4447
_validation = {
@@ -61,12 +64,14 @@ class Factory(Resource):
6164
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
6265
'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'},
6366
'version': {'key': 'properties.version', 'type': 'str'},
67+
'vsts_configuration': {'key': 'properties.vstsConfiguration', 'type': 'FactoryVSTSConfiguration'},
6468
}
6569

66-
def __init__(self, *, location: str=None, tags=None, additional_properties=None, identity=None, **kwargs) -> None:
70+
def __init__(self, *, location: str=None, tags=None, additional_properties=None, identity=None, vsts_configuration=None, **kwargs) -> None:
6771
super(Factory, self).__init__(location=location, tags=tags, **kwargs)
6872
self.additional_properties = additional_properties
6973
self.identity = identity
7074
self.provisioning_state = None
7175
self.create_time = None
7276
self.version = None
77+
self.vsts_configuration = vsts_configuration
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class FactoryRepoUpdate(Model):
16+
"""Factory's VSTS repo information.
17+
18+
:param factory_resource_id: The factory resource id.
19+
:type factory_resource_id: str
20+
:param resource_group_name: The resource group name.
21+
:type resource_group_name: str
22+
:param vsts_configuration: VSTS repo information of the factory.
23+
:type vsts_configuration:
24+
~azure.mgmt.datafactory.models.FactoryVSTSConfiguration
25+
"""
26+
27+
_attribute_map = {
28+
'factory_resource_id': {'key': 'factoryResourceId', 'type': 'str'},
29+
'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'},
30+
'vsts_configuration': {'key': 'vstsConfiguration', 'type': 'FactoryVSTSConfiguration'},
31+
}
32+
33+
def __init__(self, **kwargs):
34+
super(FactoryRepoUpdate, self).__init__(**kwargs)
35+
self.factory_resource_id = kwargs.get('factory_resource_id', None)
36+
self.resource_group_name = kwargs.get('resource_group_name', None)
37+
self.vsts_configuration = kwargs.get('vsts_configuration', None)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class FactoryRepoUpdate(Model):
16+
"""Factory's VSTS repo information.
17+
18+
:param factory_resource_id: The factory resource id.
19+
:type factory_resource_id: str
20+
:param resource_group_name: The resource group name.
21+
:type resource_group_name: str
22+
:param vsts_configuration: VSTS repo information of the factory.
23+
:type vsts_configuration:
24+
~azure.mgmt.datafactory.models.FactoryVSTSConfiguration
25+
"""
26+
27+
_attribute_map = {
28+
'factory_resource_id': {'key': 'factoryResourceId', 'type': 'str'},
29+
'resource_group_name': {'key': 'resourceGroupName', 'type': 'str'},
30+
'vsts_configuration': {'key': 'vstsConfiguration', 'type': 'FactoryVSTSConfiguration'},
31+
}
32+
33+
def __init__(self, *, factory_resource_id: str=None, resource_group_name: str=None, vsts_configuration=None, **kwargs) -> None:
34+
super(FactoryRepoUpdate, self).__init__(**kwargs)
35+
self.factory_resource_id = factory_resource_id
36+
self.resource_group_name = resource_group_name
37+
self.vsts_configuration = vsts_configuration
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class FactoryVSTSConfiguration(Model):
16+
"""Factory's VSTS repo information.
17+
18+
:param account_name: VSTS account name.
19+
:type account_name: str
20+
:param project_name: VSTS project name.
21+
:type project_name: str
22+
:param repository_name: VSTS repository name.
23+
:type repository_name: str
24+
:param collaboration_branch: VSTS collaboration branch.
25+
:type collaboration_branch: str
26+
:param root_folder: VSTS root folder.
27+
:type root_folder: str
28+
:param last_commit_id: VSTS last commit id.
29+
:type last_commit_id: str
30+
:param tenant_id: VSTS tenant id.
31+
:type tenant_id: str
32+
"""
33+
34+
_attribute_map = {
35+
'account_name': {'key': 'accountName', 'type': 'str'},
36+
'project_name': {'key': 'projectName', 'type': 'str'},
37+
'repository_name': {'key': 'repositoryName', 'type': 'str'},
38+
'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'},
39+
'root_folder': {'key': 'rootFolder', 'type': 'str'},
40+
'last_commit_id': {'key': 'lastCommitId', 'type': 'str'},
41+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
42+
}
43+
44+
def __init__(self, **kwargs):
45+
super(FactoryVSTSConfiguration, self).__init__(**kwargs)
46+
self.account_name = kwargs.get('account_name', None)
47+
self.project_name = kwargs.get('project_name', None)
48+
self.repository_name = kwargs.get('repository_name', None)
49+
self.collaboration_branch = kwargs.get('collaboration_branch', None)
50+
self.root_folder = kwargs.get('root_folder', None)
51+
self.last_commit_id = kwargs.get('last_commit_id', None)
52+
self.tenant_id = kwargs.get('tenant_id', None)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class FactoryVSTSConfiguration(Model):
16+
"""Factory's VSTS repo information.
17+
18+
:param account_name: VSTS account name.
19+
:type account_name: str
20+
:param project_name: VSTS project name.
21+
:type project_name: str
22+
:param repository_name: VSTS repository name.
23+
:type repository_name: str
24+
:param collaboration_branch: VSTS collaboration branch.
25+
:type collaboration_branch: str
26+
:param root_folder: VSTS root folder.
27+
:type root_folder: str
28+
:param last_commit_id: VSTS last commit id.
29+
:type last_commit_id: str
30+
:param tenant_id: VSTS tenant id.
31+
:type tenant_id: str
32+
"""
33+
34+
_attribute_map = {
35+
'account_name': {'key': 'accountName', 'type': 'str'},
36+
'project_name': {'key': 'projectName', 'type': 'str'},
37+
'repository_name': {'key': 'repositoryName', 'type': 'str'},
38+
'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'},
39+
'root_folder': {'key': 'rootFolder', 'type': 'str'},
40+
'last_commit_id': {'key': 'lastCommitId', 'type': 'str'},
41+
'tenant_id': {'key': 'tenantId', 'type': 'str'},
42+
}
43+
44+
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:
45+
super(FactoryVSTSConfiguration, self).__init__(**kwargs)
46+
self.account_name = account_name
47+
self.project_name = project_name
48+
self.repository_name = repository_name
49+
self.collaboration_branch = collaboration_branch
50+
self.root_folder = root_folder
51+
self.last_commit_id = last_commit_id
52+
self.tenant_id = tenant_id

azure-mgmt-datafactory/azure/mgmt/datafactory/operations/factories_operations.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,71 @@ def internal_paging(next_link=None, raw=False):
100100
return deserialized
101101
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories'}
102102

103+
def configure_factory_repo(
104+
self, location_id, factory_repo_update, custom_headers=None, raw=False, **operation_config):
105+
"""Updates a factory's repo information.
106+
107+
:param location_id: The location identifier.
108+
:type location_id: str
109+
:param factory_repo_update: Update factory repo request definition.
110+
:type factory_repo_update:
111+
~azure.mgmt.datafactory.models.FactoryRepoUpdate
112+
:param dict custom_headers: headers that will be added to the request
113+
:param bool raw: returns the direct response alongside the
114+
deserialized response
115+
:param operation_config: :ref:`Operation configuration
116+
overrides<msrest:optionsforoperations>`.
117+
:return: Factory or ClientRawResponse if raw=true
118+
:rtype: ~azure.mgmt.datafactory.models.Factory or
119+
~msrest.pipeline.ClientRawResponse
120+
:raises:
121+
:class:`ErrorResponseException<azure.mgmt.datafactory.models.ErrorResponseException>`
122+
"""
123+
# Construct URL
124+
url = self.configure_factory_repo.metadata['url']
125+
path_format_arguments = {
126+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
127+
'locationId': self._serialize.url("location_id", location_id, 'str')
128+
}
129+
url = self._client.format_url(url, **path_format_arguments)
130+
131+
# Construct parameters
132+
query_parameters = {}
133+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
134+
135+
# Construct headers
136+
header_parameters = {}
137+
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
138+
if self.config.generate_client_request_id:
139+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
140+
if custom_headers:
141+
header_parameters.update(custom_headers)
142+
if self.config.accept_language is not None:
143+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
144+
145+
# Construct body
146+
body_content = self._serialize.body(factory_repo_update, 'FactoryRepoUpdate')
147+
148+
# Construct and send request
149+
request = self._client.post(url, query_parameters)
150+
response = self._client.send(
151+
request, header_parameters, body_content, stream=False, **operation_config)
152+
153+
if response.status_code not in [200]:
154+
raise models.ErrorResponseException(self._deserialize, response)
155+
156+
deserialized = None
157+
158+
if response.status_code == 200:
159+
deserialized = self._deserialize('Factory', response)
160+
161+
if raw:
162+
client_raw_response = ClientRawResponse(deserialized, response)
163+
return client_raw_response
164+
165+
return deserialized
166+
configure_factory_repo.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo'}
167+
103168
def list_by_resource_group(
104169
self, resource_group_name, custom_headers=None, raw=False, **operation_config):
105170
"""Lists factories.

0 commit comments

Comments
 (0)