Skip to content

Commit 4b2859b

Browse files
author
SDKAuto
committed
CodeGen from PR 20693 in Azure/azure-rest-api-specs
Merge 1b1b28a861912fb07eb40eca71cca2caf9a1b5ce into af1be2677e619e483210064ff658e62ec25053aa
1 parent c87bab1 commit 4b2859b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+17158
-8959
lines changed

sdk/kusto/azure-mgmt-kusto/_meta.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.8.4",
33
"use": [
4-
"@autorest/python@5.12.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.1.5",
5+
"@autorest/modelerfour@4.23.5"
66
],
7-
"commit": "efd3d669a86d2e123f57ac3a43e5af4bb9e3a29f",
7+
"commit": "867105d6b1875771f9edb82bd9df92480dbbcff4",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
9+
"autorest_command": "autorest specification/azure-kusto/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
1010
"readme": "specification/azure-kusto/resource-manager/readme.md"
1111
}

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['KustoManagementClient']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["KustoManagementClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_configuration.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,50 +19,52 @@
1919
from azure.core.credentials import TokenCredential
2020

2121

22-
class KustoManagementClientConfiguration(Configuration):
22+
class KustoManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2323
"""Configuration for KustoManagementClient.
2424
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
30+
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
31+
subscription. The subscription ID forms part of the URI for every service call. Required.
3132
:type subscription_id: str
33+
:keyword api_version: Api Version. Default value is "2022-07-07". Note that overriding this
34+
default value may result in unsupported behavior.
35+
:paramtype api_version: str
3236
"""
3337

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
) -> None:
38+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4039
super(KustoManagementClientConfiguration, self).__init__(**kwargs)
40+
api_version = kwargs.pop("api_version", "2022-07-07") # type: str
41+
4142
if credential is None:
4243
raise ValueError("Parameter 'credential' must not be None.")
4344
if subscription_id is None:
4445
raise ValueError("Parameter 'subscription_id' must not be None.")
4546

4647
self.credential = credential
4748
self.subscription_id = subscription_id
48-
self.api_version = "2022-02-01"
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'mgmt-kusto/{}'.format(VERSION))
49+
self.api_version = api_version
50+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
51+
kwargs.setdefault("sdk_moniker", "mgmt-kusto/{}".format(VERSION))
5152
self._configure(**kwargs)
5253

5354
def _configure(
54-
self,
55-
**kwargs # type: Any
55+
self, **kwargs # type: Any
5656
):
5757
# type: (...) -> None
58-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
59-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
60-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
61-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
62-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
63-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
64-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
65-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
66-
self.authentication_policy = kwargs.get('authentication_policy')
58+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
59+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
60+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
61+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
62+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
63+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
64+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
65+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
66+
self.authentication_policy = kwargs.get("authentication_policy")
6767
if self.credential and not self.authentication_policy:
68-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
69+
self.credential, *self.credential_scopes, **kwargs
70+
)

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_kusto_management_client.py

Lines changed: 74 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,82 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Optional, TYPE_CHECKING
10+
from typing import Any, TYPE_CHECKING
1111

1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
14-
from msrest import Deserializer, Serializer
1514

1615
from . import models
1716
from ._configuration import KustoManagementClientConfiguration
18-
from .operations import AttachedDatabaseConfigurationsOperations, ClusterPrincipalAssignmentsOperations, ClustersOperations, DataConnectionsOperations, DatabasePrincipalAssignmentsOperations, DatabasesOperations, ManagedPrivateEndpointsOperations, Operations, OperationsResultsLocationOperations, OperationsResultsOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ScriptsOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
AttachedDatabaseConfigurationsOperations,
20+
ClusterPrincipalAssignmentsOperations,
21+
ClustersOperations,
22+
DataConnectionsOperations,
23+
DatabasePrincipalAssignmentsOperations,
24+
DatabasesOperations,
25+
ManagedPrivateEndpointsOperations,
26+
Operations,
27+
OperationsResultsLocationOperations,
28+
OperationsResultsOperations,
29+
PrivateEndpointConnectionsOperations,
30+
PrivateLinkResourcesOperations,
31+
ScriptsOperations,
32+
)
1933

