diff --git a/sdk/synapse/azure-mgmt-synapse/_meta.json b/sdk/synapse/azure-mgmt-synapse/_meta.json index 7514e021aad9..d016da674e9b 100644 --- a/sdk/synapse/azure-mgmt-synapse/_meta.json +++ b/sdk/synapse/azure-mgmt-synapse/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "f8aa8bcbac3d389a1ed5b9c77f1bcb6cc2074a7d", + "commit": "aa1574bd8425fb67aa61c97f7b35f5f76ae86791", "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/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/synapse/resource-manager/readme.md" diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json index ad699fc1ace1..6e44ec221b94 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json @@ -163,7 +163,6 @@ "spark_configuration": "SparkConfigurationOperations", "spark_configurations": "SparkConfigurationsOperations", "kusto_operations": "KustoOperationsOperations", - "kusto_pool": "KustoPoolOperations", "kusto_pools": "KustoPoolsOperations", "kusto_pool_child_resource": "KustoPoolChildResourceOperations", "kusto_pool_attached_database_configurations": "KustoPoolAttachedDatabaseConfigurationsOperations", diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py index efe1591e66ae..caf430b509b7 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py @@ -84,7 +84,6 @@ 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 @@ -228,8 +227,6 @@ class SynapseManagementClient(object): :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 @@ -400,8 +397,6 @@ def __init__( 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( diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py index b2fff948b5bb..e5754a47ce68 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py index 30cf57d4f486..6bf1df182f5a 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py @@ -82,7 +82,6 @@ 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 @@ -226,8 +225,6 @@ class SynapseManagementClient(object): :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 @@ -397,8 +394,6 @@ def __init__( 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( diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py index 44b8ebef2ef3..4e5e7b165434 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py @@ -71,7 +71,6 @@ 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 @@ -146,7 +145,6 @@ 'SparkConfigurationOperations', 'SparkConfigurationsOperations', 'KustoOperationsOperations', - 'KustoPoolOperations', 'KustoPoolsOperations', 'KustoPoolChildResourceOperations', 'KustoPoolAttachedDatabaseConfigurationsOperations', diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pool_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pool_operations.py deleted file mode 100644 index 6c266289bf1a..000000000000 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pool_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# 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 KustoPoolOperations: - """KustoPoolOperations 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_skus( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SkuDescriptionList"]: - """Lists eligible SKUs for Kusto Pool resource. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.synapse.models.SkuDescriptionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] - 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_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # 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('SkuDescriptionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return 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_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/skus'} # type: ignore diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pools_operations.py index cf1f5245cb23..0db7264d7864 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pools_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_kusto_pools_operations.py @@ -43,6 +43,73 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + def list_skus( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SkuDescriptionList"]: + """Lists eligible SKUs for Kusto Pool resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.synapse.models.SkuDescriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] + 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_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # 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('SkuDescriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return 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_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/skus'} # type: ignore + async def check_name_availability( self, location: str, diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py index 4d2ba3db1eb2..30403b5065b1 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py @@ -2257,6 +2257,9 @@ class EventHubDataConnection(DataConnection): :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving", "Canceled". :vartype provisioning_state: str or ~azure.mgmt.synapse.models.ResourceProvisioningState + :param managed_identity_resource_id: The resource ID of a managed identity (system or user + assigned) to be used to authenticate with event hub. + :type managed_identity_resource_id: str """ _validation = { @@ -2283,6 +2286,7 @@ class EventHubDataConnection(DataConnection): 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, 'compression': {'key': 'properties.compression', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_identity_resource_id': {'key': 'properties.managedIdentityResourceId', 'type': 'str'}, } def __init__( @@ -2299,6 +2303,7 @@ def __init__( self.event_system_properties = kwargs.get('event_system_properties', None) self.compression = kwargs.get('compression', None) self.provisioning_state = None + self.managed_identity_resource_id = kwargs.get('managed_identity_resource_id', None) class ExtendedServerBlobAuditingPolicy(ProxyResource): diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py index 881fe9469108..d5ff5c616784 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py @@ -2445,6 +2445,9 @@ class EventHubDataConnection(DataConnection): :ivar provisioning_state: The provisioned state of the resource. Possible values include: "Running", "Creating", "Deleting", "Succeeded", "Failed", "Moving", "Canceled". :vartype provisioning_state: str or ~azure.mgmt.synapse.models.ResourceProvisioningState + :param managed_identity_resource_id: The resource ID of a managed identity (system or user + assigned) to be used to authenticate with event hub. + :type managed_identity_resource_id: str """ _validation = { @@ -2471,6 +2474,7 @@ class EventHubDataConnection(DataConnection): 'event_system_properties': {'key': 'properties.eventSystemProperties', 'type': '[str]'}, 'compression': {'key': 'properties.compression', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_identity_resource_id': {'key': 'properties.managedIdentityResourceId', 'type': 'str'}, } def __init__( @@ -2484,6 +2488,7 @@ def __init__( data_format: Optional[Union[str, "EventHubDataFormat"]] = None, event_system_properties: Optional[List[str]] = None, compression: Optional[Union[str, "Compression"]] = None, + managed_identity_resource_id: Optional[str] = None, **kwargs ): super(EventHubDataConnection, self).__init__(location=location, **kwargs) @@ -2496,6 +2501,7 @@ def __init__( self.event_system_properties = event_system_properties self.compression = compression self.provisioning_state = None + self.managed_identity_resource_id = managed_identity_resource_id class ExtendedServerBlobAuditingPolicy(ProxyResource): diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py index 44b8ebef2ef3..4e5e7b165434 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py @@ -71,7 +71,6 @@ 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 @@ -146,7 +145,6 @@ 'SparkConfigurationOperations', 'SparkConfigurationsOperations', 'KustoOperationsOperations', - 'KustoPoolOperations', 'KustoPoolsOperations', 'KustoPoolChildResourceOperations', 'KustoPoolAttachedDatabaseConfigurationsOperations', diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pool_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pool_operations.py deleted file mode 100644 index 35f482d635ee..000000000000 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pool_operations.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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 TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class KustoPoolOperations(object): - """KustoPoolOperations 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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_skus( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SkuDescriptionList"] - """Lists eligible SKUs for Kusto Pool resource. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.synapse.models.SkuDescriptionList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] - 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_skus.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # 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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('SkuDescriptionList', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = 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 ItemPaged( - get_next, extract_data - ) - list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/skus'} # type: ignore diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pools_operations.py index 4b9075942848..d71307be4175 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pools_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_kusto_pools_operations.py @@ -47,6 +47,74 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + def list_skus( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SkuDescriptionList"] + """Lists eligible SKUs for Kusto Pool resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SkuDescriptionList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.synapse.models.SkuDescriptionList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SkuDescriptionList"] + 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_skus.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + url = self._client.format_url(url, **path_format_arguments) + # 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 + + def extract_data(pipeline_response): + deserialized = self._deserialize('SkuDescriptionList', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = 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 ItemPaged( + get_next, extract_data + ) + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/skus'} # type: ignore + def check_name_availability( self, location, # type: str