Skip to content

Commit e59bb9b

Browse files
author
SDKAuto
committed
CodeGen from PR 34311 in Azure/azure-rest-api-specs
Merge 0851c5789ae1eac255cf450d6041c9dad5e34779 into 761d8b58e465b26eddb8ad70dda3cde7b4228bdf
1 parent d6612d0 commit e59bb9b

File tree

74 files changed

+3291
-1985
lines changed

Some content is hidden

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

74 files changed

+3291
-1985
lines changed

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

+32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Release History
22

3+
## 2.0.0b5 (2025-05-09)
4+
5+
### Features Added
6+
7+
- Method `DiagnosticsOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, diagnostics_resource_name: str, diagnostic_resource_request: DiagnosticResource, content_type: str)`
8+
- Method `DiagnosticsOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, diagnostics_resource_name: str, diagnostic_resource_request: IO[bytes], content_type: str)`
9+
- Method `DiscoverySolutionNLPOperations.discover_solutions` has a new overload `def discover_solutions(self: None, discover_solution_request: DiscoveryNlpRequest, content_type: str)`
10+
- Method `DiscoverySolutionNLPOperations.discover_solutions` has a new overload `def discover_solutions(self: None, discover_solution_request: IO[bytes], content_type: str)`
11+
- Method `DiscoverySolutionNLPOperations.discover_solutions_by_subscription` has a new overload `def discover_solutions_by_subscription(self: None, discover_solution_request: DiscoveryNlpRequest, content_type: str)`
12+
- Method `DiscoverySolutionNLPOperations.discover_solutions_by_subscription` has a new overload `def discover_solutions_by_subscription(self: None, discover_solution_request: IO[bytes], content_type: str)`
13+
- Method `SimplifiedSolutionsOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, simplified_solutions_resource_name: str, simplified_solutions_request_body: SimplifiedSolutionsResource, content_type: str)`
14+
- Method `SimplifiedSolutionsOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, simplified_solutions_resource_name: str, simplified_solutions_request_body: IO[bytes], content_type: str)`
15+
- Method `SolutionOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, solution_resource_name: str, solution_request_body: SolutionResource, content_type: str)`
16+
- Method `SolutionOperations.begin_create` has a new overload `def begin_create(self: None, scope: str, solution_resource_name: str, solution_request_body: IO[bytes], content_type: str)`
17+
- Method `SolutionOperations.begin_update` has a new overload `def begin_update(self: None, scope: str, solution_resource_name: str, solution_patch_request_body: SolutionPatchRequestBody, content_type: str)`
18+
- Method `SolutionOperations.begin_update` has a new overload `def begin_update(self: None, scope: str, solution_resource_name: str, solution_patch_request_body: IO[bytes], content_type: str)`
19+
- Method `TroubleshootersOperations.create` has a new overload `def create(self: None, scope: str, troubleshooter_name: str, create_troubleshooter_request_body: TroubleshooterResource, content_type: str)`
20+
- Method `TroubleshootersOperations.create` has a new overload `def create(self: None, scope: str, troubleshooter_name: str, create_troubleshooter_request_body: IO[bytes], content_type: str)`
21+
22+
### Breaking Changes
23+
24+
- Method `SelfHelpMgmtClient.__init__` inserted a `positional_or_keyword` parameter `subscription_id`
25+
- Method `DiscoveryResponse.__init__` removed default value `None` from its parameter `value`
26+
- Method `DiagnosticsOperations.begin_create` removed default value `None` from its parameter `diagnostic_resource_request`
27+
- Method `DiscoverySolutionNLPOperations.discover_solutions` removed default value `None` from its parameter `discover_solution_request`
28+
- Method `DiscoverySolutionNLPOperations.discover_solutions_by_subscription` removed default value `None` from its parameter `discover_solution_request`
29+
- Method `DiscoverySolutionNLPOperations.discover_solutions_by_subscription` deleted or renamed its parameter `subscription_id` of kind `positional_or_keyword`
30+
- Method `SimplifiedSolutionsOperations.begin_create` removed default value `None` from its parameter `simplified_solutions_request_body`
31+
- Method `SolutionOperations.begin_create` removed default value `None` from its parameter `solution_request_body`
32+
- Method `SolutionOperations.begin_update` removed default value `None` from its parameter `solution_patch_request_body`
33+
- Method `TroubleshootersOperations.create` removed default value `None` from its parameter `create_troubleshooter_request_body`
34+
335
## 2.0.0b4 (2024-05-27)
436

