Skip to content

Commit 09f5681

Browse files
author
SDKAuto
committed
CodeGen from PR 30823 in Azure/azure-rest-api-specs
Merge 9b1e6015182a01529d7f7ff2d3dccff65e197c4d into 012021c786c360e0c34faf7af888c7fd7dbe2df5
1 parent 41eff18 commit 09f5681

File tree

80 files changed

+8871
-1031
lines changed

Some content is hidden

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

80 files changed

+8871
-1031
lines changed

sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Hybridconnectivity Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-hybridconnectivity%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "95c0363e4cae8756c6a33b58add67776db427bbc",
2+
"commit": "9abd4911b40c960dde0a90e23574f6e6d047a631",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.19.0",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/hybridconnectivity/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.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/hybridconnectivity/resource-manager/readme.md --generate-sample=True --generate-test=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.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/hybridconnectivity/resource-manager/readme.md"
1111
}

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,30 +18,35 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class HybridConnectivityMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for HybridConnectivityMgmtClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
2625
attributes.
2726
2827
:param credential: Credential needed for the client to connect to Azure. Required.
2928
:type credential: ~azure.core.credentials.TokenCredential
30-
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30+
:type subscription_id: str
31+
:keyword api_version: Api Version. Default value is "2024-12-01". Note that overriding this
3132
default value may result in unsupported behavior.
3233
:paramtype api_version: str
3334
"""
3435

35-
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
36-
super(HybridConnectivityMgmtClientConfiguration, self).__init__(**kwargs)
37-
api_version: str = kwargs.pop("api_version", "2023-03-15")
36+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
api_version: str = kwargs.pop("api_version", "2024-12-01")
3838

3939
if credential is None:
4040
raise ValueError("Parameter 'credential' must not be None.")
41+
if subscription_id is None:
42+
raise ValueError("Parameter 'subscription_id' must not be None.")
4143

4244
self.credential = credential
45+
self.subscription_id = subscription_id
4346
self.api_version = api_version
4447
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4548
kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
4650
self._configure(**kwargs)
4751

4852
def _configure(self, **kwargs: Any) -> None:
@@ -51,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5155
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5256
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5357
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5558
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
5659
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5761
self.authentication_policy = kwargs.get("authentication_policy")
5862
if self.credential and not self.authentication_policy:
5963
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_hybrid_connectivity_mgmt_client.py

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,48 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

1518
from . import models as _models
1619
from ._configuration import HybridConnectivityMgmtClientConfiguration
1720
from ._serialization import Deserializer, Serializer
18-
from .operations import EndpointsOperations, Operations, ServiceConfigurationsOperations
21+
from .operations import (
22+
EndpointsOperations,
23+
GenerateAwsTemplateOperations,
24+
InventoryOperations,
25+
Operations,
26+
PublicCloudConnectorsOperations,
27+
ServiceConfigurationsOperations,
28+
SolutionConfigurationsOperations,
29+
SolutionTypesOperations,
30+
)
1931

2032
if TYPE_CHECKING:
2133
# pylint: disable=unused-import,ungrouped-imports
2234
from azure.core.credentials import TokenCredential
2335

2436

25-
class HybridConnectivityMgmtClient: # pylint: disable=client-accepts-api-version-keyword
26-
"""REST API for Hybrid Connectivity.
27-
37+
class HybridConnectivityMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
38+
"""REST API for public clouds.
39+
40+
:ivar solution_configurations: SolutionConfigurationsOperations operations
41+
:vartype solution_configurations:
42+
azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations
43+
:ivar inventory: InventoryOperations operations
44+
:vartype inventory: azure.mgmt.hybridconnectivity.operations.InventoryOperations
45+
:ivar generate_aws_template: GenerateAwsTemplateOperations operations
46+
:vartype generate_aws_template:
47+
azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations
48+
:ivar public_cloud_connectors: PublicCloudConnectorsOperations operations
49+
:vartype public_cloud_connectors:
50+
azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations
51+
:ivar solution_types: SolutionTypesOperations operations
52+
:vartype solution_types: azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations
2853
:ivar operations: Operations operations
2954
:vartype operations: azure.mgmt.hybridconnectivity.operations.Operations
3055
:ivar endpoints: EndpointsOperations operations
@@ -34,30 +59,69 @@ class HybridConnectivityMgmtClient: # pylint: disable=client-accepts-api-versio
3459
azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations
3560
:param credential: Credential needed for the client to connect to Azure. Required.
3661
:type credential: ~azure.core.credentials.TokenCredential
62+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
63+
:type subscription_id: str
3764
:param base_url: Service URL. Default value is "https://management.azure.com".
3865
:type base_url: str
39-
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
66+
:keyword api_version: Api Version. Default value is "2024-12-01". Note that overriding this
4067
default value may result in unsupported behavior.
4168
:paramtype api_version: str
69+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
70+
Retry-After header is present.
4271
"""
4372