2034
if TYPE_CHECKING:
2135
# pylint: disable=unused-import,ungrouped-imports
2236
from azure.core.credentials import TokenCredential
2337

24-
class KustoManagementClient:
25-
"""The Azure Kusto management API provides a RESTful set of web services that interact with Azure Kusto services to manage your clusters and databases. The API enables you to create, update, and delete clusters and databases.
38+
39+
class KustoManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
40+
"""The Azure Kusto management API provides a RESTful set of web services that interact with Azure
41+
Kusto services to manage your clusters and databases. The API enables you to create, update,
42+
and delete clusters and databases.
2643
2744
:ivar clusters: ClustersOperations operations
28-
:vartype clusters: kusto_management_client.operations.ClustersOperations
45+
:vartype clusters: azure.mgmt.kusto.operations.ClustersOperations
2946
:ivar cluster_principal_assignments: ClusterPrincipalAssignmentsOperations operations
3047
:vartype cluster_principal_assignments:
31-
kusto_management_client.operations.ClusterPrincipalAssignmentsOperations
48+
azure.mgmt.kusto.operations.ClusterPrincipalAssignmentsOperations
3249
:ivar databases: DatabasesOperations operations
33-
:vartype databases: kusto_management_client.operations.DatabasesOperations
50+
:vartype databases: azure.mgmt.kusto.operations.DatabasesOperations
3451
:ivar attached_database_configurations: AttachedDatabaseConfigurationsOperations operations
3552
:vartype attached_database_configurations:
36-
kusto_management_client.operations.AttachedDatabaseConfigurationsOperations
53+
azure.mgmt.kusto.operations.AttachedDatabaseConfigurationsOperations
3754
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
3855
:vartype managed_private_endpoints:
39-
kusto_management_client.operations.ManagedPrivateEndpointsOperations
56+
azure.mgmt.kusto.operations.ManagedPrivateEndpointsOperations
4057
:ivar database_principal_assignments: DatabasePrincipalAssignmentsOperations operations
4158
:vartype database_principal_assignments:
42-
kusto_management_client.operations.DatabasePrincipalAssignmentsOperations
59+
azure.mgmt.kusto.operations.DatabasePrincipalAssignmentsOperations
4360
:ivar scripts: ScriptsOperations operations
44-
:vartype scripts: kusto_management_client.operations.ScriptsOperations
61+
:vartype scripts: azure.mgmt.kusto.operations.ScriptsOperations
4562
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
4663
:vartype private_endpoint_connections:
47-
kusto_management_client.operations.PrivateEndpointConnectionsOperations
64+
azure.mgmt.kusto.operations.PrivateEndpointConnectionsOperations
4865
:ivar private_link_resources: PrivateLinkResourcesOperations operations
49-
:vartype private_link_resources:
50-
kusto_management_client.operations.PrivateLinkResourcesOperations
66+
:vartype private_link_resources: azure.mgmt.kusto.operations.PrivateLinkResourcesOperations
5167
:ivar data_connections: DataConnectionsOperations operations
52-
:vartype data_connections: kusto_management_client.operations.DataConnectionsOperations
68+
:vartype data_connections: azure.mgmt.kusto.operations.DataConnectionsOperations
5369
:ivar operations: Operations operations
54-
:vartype operations: kusto_management_client.operations.Operations
70+
:vartype operations: azure.mgmt.kusto.operations.Operations
5571
:ivar operations_results: OperationsResultsOperations operations
56-
:vartype operations_results: kusto_management_client.operations.OperationsResultsOperations
72+
:vartype operations_results: azure.mgmt.kusto.operations.OperationsResultsOperations
5773
:ivar operations_results_location: OperationsResultsLocationOperations operations
5874
:vartype operations_results_location:
59-
kusto_management_client.operations.OperationsResultsLocationOperations
60-
:param credential: Credential needed for the client to connect to Azure.
75+
azure.mgmt.kusto.operations.OperationsResultsLocationOperations
76+
:param credential: Credential needed for the client to connect to Azure. Required.
6177
:type credential: ~azure.core.credentials.TokenCredential
6278
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
63-
subscription. The subscription ID forms part of the URI for every service call.
79+
subscription. The subscription ID forms part of the URI for every service call. Required.
6480
:type subscription_id: str
65-
:param base_url: Service URL. Default value is 'https://management.azure.com'.
81+
:param base_url: Service URL. Default value is "https://management.azure.com".
6682
:type base_url: str
83+
:keyword api_version: Api Version. Default value is "2022-07-07". Note that overriding this
84+
default value may result in unsupported behavior.
85+
:paramtype api_version: str
6786
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6887
Retry-After header is present.
6988
"""
@@ -75,33 +94,48 @@ def __init__(
7594
base_url: str = "https://management.azure.com",
7695
**kwargs: Any
7796
) -> None:
78-
self._config = KustoManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
97+
self._config = KustoManagementClientConfiguration(
98+
credential=credential, subscription_id=subscription_id, **kwargs
99+
)
79100
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
80101

81102
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
82103
self._serialize = Serializer(client_models)
83104
self._deserialize = Deserializer(client_models)
84105
self._serialize.client_side_validation = False
85106
self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize)
86-
self.cluster_principal_assignments = ClusterPrincipalAssignmentsOperations(self._client, self._config, self._serialize, self._deserialize)
107+
self.cluster_principal_assignments = ClusterPrincipalAssignmentsOperations(
108+
self._client, self._config, self._serialize, self._deserialize
109+
)
87110
self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize)
88-
self.attached_database_configurations = AttachedDatabaseConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
89-
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
90-
self.database_principal_assignments = DatabasePrincipalAssignmentsOperations(self._client, self._config, self._serialize, self._deserialize)
111+
self.attached_database_configurations = AttachedDatabaseConfigurationsOperations(
112+
self._client, self._config, self._serialize, self._deserialize
113+
)
114+
self.managed_private_endpoints = ManagedPrivateEndpointsOperations(
115+
self._client, self._config, self._serialize, self._deserialize
116+
)
117+
self.database_principal_assignments = DatabasePrincipalAssignmentsOperations(
118+
self._client, self._config, self._serialize, self._deserialize
119+
)
91120
self.scripts = ScriptsOperations(self._client, self._config, self._serialize, self._deserialize)
92-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
93-
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
94-
self.data_connections = DataConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
121+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
122+
self._client, self._config, self._serialize, self._deserialize
123+
)
124+
self.private_link_resources = PrivateLinkResourcesOperations(
125+
self._client, self._config, self._serialize, self._deserialize
126+
)
127+
self.data_connections = DataConnectionsOperations(
128+
self._client, self._config, self._serialize, self._deserialize
129+
)
95130
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
96-
self.operations_results = OperationsResultsOperations(self._client, self._config, self._serialize, self._deserialize)
97-
self.operations_results_location = OperationsResultsLocationOperations(self._client, self._config, self._serialize, self._deserialize)
98-
99-
100-
def _send_request(
101-
self,
102-
request, # type: HttpRequest
103-
**kwargs: Any
104-
) -> HttpResponse:
131+
self.operations_results = OperationsResultsOperations(
132+
self._client, self._config, self._serialize, self._deserialize
133+
)
134+
self.operations_results_location = OperationsResultsLocationOperations(
135+
self._client, self._config, self._serialize, self._deserialize
136+
)
137+
138+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
105139
"""Runs the network request through the client's chained policies.
106140
107141
>>> from azure.core.rest import HttpRequest
@@ -110,7 +144,7 @@ def _send_request(
110144
>>> response = client._send_request(request)
111145
<HttpResponse: 200 OK>
112146
113-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
147+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
114148
115149
:param request: The network request you want to make. Required.
116150
:type request: ~azure.core.rest.HttpRequest

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)