Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
from .factory_vsts_configuration_py3 import FactoryVSTSConfiguration
from .factory_git_hub_configuration_py3 import FactoryGitHubConfiguration
from .factory_repo_update_py3 import FactoryRepoUpdate
from .git_hub_access_token_request_py3 import GitHubAccessTokenRequest
from .git_hub_access_token_response_py3 import GitHubAccessTokenResponse
from .pipeline_reference_py3 import PipelineReference
from .trigger_pipeline_reference_py3 import TriggerPipelineReference
from .factory_update_parameters_py3 import FactoryUpdateParameters
Expand Down Expand Up @@ -390,6 +392,8 @@
from .factory_vsts_configuration import FactoryVSTSConfiguration
from .factory_git_hub_configuration import FactoryGitHubConfiguration
from .factory_repo_update import FactoryRepoUpdate
from .git_hub_access_token_request import GitHubAccessTokenRequest
from .git_hub_access_token_response import GitHubAccessTokenResponse
from .pipeline_reference import PipelineReference
from .trigger_pipeline_reference import TriggerPipelineReference
from .factory_update_parameters import FactoryUpdateParameters
Expand Down Expand Up @@ -801,6 +805,8 @@
'FactoryVSTSConfiguration',
'FactoryGitHubConfiguration',
'FactoryRepoUpdate',
'GitHubAccessTokenRequest',
'GitHubAccessTokenResponse',
'PipelineReference',
'TriggerPipelineReference',
'FactoryUpdateParameters',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ class AzureDatabricksLinkedService(LinkedService):
:param new_cluster_node_type: The node types of new cluster. Type: string
(or Expression with resultType string).
:type new_cluster_node_type: object
:param new_cluster_spark_conf: a set of optional, user-specified Spark
:param new_cluster_spark_conf: A set of optional, user-specified Spark
configuration key-value pairs.
:type new_cluster_spark_conf: dict[str, object]
:param new_cluster_spark_env_vars: A set of optional, user-specified Spark
environment variables key-value pairs.
:type new_cluster_spark_env_vars: dict[str, object]
:param new_cluster_custom_tags: Additional tags for cluster resources.
:type new_cluster_custom_tags: dict[str, object]
:param encrypted_credential: The encrypted credential used for
Expand Down Expand Up @@ -87,6 +90,7 @@ class AzureDatabricksLinkedService(LinkedService):
'new_cluster_num_of_worker': {'key': 'typeProperties.newClusterNumOfWorker', 'type': 'object'},
'new_cluster_node_type': {'key': 'typeProperties.newClusterNodeType', 'type': 'object'},
'new_cluster_spark_conf': {'key': 'typeProperties.newClusterSparkConf', 'type': '{object}'},
'new_cluster_spark_env_vars': {'key': 'typeProperties.newClusterSparkEnvVars', 'type': '{object}'},
'new_cluster_custom_tags': {'key': 'typeProperties.newClusterCustomTags', 'type': '{object}'},
'encrypted_credential': {'key': 'typeProperties.encryptedCredential', 'type': 'object'},
}
Expand All @@ -100,6 +104,7 @@ def __init__(self, **kwargs):
self.new_cluster_num_of_worker = kwargs.get('new_cluster_num_of_worker', None)
self.new_cluster_node_type = kwargs.get('new_cluster_node_type', None)
self.new_cluster_spark_conf = kwargs.get('new_cluster_spark_conf', None)
self.new_cluster_spark_env_vars = kwargs.get('new_cluster_spark_env_vars', None)
self.new_cluster_custom_tags = kwargs.get('new_cluster_custom_tags', None)
self.encrypted_credential = kwargs.get('encrypted_credential', None)
self.type = 'AzureDatabricks'
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ class AzureDatabricksLinkedService(LinkedService):
:param new_cluster_node_type: The node types of new cluster. Type: string
(or Expression with resultType string).
:type new_cluster_node_type: object
:param new_cluster_spark_conf: a set of optional, user-specified Spark
:param new_cluster_spark_conf: A set of optional, user-specified Spark
configuration key-value pairs.
:type new_cluster_spark_conf: dict[str, object]
:param new_cluster_spark_env_vars: A set of optional, user-specified Spark
environment variables key-value pairs.
:type new_cluster_spark_env_vars: dict[str, object]
:param new_cluster_custom_tags: Additional tags for cluster resources.
:type new_cluster_custom_tags: dict[str, object]
:param encrypted_credential: The encrypted credential used for
Expand Down Expand Up @@ -87,11 +90,12 @@ class AzureDatabricksLinkedService(LinkedService):
'new_cluster_num_of_worker': {'key': 'typeProperties.newClusterNumOfWorker', 'type': 'object'},
'new_cluster_node_type': {'key': 'typeProperties.newClusterNodeType', 'type': 'object'},
'new_cluster_spark_conf': {'key': 'typeProperties.newClusterSparkConf', 'type': '{object}'},
'new_cluster_spark_env_vars': {'key': 'typeProperties.newClusterSparkEnvVars', 'type': '{object}'},
'new_cluster_custom_tags': {'key': 'typeProperties.newClusterCustomTags', 'type': '{object}'},
'encrypted_credential': {'key': 'typeProperties.encryptedCredential', 'type': 'object'},
}

