Skip to content

Commit

Permalink
CodeGen from PR 16199 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 2f338561be19487dcfae71c4f2b664748ee31f31 into 2ebe584
  • Loading branch information
SDKAuto committed Oct 7, 2021
1 parent e8e4b4f commit 8f5276c
Show file tree
Hide file tree
Showing 29 changed files with 14,545 additions and 422 deletions.
2 changes: 1 addition & 1 deletion sdk/synapse/azure-mgmt-synapse/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "31a7b110ad291f6780f9457dde4966b2df3a18c7",
"commit": "050b1240bed5a843c1485ed95cad6269874ecbfd",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/synapse/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.4.5",
"readme": "specification/synapse/resource-manager/readme.md"
Expand Down
11 changes: 10 additions & 1 deletion sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@
"integration_runtime_monitoring_data": "IntegrationRuntimeMonitoringDataOperations",
"integration_runtime_status": "IntegrationRuntimeStatusOperations",
"spark_configuration": "SparkConfigurationOperations",
"spark_configurations": "SparkConfigurationsOperations"
"spark_configurations": "SparkConfigurationsOperations",
"kusto_operations": "KustoOperationsOperations",
"kusto_pool": "KustoPoolOperations",
"kusto_pools": "KustoPoolsOperations",
"kusto_pool_child_resource": "KustoPoolChildResourceOperations",
"kusto_pool_attached_database_configurations": "KustoPoolAttachedDatabaseConfigurationsOperations",
"kusto_pool_databases": "KustoPoolDatabasesOperations",
"kusto_pool_data_connections": "KustoPoolDataConnectionsOperations",
"kusto_pool_principal_assignments": "KustoPoolPrincipalAssignmentsOperations",
"kusto_pool_database_principal_assignments": "KustoPoolDatabasePrincipalAssignmentsOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
from .operations import IntegrationRuntimeStatusOperations
from .operations import SparkConfigurationOperations
from .operations import SparkConfigurationsOperations
from .operations import KustoOperationsOperations
from .operations import KustoPoolOperations
from .operations import KustoPoolsOperations
from .operations import KustoPoolChildResourceOperations
from .operations import KustoPoolAttachedDatabaseConfigurationsOperations
from .operations import KustoPoolDatabasesOperations
from .operations import KustoPoolDataConnectionsOperations
from .operations import KustoPoolPrincipalAssignmentsOperations
from .operations import KustoPoolDatabasePrincipalAssignmentsOperations
from . import models


Expand Down Expand Up @@ -217,6 +226,24 @@ class SynapseManagementClient(object):
:vartype spark_configuration: azure.mgmt.synapse.operations.SparkConfigurationOperations
:ivar spark_configurations: SparkConfigurationsOperations operations
:vartype spark_configurations: azure.mgmt.synapse.operations.SparkConfigurationsOperations
:ivar kusto_operations: KustoOperationsOperations operations
:vartype kusto_operations: azure.mgmt.synapse.operations.KustoOperationsOperations
:ivar kusto_pool: KustoPoolOperations operations
:vartype kusto_pool: azure.mgmt.synapse.operations.KustoPoolOperations
:ivar kusto_pools: KustoPoolsOperations operations
:vartype kusto_pools: azure.mgmt.synapse.operations.KustoPoolsOperations
:ivar kusto_pool_child_resource: KustoPoolChildResourceOperations operations
:vartype kusto_pool_child_resource: azure.mgmt.synapse.operations.KustoPoolChildResourceOperations
:ivar kusto_pool_attached_database_configurations: KustoPoolAttachedDatabaseConfigurationsOperations operations
:vartype kusto_pool_attached_database_configurations: azure.mgmt.synapse.operations.KustoPoolAttachedDatabaseConfigurationsOperations
:ivar kusto_pool_databases: KustoPoolDatabasesOperations operations
:vartype kusto_pool_databases: azure.mgmt.synapse.operations.KustoPoolDatabasesOperations
:ivar kusto_pool_data_connections: KustoPoolDataConnectionsOperations operations
:vartype kusto_pool_data_connections: azure.mgmt.synapse.operations.KustoPoolDataConnectionsOperations
:ivar kusto_pool_principal_assignments: KustoPoolPrincipalAssignmentsOperations operations
:vartype kusto_pool_principal_assignments: azure.mgmt.synapse.operations.KustoPoolPrincipalAssignmentsOperations
:ivar kusto_pool_database_principal_assignments: KustoPoolDatabasePrincipalAssignmentsOperations operations
:vartype kusto_pool_database_principal_assignments: azure.mgmt.synapse.operations.KustoPoolDatabasePrincipalAssignmentsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
Expand Down Expand Up @@ -371,6 +398,24 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.spark_configurations = SparkConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_operations = KustoOperationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool = KustoPoolOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pools = KustoPoolsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_child_resource = KustoPoolChildResourceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_attached_database_configurations = KustoPoolAttachedDatabaseConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_databases = KustoPoolDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_data_connections = KustoPoolDataConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_principal_assignments = KustoPoolPrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_database_principal_assignments = KustoPoolDatabasePrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
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.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
from .operations import IntegrationRuntimeStatusOperations
from .operations import SparkConfigurationOperations
from .operations import SparkConfigurationsOperations
from .operations import KustoOperationsOperations
from .operations import KustoPoolOperations
from .operations import KustoPoolsOperations
from .operations import KustoPoolChildResourceOperations
from .operations import KustoPoolAttachedDatabaseConfigurationsOperations
from .operations import KustoPoolDatabasesOperations
from .operations import KustoPoolDataConnectionsOperations
from .operations import KustoPoolPrincipalAssignmentsOperations
from .operations import KustoPoolDatabasePrincipalAssignmentsOperations
from .. import models