537
### Features Added

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

+3-3
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 Selfhelp Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
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.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "c3cc9abe085093ba880ee3eeb792edb4fa789553",
2+
"commit": "51be344f3e6ae8e3e9b2a8b4c2676ee74c31bd4a",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.16",
6+
"@autorest/python@6.34.1",
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/python@6.13.16 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/help/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.34.1 --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/azure/mgmt/selfhelp/__init__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest 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 ._self_help_mgmt_client import SelfHelpMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._self_help_mgmt_client import SelfHelpMgmtClient # 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
"SelfHelpMgmtClient",
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()

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,34 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

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

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

3738
if credential is None:
3839
raise ValueError("Parameter 'credential' must not be None.")
40+
if subscription_id is None:
41+
raise ValueError("Parameter 'subscription_id' must not be None.")
3942

4043
self.credential = credential
44+
self.subscription_id = subscription_id
4145
self.api_version = api_version
4246
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4347
kwargs.setdefault("sdk_moniker", "mgmt-selfhelp/{}".format(VERSION))

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

+35-23
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1416
from azure.mgmt.core import ARMPipelineClient
1517
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1619

1720
from . import models as _models
1821
from ._configuration import SelfHelpMgmtClientConfiguration
19-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2023
from .operations import (
2124
CheckNameAvailabilityOperations,
2225
DiagnosticsOperations,
@@ -30,35 +33,36 @@
3033
)
3134

3235
if TYPE_CHECKING:
33-
# pylint: disable=unused-import,ungrouped-imports
3436
from azure.core.credentials import TokenCredential
3537

3638

37-
class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
39+
class SelfHelpMgmtClient: # pylint: disable=too-many-instance-attributes
3840
"""Help RP provider.
3941
40-
:ivar operations: Operations operations
41-
:vartype operations: azure.mgmt.selfhelp.operations.Operations
4242
:ivar check_name_availability: CheckNameAvailabilityOperations operations
4343
:vartype check_name_availability:
4444
azure.mgmt.selfhelp.operations.CheckNameAvailabilityOperations
4545
:ivar diagnostics: DiagnosticsOperations operations
4646
:vartype diagnostics: azure.mgmt.selfhelp.operations.DiagnosticsOperations
47-
:ivar discovery_solution: DiscoverySolutionOperations operations
48-
:vartype discovery_solution: azure.mgmt.selfhelp.operations.DiscoverySolutionOperations
49-
:ivar solution: SolutionOperations operations
50-
:vartype solution: azure.mgmt.selfhelp.operations.SolutionOperations
5147
:ivar simplified_solutions: SimplifiedSolutionsOperations operations
5248
:vartype simplified_solutions: azure.mgmt.selfhelp.operations.SimplifiedSolutionsOperations
49+
:ivar solution: SolutionOperations operations
50+
:vartype solution: azure.mgmt.selfhelp.operations.SolutionOperations
5351
:ivar troubleshooters: TroubleshootersOperations operations
5452
:vartype troubleshooters: azure.mgmt.selfhelp.operations.TroubleshootersOperations
55-
:ivar solution_self_help: SolutionSelfHelpOperations operations
56-
:vartype solution_self_help: azure.mgmt.selfhelp.operations.SolutionSelfHelpOperations
5753
:ivar discovery_solution_nlp: DiscoverySolutionNLPOperations operations
5854
:vartype discovery_solution_nlp: azure.mgmt.selfhelp.operations.DiscoverySolutionNLPOperations
55+
:ivar discovery_solution: DiscoverySolutionOperations operations
56+
:vartype discovery_solution: azure.mgmt.selfhelp.operations.DiscoverySolutionOperations
57+
:ivar operations: Operations operations
58+
:vartype operations: azure.mgmt.selfhelp.operations.Operations
59+
:ivar solution_self_help: SolutionSelfHelpOperations operations
60+
:vartype solution_self_help: azure.mgmt.selfhelp.operations.SolutionSelfHelpOperations
5961
:param credential: Credential needed for the client to connect to Azure. Required.
6062
:type credential: ~azure.core.credentials.TokenCredential
61-
:param base_url: Service URL. Default value is "https://management.azure.com".
63+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
64+
:type subscription_id: str
65+
:param base_url: Service URL. Default value is None.
6266
:type base_url: str
6367
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
6468
this default value may result in unsupported behavior.
@@ -68,9 +72,17 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
6872
"""
6973

