Skip to content

Commit 499a326

Browse files
author
SDKAuto
committed
CodeGen from PR 18690 in Azure/azure-rest-api-specs
Add new enum values to DataBindingMode (Azure#18690)
1 parent ed6e1ac commit 499a326

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

+10900
-9022
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.7.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "d1c9f13098be77ff92612d52da6303142fb563c0",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/machinelearningservices/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
10+
"readme": "specification/machinelearningservices/resource-manager/readme.md"
11+
}

sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['AzureMachineLearningWorkspaces']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
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()

sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_azure_machine_learning_workspaces.py

Lines changed: 78 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,106 +6,117 @@
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

11-
from azure.mgmt.core import ARMPipelineClient
1212
from msrest import Deserializer, Serializer
1313

14-
if TYPE_CHECKING:
15-
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
18-
from azure.core.credentials import TokenCredential
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.mgmt.core import ARMPipelineClient
1916

20-
from ._configuration import AzureMachineLearningWorkspacesConfiguration
21-
from .operations import Operations
22-
from .operations import WorkspacesOperations
23-
from .operations import WorkspaceFeaturesOperations
24-
from .operations import NotebooksOperations
25-
from .operations import UsagesOperations
26-
from .operations import VirtualMachineSizesOperations
27-
from .operations import QuotasOperations
28-
from .operations import WorkspaceConnectionsOperations
29-
from .operations import MachineLearningComputeOperations
30-
from .operations import AzureMachineLearningWorkspacesOperationsMixin
31-
from .operations import PrivateEndpointConnectionsOperations
32-
from .operations import PrivateLinkResourcesOperations
3317
from . import models
18+
from ._configuration import AzureMachineLearningWorkspacesConfiguration
19+
from .operations import ComputeOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspaceSkusOperations, WorkspacesOperations
3420

21+
if TYPE_CHECKING:
22+
# pylint: disable=unused-import,ungrouped-imports
23+
from azure.core.credentials import TokenCredential
3524

36-
class AzureMachineLearningWorkspaces(AzureMachineLearningWorkspacesOperationsMixin):
25+
class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-attributes
3726
"""These APIs allow end users to operate on Azure Machine Learning Workspace resources.
3827
3928
:ivar operations: Operations operations
4029
:vartype operations: azure.mgmt.machinelearningservices.operations.Operations
4130
:ivar workspaces: WorkspacesOperations operations
4231
:vartype workspaces: azure.mgmt.machinelearningservices.operations.WorkspacesOperations
43-
:ivar workspace_features: WorkspaceFeaturesOperations operations
44-
:vartype workspace_features: azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations
45-
:ivar notebooks: NotebooksOperations operations
46-
:vartype notebooks: azure.mgmt.machinelearningservices.operations.NotebooksOperations
4732
:ivar usages: UsagesOperations operations
4833
:vartype usages: azure.mgmt.machinelearningservices.operations.UsagesOperations
4934
:ivar virtual_machine_sizes: VirtualMachineSizesOperations operations
50-
:vartype virtual_machine_sizes: azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations
35+
:vartype virtual_machine_sizes:
36+
azure.mgmt.machinelearningservices.operations.VirtualMachineSizesOperations
5137
:ivar quotas: QuotasOperations operations
5238
:vartype quotas: azure.mgmt.machinelearningservices.operations.QuotasOperations
53-
:ivar workspace_connections: WorkspaceConnectionsOperations operations
54-
:vartype workspace_connections: azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations
55-
:ivar machine_learning_compute: MachineLearningComputeOperations operations
56-
:vartype machine_learning_compute: azure.mgmt.machinelearningservices.operations.MachineLearningComputeOperations
39+
:ivar compute: ComputeOperations operations
40+
:vartype compute: azure.mgmt.machinelearningservices.operations.ComputeOperations
5741
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
58-
:vartype private_endpoint_connections: azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations
42+
:vartype private_endpoint_connections:
43+
azure.mgmt.machinelearningservices.operations.PrivateEndpointConnectionsOperations
5944
:ivar private_link_resources: PrivateLinkResourcesOperations operations
60-
:vartype private_link_resources: azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations
45+
:vartype private_link_resources:
46+
azure.mgmt.machinelearningservices.operations.PrivateLinkResourcesOperations
47+
:ivar workspace_connections: WorkspaceConnectionsOperations operations
48+
:vartype workspace_connections:
49+
azure.mgmt.machinelearningservices.operations.WorkspaceConnectionsOperations
50+
:ivar workspace_features: WorkspaceFeaturesOperations operations
51+
:vartype workspace_features:
52+
azure.mgmt.machinelearningservices.operations.WorkspaceFeaturesOperations
53+
:ivar workspace_skus: WorkspaceSkusOperations operations
54+
:vartype workspace_skus: azure.mgmt.machinelearningservices.operations.WorkspaceSkusOperations
6155
:param credential: Credential needed for the client to connect to Azure.
6256
:type credential: ~azure.core.credentials.TokenCredential
63-
:param subscription_id: Azure subscription identifier.
57+
:param subscription_id: The ID of the target subscription.
6458
:type subscription_id: str
65-
:param str base_url: Service URL
66-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
59+
:param base_url: Service URL. Default value is "https://management.azure.com".
60+
:type base_url: str
61+
:keyword api_version: Api Version. Default value is "2021-07-01". Note that overriding this
62+
default value may result in unsupported behavior.
63+
:paramtype api_version: str
64+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
65+
Retry-After header is present.
6766
"""
6867

