Skip to content
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
6 changes: 3 additions & 3 deletions sdk/kusto/azure-mgmt-kusto/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "78ec1b99699a4bf44869bd13f1b0ed7d92a99c27",
"commit": "b6b81994e26d3521459dea3e6e1bf181556509c8",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.16",
"@autorest/python@6.6.0",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/azure-kusto/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/python@6.2.16 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/azure-kusto/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/python@6.6.0 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/azure-kusto/resource-manager/readme.md"
}
13 changes: 3 additions & 10 deletions sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from ._version import VERSION

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

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -33,17 +27,16 @@ class KustoManagementClientConfiguration(Configuration): # pylint: disable=too-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-12-29". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-02". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(KustoManagementClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2022-12-29"] = kwargs.pop("api_version", "2022-12-29")
api_version: str = kwargs.pop("api_version", "2023-05-02")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ClusterPrincipalAssignmentsOperations,
ClustersOperations,
DataConnectionsOperations,
DatabaseOperations,
DatabasePrincipalAssignmentsOperations,
DatabasesOperations,
ManagedPrivateEndpointsOperations,
Expand Down Expand Up @@ -57,6 +58,8 @@ class KustoManagementClient: # pylint: disable=client-accepts-api-version-keywo
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
:vartype managed_private_endpoints:
azure.mgmt.kusto.operations.ManagedPrivateEndpointsOperations
:ivar database: DatabaseOperations operations
:vartype database: azure.mgmt.kusto.operations.DatabaseOperations
:ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations
:vartype database_principal_assignments:
azure.mgmt.kusto.operations.DatabasePrincipalAssignmentsOperations
Expand All @@ -78,12 +81,11 @@ class KustoManagementClient: # pylint: disable=client-accepts-api-version-keywo
azure.mgmt.kusto.operations.OperationsResultsLocationOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-12-29". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-02". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -100,7 +102,7 @@ def __init__(
self._config = KustoManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand All @@ -118,6 +120,7 @@ def __init__(
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.database = DatabaseOperations(self._client, self._config, self._serialize, self._deserialize)
self.database_principal_assignments = DatabasePrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -168,5 +171,5 @@ def __enter__(self) -> "KustoManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details) -> None:
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
6 changes: 3 additions & 3 deletions sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if xml_desc.get("attr", False):
if xml_ns:
ET.register_namespace(xml_prefix, xml_ns)
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
serialized.set(xml_name, new_attr) # type: ignore
continue
if xml_desc.get("text", False):
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def _extract_name_from_internal_type(internal_type):
xml_name = internal_type_xml_map.get("name", internal_type.__name__)
xml_ns = internal_type_xml_map.get("ns", None)
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)
return xml_name


Expand All @@ -1295,7 +1295,7 @@ def xml_key_extractor(attr, attr_desc, data):
# Integrate namespace if necessary
xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None))
if xml_ns:
xml_name = "{}{}".format(xml_ns, xml_name)
xml_name = "{{{}}}{}".format(xml_ns, xml_name)

# If it's an attribute, that's simple
if xml_desc.get("attr", False):
Expand Down
2 changes: 1 addition & 1 deletion sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_version.py
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 = "3.1.0"
VERSION = "2.0.0b1"
13 changes: 3 additions & 10 deletions sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -15,11 +14,6 @@

from .._version import VERSION

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

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -33,17 +27,16 @@ class KustoManagementClientConfiguration(Configuration): # pylint: disable=too-

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-12-29". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-02". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(KustoManagementClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2022-12-29"] = kwargs.pop("api_version", "2022-12-29")
api_version: str = kwargs.pop("api_version", "2023-05-02")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ClusterPrincipalAssignmentsOperations,
ClustersOperations,
DataConnectionsOperations,
DatabaseOperations,
DatabasePrincipalAssignmentsOperations,
DatabasesOperations,
ManagedPrivateEndpointsOperations,
Expand Down Expand Up @@ -57,6 +58,8 @@ class KustoManagementClient: # pylint: disable=client-accepts-api-version-keywo
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
:vartype managed_private_endpoints:
azure.mgmt.kusto.aio.operations.ManagedPrivateEndpointsOperations
:ivar database: DatabaseOperations operations
:vartype database: azure.mgmt.kusto.aio.operations.DatabaseOperations
:ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations
:vartype database_principal_assignments:
azure.mgmt.kusto.aio.operations.DatabasePrincipalAssignmentsOperations
Expand All @@ -78,12 +81,11 @@ class KustoManagementClient: # pylint: disable=client-accepts-api-version-keywo
azure.mgmt.kusto.aio.operations.OperationsResultsLocationOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-12-29". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-02". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -100,7 +102,7 @@ def __init__(
self._config = KustoManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
Expand All @@ -118,6 +120,7 @@ def __init__(
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.database = DatabaseOperations(self._client, self._config, self._serialize, self._deserialize)
self.database_principal_assignments = DatabasePrincipalAssignmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -168,5 +171,5 @@ async def __aenter__(self) -> "KustoManagementClient":
await self._client.__aenter__()
return self

async def __aexit__(self, *exc_details) -> None:
async def __aexit__(self, *exc_details: Any) -> None:
await self._client.__aexit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ._databases_operations import DatabasesOperations
from ._attached_database_configurations_operations import AttachedDatabaseConfigurationsOperations
from ._managed_private_endpoints_operations import ManagedPrivateEndpointsOperations
from ._database_operations import DatabaseOperations
from ._database_principal_assignments_operations import DatabasePrincipalAssignmentsOperations
from ._scripts_operations import ScriptsOperations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
Expand All @@ -32,6 +33,7 @@
"DatabasesOperations",
"AttachedDatabaseConfigurationsOperations",
"ManagedPrivateEndpointsOperations",
"DatabaseOperations",
"DatabasePrincipalAssignmentsOperations",
"ScriptsOperations",
"PrivateEndpointConnectionsOperations",
Expand Down
Loading