Skip to content

Commit 862fcb3

Browse files
author
SDKAuto
committed
CodeGen from PR 21176 in Azure/azure-rest-api-specs
Merge 34a55e04cc3539eab6560f9b0a9bb6aa5767936c into 492cf91751be945ceae53cfdd53b1ff2fb878703
1 parent 868e7da commit 862fcb3

34 files changed

+11336
-4846
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"commit": "29970fd269e12cf8098221527c3600cb8c53eb18",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/modelerfour@4.19.2"
6+
"@autorest/python@6.1.11",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "b28a542b3eb4f2f4f384b14b635d0a835df818cd",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/azurearcdata/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",
9+
"autorest_command": "autorest specification/azurearcdata/resource-manager/readme.md --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",
1010
"readme": "specification/azurearcdata/resource-manager/readme.md"
1111
}

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

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

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

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["AzureArcDataManagementClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

sdk/azurearcdata/azure-mgmt-azurearcdata/azure/mgmt/azurearcdata/_azure_arc_data_management_client.py

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,89 +6,114 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
1011

12+
from azure.core.rest import HttpRequest, HttpResponse
1113
from azure.mgmt.core import ARMPipelineClient
12-
from msrest import Deserializer, Serializer
14+
15+
from . import models
16+
from ._configuration import AzureArcDataManagementClientConfiguration
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
ActiveDirectoryConnectorsOperations,
20+
DataControllersOperations,
21+
Operations,
22+
PostgresInstancesOperations,
23+
SqlManagedInstancesOperations,
24+
SqlServerInstancesOperations,
25+
)
1326

1427
if TYPE_CHECKING:
1528
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1829
from azure.core.credentials import TokenCredential
19-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20-
21-
from ._configuration import AzureArcDataManagementClientConfiguration
22-
from .operations import Operations
23-
from .operations import SqlManagedInstancesOperations
24-
from .operations import SqlServerInstancesOperations
25-
from .operations import DataControllersOperations
26-
from . import models
2730

2831