Expand Down Expand Up @@ -215,6 +224,24 @@ class SynapseManagementClient(object):
:vartype spark_configuration: azure.mgmt.synapse.aio.operations.SparkConfigurationOperations
:ivar spark_configurations: SparkConfigurationsOperations operations
:vartype spark_configurations: azure.mgmt.synapse.aio.operations.SparkConfigurationsOperations
:ivar kusto_operations: KustoOperationsOperations operations
:vartype kusto_operations: azure.mgmt.synapse.aio.operations.KustoOperationsOperations
:ivar kusto_pool: KustoPoolOperations operations
:vartype kusto_pool: azure.mgmt.synapse.aio.operations.KustoPoolOperations
:ivar kusto_pools: KustoPoolsOperations operations
:vartype kusto_pools: azure.mgmt.synapse.aio.operations.KustoPoolsOperations
:ivar kusto_pool_child_resource: KustoPoolChildResourceOperations operations
:vartype kusto_pool_child_resource: azure.mgmt.synapse.aio.operations.KustoPoolChildResourceOperations
:ivar kusto_pool_attached_database_configurations: KustoPoolAttachedDatabaseConfigurationsOperations operations
:vartype kusto_pool_attached_database_configurations: azure.mgmt.synapse.aio.operations.KustoPoolAttachedDatabaseConfigurationsOperations
:ivar kusto_pool_databases: KustoPoolDatabasesOperations operations
:vartype kusto_pool_databases: azure.mgmt.synapse.aio.operations.KustoPoolDatabasesOperations
:ivar kusto_pool_data_connections: KustoPoolDataConnectionsOperations operations
:vartype kusto_pool_data_connections: azure.mgmt.synapse.aio.operations.KustoPoolDataConnectionsOperations
:ivar kusto_pool_principal_assignments: KustoPoolPrincipalAssignmentsOperations operations
:vartype kusto_pool_principal_assignments: azure.mgmt.synapse.aio.operations.KustoPoolPrincipalAssignmentsOperations
:ivar kusto_pool_database_principal_assignments: KustoPoolDatabasePrincipalAssignmentsOperations operations
:vartype kusto_pool_database_principal_assignments: azure.mgmt.synapse.aio.operations.KustoPoolDatabasePrincipalAssignmentsOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
Expand Down Expand Up @@ -368,6 +395,24 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.spark_configurations = SparkConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_operations = KustoOperationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool = KustoPoolOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pools = KustoPoolsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_child_resource = KustoPoolChildResourceOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_attached_database_configurations = KustoPoolAttachedDatabaseConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_databases = KustoPoolDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_data_connections = KustoPoolDataConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_principal_assignments = KustoPoolPrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.kusto_pool_database_principal_assignments = KustoPoolDatabasePrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@
from ._integration_runtime_status_operations import IntegrationRuntimeStatusOperations
from ._spark_configuration_operations import SparkConfigurationOperations
from ._spark_configurations_operations import SparkConfigurationsOperations
from ._kusto_operations_operations import KustoOperationsOperations
from ._kusto_pool_operations import KustoPoolOperations
from ._kusto_pools_operations import KustoPoolsOperations
from ._kusto_pool_child_resource_operations import KustoPoolChildResourceOperations
from ._kusto_pool_attached_database_configurations_operations import KustoPoolAttachedDatabaseConfigurationsOperations
from ._kusto_pool_databases_operations import KustoPoolDatabasesOperations
from ._kusto_pool_data_connections_operations import KustoPoolDataConnectionsOperations
from ._kusto_pool_principal_assignments_operations import KustoPoolPrincipalAssignmentsOperations
from ._kusto_pool_database_principal_assignments_operations import KustoPoolDatabasePrincipalAssignmentsOperations

__all__ = [
'AzureADOnlyAuthenticationsOperations',
Expand Down Expand Up @@ -136,4 +145,13 @@
'IntegrationRuntimeStatusOperations',
'SparkConfigurationOperations',
'SparkConfigurationsOperations',
'KustoOperationsOperations',
'KustoPoolOperations',
'KustoPoolsOperations',
'KustoPoolChildResourceOperations',
'KustoPoolAttachedDatabaseConfigurationsOperations',
'KustoPoolDatabasesOperations',
'KustoPoolDataConnectionsOperations',
'KustoPoolPrincipalAssignmentsOperations',
'KustoPoolDatabasePrincipalAssignmentsOperations',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

class KustoOperationsOperations:
"""KustoOperationsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.synapse.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""

models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config

def list(
self,
**kwargs: Any
) -> AsyncIterable["_models.OperationListResult"]:
"""Lists available operations for the Kusto sub-resources inside Microsoft.Synapse provider.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.synapse.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-06-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request

async def extract_data(pipeline_response):
deserialized = self._deserialize('OperationListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)

async def get_next(next_link=None):
request = prepare_request(next_link)

pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

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

return pipeline_response

return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/providers/Microsoft.Synapse/kustooperations'} # type: ignore
Loading

0 comments on commit 8f5276c

Please sign in to comment.