def __init__(self, *, domain, access_token, additional_properties=None, connect_via=None, description: str=None, parameters=None, annotations=None, existing_cluster_id=None, new_cluster_version=None, new_cluster_num_of_worker=None, new_cluster_node_type=None, new_cluster_spark_conf=None, new_cluster_custom_tags=None, encrypted_credential=None, **kwargs) -> None:
def __init__(self, *, domain, access_token, additional_properties=None, connect_via=None, description: str=None, parameters=None, annotations=None, existing_cluster_id=None, new_cluster_version=None, new_cluster_num_of_worker=None, new_cluster_node_type=None, new_cluster_spark_conf=None, new_cluster_spark_env_vars=None, new_cluster_custom_tags=None, encrypted_credential=None, **kwargs) -> None:
super(AzureDatabricksLinkedService, self).__init__(additional_properties=additional_properties, connect_via=connect_via, description=description, parameters=parameters, annotations=annotations, **kwargs)
self.domain = domain
self.access_token = access_token
Expand All @@ -100,6 +104,7 @@ def __init__(self, *, domain, access_token, additional_properties=None, connect_
self.new_cluster_num_of_worker = new_cluster_num_of_worker
self.new_cluster_node_type = new_cluster_node_type
self.new_cluster_spark_conf = new_cluster_spark_conf
self.new_cluster_spark_env_vars = new_cluster_spark_env_vars
self.new_cluster_custom_tags = new_cluster_custom_tags
self.encrypted_credential = encrypted_credential
self.type = 'AzureDatabricks'
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 GitHubAccessTokenRequest(Model):
"""Get GitHub access token request definition.

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

:param git_hub_access_code: Required. GitHub access code.
:type git_hub_access_code: str
:param git_hub_client_id: GitHub application client ID.
:type git_hub_client_id: str
:param git_hub_access_token_base_url: Required. GitHub access token base
URL.
:type git_hub_access_token_base_url: str
"""

_validation = {
'git_hub_access_code': {'required': True},
'git_hub_access_token_base_url': {'required': True},
}

_attribute_map = {
'git_hub_access_code': {'key': 'gitHubAccessCode', 'type': 'str'},
'git_hub_client_id': {'key': 'gitHubClientId', 'type': 'str'},
'git_hub_access_token_base_url': {'key': 'gitHubAccessTokenBaseUrl', 'type': 'str'},
}

def __init__(self, **kwargs):
super(GitHubAccessTokenRequest, self).__init__(**kwargs)
self.git_hub_access_code = kwargs.get('git_hub_access_code', None)
self.git_hub_client_id = kwargs.get('git_hub_client_id', None)
self.git_hub_access_token_base_url = kwargs.get('git_hub_access_token_base_url', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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 GitHubAccessTokenRequest(Model):
"""Get GitHub access token request definition.

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

:param git_hub_access_code: Required. GitHub access code.
:type git_hub_access_code: str
:param git_hub_client_id: GitHub application client ID.
:type git_hub_client_id: str
:param git_hub_access_token_base_url: Required. GitHub access token base
URL.
:type git_hub_access_token_base_url: str
"""

_validation = {
'git_hub_access_code': {'required': True},
'git_hub_access_token_base_url': {'required': True},
}

_attribute_map = {
'git_hub_access_code': {'key': 'gitHubAccessCode', 'type': 'str'},
'git_hub_client_id': {'key': 'gitHubClientId', 'type': 'str'},
'git_hub_access_token_base_url': {'key': 'gitHubAccessTokenBaseUrl', 'type': 'str'},
}

def __init__(self, *, git_hub_access_code: str, git_hub_access_token_base_url: str, git_hub_client_id: str=None, **kwargs) -> None:
super(GitHubAccessTokenRequest, self).__init__(**kwargs)
self.git_hub_access_code = git_hub_access_code
self.git_hub_client_id = git_hub_client_id
self.git_hub_access_token_base_url = git_hub_access_token_base_url
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 GitHubAccessTokenResponse(Model):
"""Get GitHub access token response definition.

:param git_hub_access_token: GitHub access token.
:type git_hub_access_token: str
"""

_attribute_map = {
'git_hub_access_token': {'key': 'gitHubAccessToken', 'type': 'str'},
}

def __init__(self, **kwargs):
super(GitHubAccessTokenResponse, self).__init__(**kwargs)
self.git_hub_access_token = kwargs.get('git_hub_access_token', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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 GitHubAccessTokenResponse(Model):
"""Get GitHub access token response definition.

:param git_hub_access_token: GitHub access token.
:type git_hub_access_token: str
"""

_attribute_map = {
'git_hub_access_token': {'key': 'gitHubAccessToken', 'type': 'str'},
}

def __init__(self, *, git_hub_access_token: str=None, **kwargs) -> None:
super(GitHubAccessTokenResponse, self).__init__(**kwargs)
self.git_hub_access_token = git_hub_access_token
Original file line number Diff line number Diff line change
Expand Up @@ -504,3 +504,73 @@ def delete(
client_raw_response = ClientRawResponse(None, response)
return client_raw_response
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}'}

def get_git_hub_access_token(
self, resource_group_name, factory_name, git_hub_access_token_request, custom_headers=None, raw=False, **operation_config):
"""Get GitHub Access Token.

:param resource_group_name: The resource group name.
:type resource_group_name: str
:param factory_name: The factory name.
:type factory_name: str
:param git_hub_access_token_request: Get GitHub access token request
definition.
:type git_hub_access_token_request:
~azure.mgmt.datafactory.models.GitHubAccessTokenRequest
: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: GitHubAccessTokenResponse or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
url = self.get_git_hub_access_token.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'factoryName': self._serialize.url("factory_name", factory_name, 'str', max_length=63, min_length=3, pattern=r'^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$')
}
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['Accept'] = 'application/json'
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(git_hub_access_token_request, 'GitHubAccessTokenRequest')

# Construct and send request
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('GitHubAccessTokenResponse', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized
get_git_hub_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/getGitHubAccessToken'}