Skip to content

Commit ba5436d

Browse files
[AutoRelease] t2-selfhelp-2024-05-27-04042(can only be merged by SDK owner) (#35772)
* code and test * Update assets.json * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent cbb7de7 commit ba5436d

File tree

51 files changed

+502
-538
lines changed

Some content is hidden

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

51 files changed

+502
-538
lines changed

sdk/selfhelp/azure-mgmt-selfhelp/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 2.0.0b4 (2024-05-27)
4+
5+
### Features Added
6+
7+
- Added operation CheckNameAvailabilityOperations.check_availability
8+
- Added operation group DiscoverySolutionNLPOperations
9+
10+
### Breaking Changes
11+
12+
- Removed operation CheckNameAvailabilityOperations.post
13+
- Removed operation group DiscoverySolutionNLPSubscriptionScopeOperations
14+
- Removed operation group DiscoverySolutionNLPTenantScopeOperations
15+
316
## 2.0.0b3 (2024-04-22)
417

518
### Features Added
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "835b124ff8160d23823c0e770b4989ca79e7418c",
2+
"commit": "c3cc9abe085093ba880ee3eeb792edb4fa789553",
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/[email protected].7",
6+
"@autorest/[email protected].16",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/help/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].7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/help/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].16 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/help/resource-manager/readme.md"
1111
}

sdk/selfhelp/azure-mgmt-selfhelp/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/selfhelp/azure-mgmt-selfhelp",
5-
"Tag": "python/selfhelp/azure-mgmt-selfhelp_a64311aadc"
5+
"Tag": "python/selfhelp/azure-mgmt-selfhelp_548dd1d9f4"
66
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,18 @@ class SelfHelpMgmtClientConfiguration: # pylint: disable=too-many-instance-attr
2626
2727
:param credential: Credential needed for the client to connect to Azure. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30-
:type subscription_id: str
3129
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
3230
this default value may result in unsupported behavior.
3331
:paramtype api_version: str
3432
"""
3533

36-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
34+
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
3735
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
3836

3937
if credential is None:
4038
raise ValueError("Parameter 'credential' must not be None.")
41-
if subscription_id is None:
42-
raise ValueError("Parameter 'subscription_id' must not be None.")
4339

4440
self.credential = credential
45-
self.subscription_id = subscription_id
4641
self.api_version = api_version
4742
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4843
kwargs.setdefault("sdk_moniker", "mgmt-selfhelp/{}".format(VERSION))

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/_self_help_mgmt_client.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
from .operations import (
2121
CheckNameAvailabilityOperations,
2222
DiagnosticsOperations,
23-
DiscoverySolutionNLPSubscriptionScopeOperations,
24-
DiscoverySolutionNLPTenantScopeOperations,
23+
DiscoverySolutionNLPOperations,
2524
DiscoverySolutionOperations,
2625
Operations,
2726
SimplifiedSolutionsOperations,
@@ -55,17 +54,10 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
5554
:vartype troubleshooters: azure.mgmt.selfhelp.operations.TroubleshootersOperations
5655
:ivar solution_self_help: SolutionSelfHelpOperations operations
5756
:vartype solution_self_help: azure.mgmt.selfhelp.operations.SolutionSelfHelpOperations
58-
:ivar discovery_solution_nlp_tenant_scope: DiscoverySolutionNLPTenantScopeOperations operations
59-
:vartype discovery_solution_nlp_tenant_scope:
60-
azure.mgmt.selfhelp.operations.DiscoverySolutionNLPTenantScopeOperations
61-
:ivar discovery_solution_nlp_subscription_scope:
62-
DiscoverySolutionNLPSubscriptionScopeOperations operations
63-
:vartype discovery_solution_nlp_subscription_scope:
64-
azure.mgmt.selfhelp.operations.DiscoverySolutionNLPSubscriptionScopeOperations
57+
:ivar discovery_solution_nlp: DiscoverySolutionNLPOperations operations
58+
:vartype discovery_solution_nlp: azure.mgmt.selfhelp.operations.DiscoverySolutionNLPOperations
6559
:param credential: Credential needed for the client to connect to Azure. Required.
6660
:type credential: ~azure.core.credentials.TokenCredential
67-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
68-
:type subscription_id: str
6961
:param base_url: Service URL. Default value is "https://management.azure.com".
7062
:type base_url: str
7163
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
@@ -76,13 +68,9 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
7668
"""
7769

