Skip to content

Commit

Permalink
[AutoPR datafactory/resource-manager] add configure repo api swagger (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
AutorestCI authored May 22, 2018
1 parent 5475faa commit e28deb2
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -737,6 +741,7 @@
'AzureKeyVaultSecretReference',
'SecretBase',
'FactoryIdentity',
'FactoryVSTSConfiguration',
'Factory',
'IntegrationRuntime',
'IntegrationRuntimeResource',
Expand All @@ -758,6 +763,7 @@
'TriggerResource',
'CreateRunResponse',
'ErrorResponse', 'ErrorResponseException',
'FactoryRepoUpdate',
'PipelineReference',
'TriggerPipelineReference',
'FactoryUpdateParameters',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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):
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<msrest:optionsforoperations>`.
:return: Factory or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.datafactory.models.Factory or
~msrest.pipeline.ClientRawResponse
:raises:
:class:`ErrorResponseException<azure.mgmt.datafactory.models.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.
Expand Down

0 comments on commit e28deb2

Please sign in to comment.