7074
def __init__(
71-
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
75+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7276
) -> None:
73-
self._config = SelfHelpMgmtClientConfiguration(credential=credential, **kwargs)
77+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
78+
_endpoints = get_arm_endpoints(_cloud)
79+
if not base_url:
80+
base_url = _endpoints["resource_manager"]
81+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
82+
self._config = SelfHelpMgmtClientConfiguration(
83+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
84+
)
85+
7486
_policies = kwargs.pop("policies", None)
7587
if _policies is None:
7688
_policies = [
@@ -89,29 +101,29 @@ def __init__(
89101
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
90102
self._config.http_logging_policy,
91103
]
92-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
104+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
93105

94106
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
95107
self._serialize = Serializer(client_models)
96108
self._deserialize = Deserializer(client_models)
97109
self._serialize.client_side_validation = False
98-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
99110
self.check_name_availability = CheckNameAvailabilityOperations(
100111
self._client, self._config, self._serialize, self._deserialize
101112
)
102113
self.diagnostics = DiagnosticsOperations(self._client, self._config, self._serialize, self._deserialize)
103-
self.discovery_solution = DiscoverySolutionOperations(
114+
self.simplified_solutions = SimplifiedSolutionsOperations(
104115
self._client, self._config, self._serialize, self._deserialize
105116
)
106117
self.solution = SolutionOperations(self._client, self._config, self._serialize, self._deserialize)
107-
self.simplified_solutions = SimplifiedSolutionsOperations(
118+
self.troubleshooters = TroubleshootersOperations(self._client, self._config, self._serialize, self._deserialize)
119+
self.discovery_solution_nlp = DiscoverySolutionNLPOperations(
108120
self._client, self._config, self._serialize, self._deserialize
109121
)
110-
self.troubleshooters = TroubleshootersOperations(self._client, self._config, self._serialize, self._deserialize)
111-
self.solution_self_help = SolutionSelfHelpOperations(
122+
self.discovery_solution = DiscoverySolutionOperations(
112123
self._client, self._config, self._serialize, self._deserialize
113124
)
114-
self.discovery_solution_nlp = DiscoverySolutionNLPOperations(
125+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
126+
self.solution_self_help = SolutionSelfHelpOperations(
115127
self._client, self._config, self._serialize, self._deserialize
116128
)
117129

@@ -140,7 +152,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
140152
def close(self) -> None:
141153
self._client.close()
142154

143-
def __enter__(self) -> "SelfHelpMgmtClient":
155+
def __enter__(self) -> Self:
144156
self._client.__enter__()
145157
return self
146158

sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/_vendor.py renamed to sdk/selfhelp/azure-mgmt-selfhelp/azure/mgmt/selfhelp/_utils/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@
44
# Code generated by Microsoft (R) AutoRest Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
7-
8-
from azure.core.pipeline.transport import HttpRequest
9-
10-
11-
def _convert_request(request, files=None):
12-
data = request.content if not files else None
13-
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
14-
if files:
15-
request.set_formdata_body(files)
16-
return request

0 commit comments

Comments
 (0)