29-
class AzureArcDataManagementClient(object):
30-
"""The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data Services on Azure Arc Resources.
32+
class AzureArcDataManagementClient: # pylint: disable=client-accepts-api-version-keyword
33+
"""The AzureArcData management API provides a RESTful set of web APIs to manage Azure Data
34+
Services on Azure Arc Resources.
3135
3236
:ivar operations: Operations operations
33-
:vartype operations: azure_arc_data_management_client.operations.Operations
37+
:vartype operations: azure.mgmt.azurearcdata.operations.Operations
3438
:ivar sql_managed_instances: SqlManagedInstancesOperations operations
35-
:vartype sql_managed_instances: azure_arc_data_management_client.operations.SqlManagedInstancesOperations
39+
:vartype sql_managed_instances:
40+
azure.mgmt.azurearcdata.operations.SqlManagedInstancesOperations
3641
:ivar sql_server_instances: SqlServerInstancesOperations operations
37-
:vartype sql_server_instances: azure_arc_data_management_client.operations.SqlServerInstancesOperations
42+
:vartype sql_server_instances: azure.mgmt.azurearcdata.operations.SqlServerInstancesOperations
3843
:ivar data_controllers: DataControllersOperations operations
39-
:vartype data_controllers: azure_arc_data_management_client.operations.DataControllersOperations
40-
:param credential: Credential needed for the client to connect to Azure.
44+
:vartype data_controllers: azure.mgmt.azurearcdata.operations.DataControllersOperations
45+
:ivar active_directory_connectors: ActiveDirectoryConnectorsOperations operations
46+
:vartype active_directory_connectors:
47+
azure.mgmt.azurearcdata.operations.ActiveDirectoryConnectorsOperations
48+
:ivar postgres_instances: PostgresInstancesOperations operations
49+
:vartype postgres_instances: azure.mgmt.azurearcdata.operations.PostgresInstancesOperations
50+
:param credential: Credential needed for the client to connect to Azure. Required.
4151
:type credential: ~azure.core.credentials.TokenCredential
42-
:param subscription_id: The ID of the Azure subscription.
52+
:param subscription_id: The ID of the Azure subscription. Required.
4353
:type subscription_id: str
44-
:param str base_url: Service URL
45-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
54+
:param base_url: Service URL. Default value is "https://management.azure.com".
55+
:type base_url: str
56+
:keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding
57+
this default value may result in unsupported behavior.
58+
:paramtype api_version: str
59+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
60+
Retry-After header is present.
4661
"""
4762

4863
def __init__(
4964
self,
50-
credential, # type: "TokenCredential"
51-
subscription_id, # type: str
52-
base_url=None, # type: Optional[str]
53-
**kwargs # type: Any
54-
):
55-
# type: (...) -> None
56-
if not base_url:
57-
base_url = 'https://management.azure.com'
58-
self._config = AzureArcDataManagementClientConfiguration(credential, subscription_id, **kwargs)
65+
credential: "TokenCredential",
66+
subscription_id: str,
67+
base_url: str = "https://management.azure.com",
68+
**kwargs: Any
69+
) -> None:
70+
self._config = AzureArcDataManagementClientConfiguration(
71+
credential=credential, subscription_id=subscription_id, **kwargs
72+
)
5973
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6074

6175
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
6276
self._serialize = Serializer(client_models)
63-
self._serialize.client_side_validation = False
6477
self._deserialize = Deserializer(client_models)
65-
66-
self.operations = Operations(
67-
self._client, self._config, self._serialize, self._deserialize)
78+
self._serialize.client_side_validation = False
79+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
6880
self.sql_managed_instances = SqlManagedInstancesOperations(
69-
self._client, self._config, self._serialize, self._deserialize)
81+
self._client, self._config, self._serialize, self._deserialize
82+
)
7083
self.sql_server_instances = SqlServerInstancesOperations(
71-
self._client, self._config, self._serialize, self._deserialize)
84+
self._client, self._config, self._serialize, self._deserialize
85+
)
7286
self.data_controllers = DataControllersOperations(
73-
self._client, self._config, self._serialize, self._deserialize)
74-
75-
def _send_request(self, http_request, **kwargs):
76-
# type: (HttpRequest, Any) -> HttpResponse
87+
self._client, self._config, self._serialize, self._deserialize
88+
)
89+
self.active_directory_connectors = ActiveDirectoryConnectorsOperations(
90+
self._client, self._config, self._serialize, self._deserialize
91+
)
92+
self.postgres_instances = PostgresInstancesOperations(
93+
self._client, self._config, self._serialize, self._deserialize
94+
)
95+
96+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7797
"""Runs the network request through the client's chained policies.
7898
79-
:param http_request: The network request you want to make. Required.
80-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
81-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
99+
>>> from azure.core.rest import HttpRequest
100+
>>> request = HttpRequest("GET", "https://www.example.org/")
101+
<HttpRequest [GET], url: 'https://www.example.org/'>
102+
>>> response = client._send_request(request)
103+
<HttpResponse: 200 OK>
104+
105+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
106+
107+
:param request: The network request you want to make. Required.
108+
:type request: ~azure.core.rest.HttpRequest
109+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
82110
:return: The response of your network call. Does not do error handling on your response.
83-
:rtype: ~azure.core.pipeline.transport.HttpResponse
111+
:rtype: ~azure.core.rest.HttpResponse
84112
"""
85-
path_format_arguments = {
86-
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
87-
}
88-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
89-
stream = kwargs.pop("stream", True)
90-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
91-
return pipeline_response.http_response
113+
114+
request_copy = deepcopy(request)
115+
request_copy.url = self._client.format_url(request_copy.url)
116+
return self._client.send_request(request_copy, **kwargs)
92117

93118
def close(self):
94119
# type: () -> None

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

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,64 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class AzureArcDataManagementClientConfiguration(Configuration):
22+
class AzureArcDataManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for AzureArcDataManagementClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
30-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: The ID of the Azure subscription.
30+
:param subscription_id: The ID of the Azure subscription. Required.
3331
:type subscription_id: str
32+
:keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
34+
:paramtype api_version: str
3435
"""
3536

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
37+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38+
super(AzureArcDataManagementClientConfiguration, self).__init__(**kwargs)
39+
api_version = kwargs.pop("api_version", "2022-03-01-preview") # type: str
40+
4341
if credential is None:
4442
raise ValueError("Parameter 'credential' must not be None.")
4543
if subscription_id is None:
4644
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(AzureArcDataManagementClientConfiguration, self).__init__(**kwargs)
4845

4946
self.credential = credential
5047
self.subscription_id = subscription_id
51-
self.api_version = "2021-11-01"
52-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53-
kwargs.setdefault('sdk_moniker', 'mgmt-azurearcdata/{}'.format(VERSION))
48+
self.api_version = api_version
49+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
50+
kwargs.setdefault("sdk_moniker", "mgmt-azurearcdata/{}".format(VERSION))
5451
self._configure(**kwargs)
5552

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

0 commit comments

Comments
 (0)