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 track2_azure-mgmt-synapse] EnableInteractivequery Changes #2369

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions sdk/synapse/azure-mgmt-synapse/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "7a54c1a83d14da431c0ae48c4315cba143084bce",
"commit": "346a33f4e7b0c7150c3e48e7686a34c9249b9cff",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/synapse/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/synapse/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/synapse/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
DataMaskingPoliciesOperations,
DataMaskingRulesOperations,
ExtendedSqlPoolBlobAuditingPoliciesOperations,
GetOperations,
IntegrationRuntimeAuthKeysOperations,
IntegrationRuntimeConnectionInfosOperations,
IntegrationRuntimeCredentialsOperations,
Expand Down Expand Up @@ -286,6 +287,8 @@ class SynapseManagementClient: # pylint: disable=client-accepts-api-version-key
:ivar integration_runtime_status: IntegrationRuntimeStatusOperations operations
:vartype integration_runtime_status:
azure.mgmt.synapse.operations.IntegrationRuntimeStatusOperations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.synapse.operations.GetOperations
:ivar spark_configuration: SparkConfigurationOperations operations
:vartype spark_configuration: azure.mgmt.synapse.operations.SparkConfigurationOperations
:ivar spark_configurations: SparkConfigurationsOperations operations
Expand Down Expand Up @@ -521,6 +524,7 @@ def __init__(
self.integration_runtime_status = IntegrationRuntimeStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
self.spark_configuration = SparkConfigurationOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.1.0b6"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
DataMaskingPoliciesOperations,
DataMaskingRulesOperations,
ExtendedSqlPoolBlobAuditingPoliciesOperations,
GetOperations,
IntegrationRuntimeAuthKeysOperations,
IntegrationRuntimeConnectionInfosOperations,
IntegrationRuntimeCredentialsOperations,
Expand Down Expand Up @@ -290,6 +291,8 @@ class SynapseManagementClient: # pylint: disable=client-accepts-api-version-key
:ivar integration_runtime_status: IntegrationRuntimeStatusOperations operations
:vartype integration_runtime_status:
azure.mgmt.synapse.aio.operations.IntegrationRuntimeStatusOperations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.synapse.aio.operations.GetOperations
:ivar spark_configuration: SparkConfigurationOperations operations
:vartype spark_configuration: azure.mgmt.synapse.aio.operations.SparkConfigurationOperations
:ivar spark_configurations: SparkConfigurationsOperations operations
Expand Down Expand Up @@ -525,6 +528,7 @@ def __init__(
self.integration_runtime_status = IntegrationRuntimeStatusOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
self.spark_configuration = SparkConfigurationOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
from ._integration_runtime_auth_keys_operations import IntegrationRuntimeAuthKeysOperations
from ._integration_runtime_monitoring_data_operations import IntegrationRuntimeMonitoringDataOperations
from ._integration_runtime_status_operations import IntegrationRuntimeStatusOperations
from ._get_operations import GetOperations
from ._spark_configuration_operations import SparkConfigurationOperations
from ._spark_configurations_operations import SparkConfigurationsOperations
from ._kusto_operations_operations import KustoOperationsOperations
Expand Down Expand Up @@ -169,6 +170,7 @@
"IntegrationRuntimeAuthKeysOperations",
"IntegrationRuntimeMonitoringDataOperations",
"IntegrationRuntimeStatusOperations",
"GetOperations",
"SparkConfigurationOperations",
"SparkConfigurationsOperations",
"KustoOperationsOperations",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
# pylint: disable=too-many-lines
# 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.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar

from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._get_operations import (
build_integration_runtime_enable_interactivequery_request,
build_integration_runtime_start_request,
build_integration_runtime_stop_request,
)

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class GetOperations:
"""
.. warning::
**DO NOT** instantiate this class directly.

Instead, you should access the following operations through
:class:`~azure.mgmt.synapse.aio.SynapseManagementClient`'s
:attr:`get` attribute.
"""

models = _models

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def integration_runtime_start(
self,
resource_group_name: str,
workspace_name: str,
integration_runtime_name: str,
integration_runtime_operation_id: str,
**kwargs: Any
) -> _models.IntegrationRuntimeOperationStatus:
"""Get integration runtime start operation status.

Get an integration runtime start operation status.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param integration_runtime_name: Integration runtime name. Required.
:type integration_runtime_name: str
:param integration_runtime_operation_id: Integration runtime Operation Id. Required.
:type integration_runtime_operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IntegrationRuntimeOperationStatus or the result of cls(response)
:rtype: ~azure.mgmt.synapse.models.IntegrationRuntimeOperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
cls: ClsType[_models.IntegrationRuntimeOperationStatus] = kwargs.pop("cls", None)

request = build_integration_runtime_start_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
integration_runtime_name=integration_runtime_name,
integration_runtime_operation_id=integration_runtime_operation_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.integration_runtime_start.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=False, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize("IntegrationRuntimeOperationStatus", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

integration_runtime_start.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start/operationstatuses/{integrationRuntimeOperationId}"
}

@distributed_trace_async
async def integration_runtime_stop(
self,
resource_group_name: str,
workspace_name: str,
integration_runtime_name: str,
integration_runtime_operation_id: str,
**kwargs: Any
) -> _models.IntegrationRuntimeStopOperationStatus:
"""Get integration runtime stop operation status.

Get an integration runtime stop operation status.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param integration_runtime_name: Integration runtime name. Required.
:type integration_runtime_name: str
:param integration_runtime_operation_id: Integration runtime Operation Id. Required.
:type integration_runtime_operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IntegrationRuntimeStopOperationStatus or the result of cls(response)
:rtype: ~azure.mgmt.synapse.models.IntegrationRuntimeStopOperationStatus
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
cls: ClsType[_models.IntegrationRuntimeStopOperationStatus] = kwargs.pop("cls", None)

request = build_integration_runtime_stop_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
integration_runtime_name=integration_runtime_name,
integration_runtime_operation_id=integration_runtime_operation_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.integration_runtime_stop.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=False, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize("IntegrationRuntimeStopOperationStatus", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

integration_runtime_stop.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop/operationstatuses/{integrationRuntimeOperationId}"
}

@distributed_trace_async
async def integration_runtime_enable_interactivequery(
self,
resource_group_name: str,
workspace_name: str,
integration_runtime_name: str,
integration_runtime_operation_id: str,
**kwargs: Any
) -> _models.IntegrationRuntimeEnableinteractivequery:
"""Get integration runtime enable interactivequery operation status.

Get an integration runtime enable interactivequery operation status.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param integration_runtime_name: Integration runtime name. Required.
:type integration_runtime_name: str
:param integration_runtime_operation_id: Integration runtime Operation Id. Required.
:type integration_runtime_operation_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: IntegrationRuntimeEnableinteractivequery or the result of cls(response)
:rtype: ~azure.mgmt.synapse.models.IntegrationRuntimeEnableinteractivequery
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: Literal["2021-06-01-preview"] = kwargs.pop(
"api_version", _params.pop("api-version", "2021-06-01-preview")
)
cls: ClsType[_models.IntegrationRuntimeEnableinteractivequery] = kwargs.pop("cls", None)

request = build_integration_runtime_enable_interactivequery_request(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
integration_runtime_name=integration_runtime_name,
integration_runtime_operation_id=integration_runtime_operation_id,
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.integration_runtime_enable_interactivequery.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=False, **kwargs
)

response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize("IntegrationRuntimeEnableinteractivequery", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

integration_runtime_enable_interactivequery.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableinteractivequery/operationstatuses/{integrationRuntimeOperationId}"
}
Loading