6968
def __init__(
7069
self,
71-
credential, # type: "TokenCredential"
72-
subscription_id, # type: str
73-
base_url=None, # type: Optional[str]
74-
**kwargs # type: Any
75-
):
76-
# type: (...) -> None
77-
if not base_url:
78-
base_url = 'https://management.azure.com'
79-
self._config = AzureMachineLearningWorkspacesConfiguration(credential, subscription_id, **kwargs)
70+
credential: "TokenCredential",
71+
subscription_id: str,
72+
base_url: str = "https://management.azure.com",
73+
**kwargs: Any
74+
) -> None:
75+
self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
8076
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8177

8278
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8379
self._serialize = Serializer(client_models)
84-
self._serialize.client_side_validation = False
8580
self._deserialize = Deserializer(client_models)
81+
self._serialize.client_side_validation = False
82+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
83+
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
84+
self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize)
85+
self.virtual_machine_sizes = VirtualMachineSizesOperations(self._client, self._config, self._serialize, self._deserialize)
86+
self.quotas = QuotasOperations(self._client, self._config, self._serialize, self._deserialize)
87+
self.compute = ComputeOperations(self._client, self._config, self._serialize, self._deserialize)
88+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
89+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
90+
self.workspace_connections = WorkspaceConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
91+
self.workspace_features = WorkspaceFeaturesOperations(self._client, self._config, self._serialize, self._deserialize)
92+
self.workspace_skus = WorkspaceSkusOperations(self._client, self._config, self._serialize, self._deserialize)
93+
94+
95+
def _send_request(
96+
self,
97+
request: HttpRequest,
98+
**kwargs: Any
99+
) -> HttpResponse:
100+
"""Runs the network request through the client's chained policies.
101+
102+
>>> from azure.core.rest import HttpRequest
103+
>>> request = HttpRequest("GET", "https://www.example.org/")
104+
<HttpRequest [GET], url: 'https://www.example.org/'>
105+
>>> response = client._send_request(request)
106+
<HttpResponse: 200 OK>
107+
108+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
109+
110+
:param request: The network request you want to make. Required.
111+
:type request: ~azure.core.rest.HttpRequest
112+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
113+
:return: The response of your network call. Does not do error handling on your response.
114+
:rtype: ~azure.core.rest.HttpResponse
115+
"""
86116

87-
self.operations = Operations(
88-
self._client, self._config, self._serialize, self._deserialize)
89-
self.workspaces = WorkspacesOperations(
90-
self._client, self._config, self._serialize, self._deserialize)
91-
self.workspace_features = WorkspaceFeaturesOperations(
92-
self._client, self._config, self._serialize, self._deserialize)
93-
self.notebooks = NotebooksOperations(
94-
self._client, self._config, self._serialize, self._deserialize)
95-
self.usages = UsagesOperations(
96-
self._client, self._config, self._serialize, self._deserialize)
97-
self.virtual_machine_sizes = VirtualMachineSizesOperations(
98-
self._client, self._config, self._serialize, self._deserialize)
99-
self.quotas = QuotasOperations(
100-
self._client, self._config, self._serialize, self._deserialize)
101-
self.workspace_connections = WorkspaceConnectionsOperations(
102-
self._client, self._config, self._serialize, self._deserialize)
103-
self.machine_learning_compute = MachineLearningComputeOperations(
104-
self._client, self._config, self._serialize, self._deserialize)
105-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
106-
self._client, self._config, self._serialize, self._deserialize)
107-
self.private_link_resources = PrivateLinkResourcesOperations(
108-
self._client, self._config, self._serialize, self._deserialize)
117+
request_copy = deepcopy(request)
118+
request_copy.url = self._client.format_url(request_copy.url)
119+
return self._client.send_request(request_copy, **kwargs)
109120

110121
def close(self):
111122
# type: () -> None

sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/_configuration.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,51 @@
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 AzureMachineLearningWorkspacesConfiguration(Configuration):
22+
class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for AzureMachineLearningWorkspaces.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
3028
:param credential: Credential needed for the client to connect to Azure.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: Azure subscription identifier.
30+
:param subscription_id: The ID of the target subscription.
3331
:type subscription_id: str
32+
:keyword api_version: Api Version. Default value is "2021-07-01". Note that overriding this
33+
default value may result in unsupported behavior.
34+
:paramtype api_version: str
3435
"""
3536

3637
def __init__(
3738
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
**kwargs: Any
42+
) -> None:
43+
super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs)
44+
api_version = kwargs.pop('api_version', "2021-07-01") # type: str
45+
4346
if credential is None:
4447
raise ValueError("Parameter 'credential' must not be None.")
4548
if subscription_id is None:
4649
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs)
4850

4951
self.credential = credential
5052
self.subscription_id = subscription_id
51-
self.api_version = "2020-08-01"
53+
self.api_version = api_version
5254
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5355
kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION))
5456
self._configure(**kwargs)
@@ -68,4 +70,4 @@ def _configure(
6870
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6971
self.authentication_policy = kwargs.get('authentication_policy')
7072
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)