7870
def __init__(
79-
self,
80-
credential: "TokenCredential",
81-
subscription_id: str,
82-
base_url: str = "https://management.azure.com",
83-
**kwargs: Any
71+
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
8472
) -> None:
85-
self._config = SelfHelpMgmtClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
73+
self._config = SelfHelpMgmtClientConfiguration(credential=credential, **kwargs)
8674
_policies = kwargs.pop("policies", None)
8775
if _policies is None:
8876
_policies = [
@@ -123,10 +111,7 @@ def __init__(
123111
self.solution_self_help = SolutionSelfHelpOperations(
124112
self._client, self._config, self._serialize, self._deserialize
125113
)
126-
self.discovery_solution_nlp_tenant_scope = DiscoverySolutionNLPTenantScopeOperations(
127-
self._client, self._config, self._serialize, self._deserialize
128-
)
129-
self.discovery_solution_nlp_subscription_scope = DiscoverySolutionNLPSubscriptionScopeOperations(
114+
self.discovery_solution_nlp = DiscoverySolutionNLPOperations(
130115
self._client, self._config, self._serialize, self._deserialize
131116
)
132117

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "2.0.0b3"
9+
VERSION = "2.0.0b4"

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/aio/_configuration.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,18 @@ class SelfHelpMgmtClientConfiguration: # pylint: disable=too-many-instance-attr
2626
2727
:param credential: Credential needed for the client to connect to Azure. Required.
2828
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
29-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30-
:type subscription_id: str
3129
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
3230
this default value may result in unsupported behavior.
3331
:paramtype api_version: str
3432
"""
3533

36-
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
34+
def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
3735
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
3836

3937
if credential is None:
4038
raise ValueError("Parameter 'credential' must not be None.")
41-
if subscription_id is None:
42-
raise ValueError("Parameter 'subscription_id' must not be None.")
4339

4440
self.credential = credential
45-
self.subscription_id = subscription_id
4641
self.api_version = api_version
4742
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4843
kwargs.setdefault("sdk_moniker", "mgmt-selfhelp/{}".format(VERSION))

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/aio/_self_help_mgmt_client.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
from .operations import (
2121
CheckNameAvailabilityOperations,
2222
DiagnosticsOperations,
23-
DiscoverySolutionNLPSubscriptionScopeOperations,
24-
DiscoverySolutionNLPTenantScopeOperations,
23+
DiscoverySolutionNLPOperations,
2524
DiscoverySolutionOperations,
2625
Operations,
2726
SimplifiedSolutionsOperations,
@@ -55,17 +54,11 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
5554
:vartype troubleshooters: azure.mgmt.selfhelp.aio.operations.TroubleshootersOperations
5655
:ivar solution_self_help: SolutionSelfHelpOperations operations
5756
:vartype solution_self_help: azure.mgmt.selfhelp.aio.operations.SolutionSelfHelpOperations
58-
:ivar discovery_solution_nlp_tenant_scope: DiscoverySolutionNLPTenantScopeOperations operations
59-
:vartype discovery_solution_nlp_tenant_scope:
60-
azure.mgmt.selfhelp.aio.operations.DiscoverySolutionNLPTenantScopeOperations
61-
:ivar discovery_solution_nlp_subscription_scope:
62-
DiscoverySolutionNLPSubscriptionScopeOperations operations
63-
:vartype discovery_solution_nlp_subscription_scope:
64-
azure.mgmt.selfhelp.aio.operations.DiscoverySolutionNLPSubscriptionScopeOperations
57+
:ivar discovery_solution_nlp: DiscoverySolutionNLPOperations operations
58+
:vartype discovery_solution_nlp:
59+
azure.mgmt.selfhelp.aio.operations.DiscoverySolutionNLPOperations
6560
:param credential: Credential needed for the client to connect to Azure. Required.
6661
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
67-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
68-
:type subscription_id: str
6962
:param base_url: Service URL. Default value is "https://management.azure.com".
7063
:type base_url: str
7164
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
@@ -76,13 +69,9 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
7669
"""
7770

7871
def __init__(
79-
self,
80-
credential: "AsyncTokenCredential",
81-
subscription_id: str,
82-
base_url: str = "https://management.azure.com",
83-
**kwargs: Any
72+
self, credential: "AsyncTokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
8473
) -> None:
85-
self._config = SelfHelpMgmtClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
74+
self._config = SelfHelpMgmtClientConfiguration(credential=credential, **kwargs)
8675
_policies = kwargs.pop("policies", None)
8776
if _policies is None:
8877
_policies = [
@@ -123,10 +112,7 @@ def __init__(
123112
self.solution_self_help = SolutionSelfHelpOperations(
124113
self._client, self._config, self._serialize, self._deserialize
125114
)
126-
self.discovery_solution_nlp_tenant_scope = DiscoverySolutionNLPTenantScopeOperations(
127-
self._client, self._config, self._serialize, self._deserialize
128-
)
129-
self.discovery_solution_nlp_subscription_scope = DiscoverySolutionNLPSubscriptionScopeOperations(
115+
self.discovery_solution_nlp = DiscoverySolutionNLPOperations(
130116
self._client, self._config, self._serialize, self._deserialize
131117
)
132118

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/aio/operations/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from ._simplified_solutions_operations import SimplifiedSolutionsOperations
1515
from ._troubleshooters_operations import TroubleshootersOperations
1616
from ._solution_self_help_operations import SolutionSelfHelpOperations
17-
from ._discovery_solution_nlp_tenant_scope_operations import DiscoverySolutionNLPTenantScopeOperations
18-
from ._discovery_solution_nlp_subscription_scope_operations import DiscoverySolutionNLPSubscriptionScopeOperations
17+
from ._discovery_solution_nlp_operations import DiscoverySolutionNLPOperations
1918

2019
from ._patch import __all__ as _patch_all
2120
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -30,8 +29,7 @@
3029
"SimplifiedSolutionsOperations",
3130
"TroubleshootersOperations",
3231
"SolutionSelfHelpOperations",
33-
"DiscoverySolutionNLPTenantScopeOperations",
34-
"DiscoverySolutionNLPSubscriptionScopeOperations",
32+
"DiscoverySolutionNLPOperations",
3533
]
3634
__all__.extend([p for p in _patch_all if p not in __all__])
3735
_patch_sdk()

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/aio/operations/_check_name_availability_operations.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
10+
import sys
11+
from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
1112

1213
from azure.core.exceptions import (
1314
ClientAuthenticationError,
@@ -26,8 +27,12 @@
2627

2728
from ... import models as _models
2829
from ..._vendor import _convert_request
29-
from ...operations._check_name_availability_operations import build_post_request
30+
from ...operations._check_name_availability_operations import build_check_availability_request
3031

32+
if sys.version_info >= (3, 9):
33+
from collections.abc import MutableMapping
34+
else:
35+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
3136
T = TypeVar("T")
3237
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
3338

@@ -52,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None:
5257
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
5358

5459
@overload
55-
async def post(
60+
async def check_availability(
5661
self,
5762
scope: str,
5863
check_name_availability_request: Optional[_models.CheckNameAvailabilityRequest] = None,
@@ -79,7 +84,7 @@ async def post(
7984
"""
8085

8186
@overload
82-
async def post(
87+
async def check_availability(
8388
self,
8489
scope: str,
8590
check_name_availability_request: Optional[IO[bytes]] = None,
@@ -106,7 +111,7 @@ async def post(
106111
"""
107112

108113
@distributed_trace_async
109-
async def post(
114+
async def check_availability(
110115
self,
111116
scope: str,
112117
check_name_availability_request: Optional[Union[_models.CheckNameAvailabilityRequest, IO[bytes]]] = None,
@@ -127,7 +132,7 @@ async def post(
127132
:rtype: ~azure.mgmt.selfhelp.models.CheckNameAvailabilityResponse
128133
:raises ~azure.core.exceptions.HttpResponseError:
129134
"""
130-
error_map = {
135+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
131136
401: ClientAuthenticationError,
132137
404: ResourceNotFoundError,
133138
409: ResourceExistsError,
@@ -153,7 +158,7 @@ async def post(
153158
else:
154159
_json = None
155160

156-
_request = build_post_request(
161+
_request = build_check_availability_request(
157162
scope=scope,
158163
api_version=api_version,
159164
content_type=content_type,

0 commit comments

Comments
 (0)