Skip to content

Commit b647910

Browse files
author
SDKAuto
committed
CodeGen from PR 32115 in Azure/azure-rest-api-specs
Merge 2c8a905557bf17618fbbaaeea630ab46f78cf997 into f8a6ecd39798b8e1e7c62c475d678bafb6e6f915
1 parent fefbd13 commit b647910

File tree

70 files changed

+8995
-5701
lines changed

Some content is hidden

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

70 files changed

+8995
-5701
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: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "95c0363e4cae8756c6a33b58add67776db427bbc",
2+
"commit": "cf40c3c46467fe716499bd04d7ab089f8f683656",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/hybridconnectivity/resource-manager/readme.md"
4+
"typespec_src": "specification/hybridconnectivity/PublicCloud.Management",
5+
"@azure-tools/typespec-python": "0.38.1"
116
}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._hybrid_connectivity_mgmt_client import HybridConnectivityMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import HybridConnectivityMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"HybridConnectivityMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
17+
18+
from ._configuration import HybridConnectivityMgmtClientConfiguration
19+
from ._serialization import Deserializer, Serializer
20+
from .operations import (
21+
GenerateAwsTemplateOperations,
22+
InventoryOperations,
23+
PublicCloudConnectorsOperations,
24+
SolutionConfigurationsOperations,
25+
SolutionTypesOperations,
26+
)
27+
28+
if TYPE_CHECKING:
29+
from azure.core.credentials import TokenCredential
30+
31+
32+
class HybridConnectivityMgmtClient:
33+
"""REST API for public clouds.
34+
35+
:ivar generate_aws_template: GenerateAwsTemplateOperations operations
36+
:vartype generate_aws_template:
37+
azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations
38+
:ivar public_cloud_connectors: PublicCloudConnectorsOperations operations
39+
:vartype public_cloud_connectors:
40+
azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations
41+
:ivar solution_configurations: SolutionConfigurationsOperations operations
42+
:vartype solution_configurations:
43+
azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations
44+
:ivar inventory: InventoryOperations operations
45+
:vartype inventory: azure.mgmt.hybridconnectivity.operations.InventoryOperations
46+
:ivar solution_types: SolutionTypesOperations operations
47+
:vartype solution_types: azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations
48+
:param credential: Credential used to authenticate requests to the service. Required.
49+
:type credential: ~azure.core.credentials.TokenCredential
50+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
51+
:type subscription_id: str
52+
:param base_url: Service host. Default value is "https://management.azure.com".
53+
:type base_url: str
54+
:keyword api_version: The API version to use for this operation. Default value is "2024-12-01".
55+
Note that overriding this default value may result in unsupported behavior.
56+
:paramtype api_version: str
57+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
58+
Retry-After header is present.
59+
"""
60+
61+
def __init__(
62+
self,
63+
credential: "TokenCredential",
64+
subscription_id: str,
65+
base_url: str = "https://management.azure.com",
66+
**kwargs: Any
67+
) -> None:
68+
_endpoint = "{endpoint}"
69+
self._config = HybridConnectivityMgmtClientConfiguration(
70+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
71+
)
72+
_policies = kwargs.pop("policies", None)
73+
if _policies is None:
74+
_policies = [
75+
policies.RequestIdPolicy(**kwargs),
76+
self._config.headers_policy,
77+
self._config.user_agent_policy,
78+
self._config.proxy_policy,
79+
policies.ContentDecodePolicy(**kwargs),
80+
ARMAutoResourceProviderRegistrationPolicy(),
81+
self._config.redirect_policy,
82+
self._config.retry_policy,
83+
self._config.authentication_policy,
84+
self._config.custom_hook_policy,
85+
self._config.logging_policy,
86+
policies.DistributedTracingPolicy(**kwargs),
87+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
88+
self._config.http_logging_policy,
89+
]
90+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
91+
92+
self._serialize = Serializer()
93+
self._deserialize = Deserializer()
94+
self._serialize.client_side_validation = False
95+
self.generate_aws_template = GenerateAwsTemplateOperations(
96+
self._client, self._config, self._serialize, self._deserialize
97+
)
98+
self.public_cloud_connectors = PublicCloudConnectorsOperations(
99+
self._client, self._config, self._serialize, self._deserialize
100+
)
101+
self.solution_configurations = SolutionConfigurationsOperations(
102+
self._client, self._config, self._serialize, self._deserialize
103+
)
104+
self.inventory = InventoryOperations(self._client, self._config, self._serialize, self._deserialize)
105+
self.solution_types = SolutionTypesOperations(self._client, self._config, self._serialize, self._deserialize)
106+
107+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
108+
"""Runs the network request through the client's chained policies.
109+
110+
>>> from azure.core.rest import HttpRequest
111+
>>> request = HttpRequest("GET", "https://www.example.org/")
112+
<HttpRequest [GET], url: 'https://www.example.org/'>
113+
>>> response = client.send_request(request)
114+
<HttpResponse: 200 OK>
115+
116+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
117+
118+
:param request: The network request you want to make. Required.
119+
:type request: ~azure.core.rest.HttpRequest
120+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
121+
:return: The response of your network call. Does not do error handling on your response.
122+
:rtype: ~azure.core.rest.HttpResponse
123+
"""
124+
125+
request_copy = deepcopy(request)
126+
path_format_arguments = {
127+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
128+
}
129+
130+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
131+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
132+
133+
def close(self) -> None:
134+
self._client.close()
135+
136+
def __enter__(self) -> Self:
137+
self._client.__enter__()
138+
return self
139+
140+
def __exit__(self, *exc_details: Any) -> None:
141+
self._client.__exit__(*exc_details)

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

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,59 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
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

1514
from ._version import VERSION
1615

1716
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1917
from azure.core.credentials import TokenCredential
2018

2119

22-
class HybridConnectivityMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2321
"""Configuration for HybridConnectivityMgmtClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
2624
attributes.
2725
28-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2927
:type credential: ~azure.core.credentials.TokenCredential
30-
:keyword api_version: Api Version. Default value is "2023-03-15". Note that overriding this
31-
default value may result in unsupported behavior.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
29+
:type subscription_id: str
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2024-12-01".
33+
Note that overriding this default value may result in unsupported behavior.
3234
:paramtype api_version: str
3335
"""
3436

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")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2024-12-01")
3845

3946
if credential is None:
4047
raise ValueError("Parameter 'credential' must not be None.")
48+
if subscription_id is None:
49+
raise ValueError("Parameter 'subscription_id' must not be None.")
4150

4251
self.credential = credential
52+
self.subscription_id = subscription_id
53+
self.base_url = base_url
4354
self.api_version = api_version
4455
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4556
kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION))
57+
self.polling_interval = kwargs.get("polling_interval", 30)
4658
self._configure(**kwargs)
4759

4860
def _configure(self, **kwargs: Any) -> None:
@@ -51,9 +63,9 @@ def _configure(self, **kwargs: Any) -> None:
5163
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5264
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5365
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5566
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
5667
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
68+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5769
self.authentication_policy = kwargs.get("authentication_policy")
5870
if self.credential and not self.authentication_policy:
5971
self.authentication_policy = ARMChallengeAuthenticationPolicy(

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

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)