4473
def __init__(
45-
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
74+
self,
75+
credential: "TokenCredential",
76+
subscription_id: str,
77+
base_url: str = "https://management.azure.com",
78+
**kwargs: Any
4679
) -> None:
47-
self._config = HybridConnectivityMgmtClientConfiguration(credential=credential, **kwargs)
48-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
80+
self._config = HybridConnectivityMgmtClientConfiguration(
81+
credential=credential, subscription_id=subscription_id, **kwargs
82+
)
83+
_policies = kwargs.pop("policies", None)
84+
if _policies is None:
85+
_policies = [
86+
policies.RequestIdPolicy(**kwargs),
87+
self._config.headers_policy,
88+
self._config.user_agent_policy,
89+
self._config.proxy_policy,
90+
policies.ContentDecodePolicy(**kwargs),
91+
ARMAutoResourceProviderRegistrationPolicy(),
92+
self._config.redirect_policy,
93+
self._config.retry_policy,
94+
self._config.authentication_policy,
95+
self._config.custom_hook_policy,
96+
self._config.logging_policy,
97+
policies.DistributedTracingPolicy(**kwargs),
98+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
99+
self._config.http_logging_policy,
100+
]
101+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
49102

50103
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
51104
self._serialize = Serializer(client_models)
52105
self._deserialize = Deserializer(client_models)
53106
self._serialize.client_side_validation = False
107+
self.solution_configurations = SolutionConfigurationsOperations(
108+
self._client, self._config, self._serialize, self._deserialize
109+
)
110+
self.inventory = InventoryOperations(self._client, self._config, self._serialize, self._deserialize)
111+
self.generate_aws_template = GenerateAwsTemplateOperations(
112+
self._client, self._config, self._serialize, self._deserialize
113+
)
114+
self.public_cloud_connectors = PublicCloudConnectorsOperations(
115+
self._client, self._config, self._serialize, self._deserialize
116+
)
117+
self.solution_types = SolutionTypesOperations(self._client, self._config, self._serialize, self._deserialize)
54118
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
55119
self.endpoints = EndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
56120
self.service_configurations = ServiceConfigurationsOperations(
57121
self._client, self._config, self._serialize, self._deserialize
58122
)
59123

60-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
124+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
61125
"""Runs the network request through the client's chained policies.
62126
63127
>>> from azure.core.rest import HttpRequest
@@ -77,12 +141,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
77141

78142
request_copy = deepcopy(request)
79143
request_copy.url = self._client.format_url(request_copy.url)
80-
return self._client.send_request(request_copy, **kwargs)
144+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
81145

82146
def close(self) -> None:
83147
self._client.close()
84148

85-
def __enter__(self) -> "HybridConnectivityMgmtClient":
149+
def __enter__(self) -> Self:
86150
self._client.__enter__()
87151
return self
88152

0 commit comments

Comments
 (0)