Skip to content

Commit 98cd768

Browse files
author
SDKAuto
committed
CodeGen from PR 34324 in Azure/azure-rest-api-specs
Merge 2e8f925516048a901587c68abc3e66477e371151 into c64457b3dcc103d93c378ca1ec58fbf683a7f163
1 parent 1063688 commit 98cd768

File tree

181 files changed

+17926
-19091
lines changed

Some content is hidden

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

181 files changed

+17926
-19091
lines changed

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

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

3+
## 1.1.0b5 (2025-05-13)
4+
5+
change log generation failed!!!
6+
37
## 1.1.0b4 (2024-10-23)
48

59
### Features Added

sdk/elastic/azure-mgmt-elastic/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 Elastic 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-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "6c709e5a3325eaa862649acee2252ce1c8166042",
2+
"commit": "5c92dda155f958f8acd565f5ececf28dd940b560",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --generate-test=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.10.2 --version-tolerant=False",
10-
"readme": "specification/elastic/resource-manager/readme.md"
4+
"typespec_src": "specification/elastic/Elastic.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}

sdk/elastic/azure-mgmt-elastic/apiview-properties.json

+172
Large diffs are not rendered by default.

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

+11-5
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 ._microsoft_elastic import MicrosoftElastic
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 ElasticClient # 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__ = [
22-
"MicrosoftElastic",
28+
"ElasticClient",
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()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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, Optional, TYPE_CHECKING, cast
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.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import ElasticClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
ElasticMonitorResourcesOperations,
24+
ElasticVersionsOperationGroupOperations,
25+
MonitoredSubscriptionsOperations,
26+
OpenAIIntegrationRPModelsOperations,
27+
Operations,
28+
OrganizationsOperationGroupOperations,
29+
TagRulesOperations,
30+
)
31+
32+
if TYPE_CHECKING:
33+
from azure.core.credentials import TokenCredential
34+
35+
36+
class ElasticClient: # pylint: disable=too-many-instance-attributes
37+
"""ElasticClient.
38+
39+
:ivar operations: Operations operations
40+
:vartype operations: azure.mgmt.elastic.operations.Operations
41+
:ivar elastic_monitor_resources: ElasticMonitorResourcesOperations operations
42+
:vartype elastic_monitor_resources:
43+
azure.mgmt.elastic.operations.ElasticMonitorResourcesOperations
44+
:ivar monitored_subscriptions: MonitoredSubscriptionsOperations operations
45+
:vartype monitored_subscriptions:
46+
azure.mgmt.elastic.operations.MonitoredSubscriptionsOperations
47+
:ivar open_ai_integration_rp_models: OpenAIIntegrationRPModelsOperations operations
48+
:vartype open_ai_integration_rp_models:
49+
azure.mgmt.elastic.operations.OpenAIIntegrationRPModelsOperations
50+
:ivar tag_rules: TagRulesOperations operations
51+
:vartype tag_rules: azure.mgmt.elastic.operations.TagRulesOperations
52+
:ivar elastic_versions_operation_group: ElasticVersionsOperationGroupOperations operations
53+
:vartype elastic_versions_operation_group:
54+
azure.mgmt.elastic.operations.ElasticVersionsOperationGroupOperations
55+
:ivar organizations_operation_group: OrganizationsOperationGroupOperations operations
56+
:vartype organizations_operation_group:
57+
azure.mgmt.elastic.operations.OrganizationsOperationGroupOperations
58+
:param credential: Credential used to authenticate requests to the service. Required.
59+
:type credential: ~azure.core.credentials.TokenCredential
60+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
61+
:type subscription_id: str
62+
:param base_url: Service host. Default value is None.
63+
:type base_url: str
64+
:keyword api_version: The API version to use for this operation. Default value is
65+
"2025-01-15-preview". Note that overriding this default value may result in unsupported
66+
behavior.
67+
:paramtype api_version: str
68+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
69+
Retry-After header is present.
70+
"""
71+
72+
def __init__(
73+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
74+
) -> None:
75+
_endpoint = "{endpoint}"
76+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
77+
_endpoints = get_arm_endpoints(_cloud)
78+
if not base_url:
79+
base_url = _endpoints["resource_manager"]
80+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
81+
self._config = ElasticClientConfiguration(
82+
credential=credential,
83+
subscription_id=subscription_id,
84+
base_url=cast(str, base_url),
85+
credential_scopes=credential_scopes,
86+
**kwargs
87+
)
88+
89+
_policies = kwargs.pop("policies", None)
90+
if _policies is None:
91+
_policies = [
92+
policies.RequestIdPolicy(**kwargs),
93+
self._config.headers_policy,
94+
self._config.user_agent_policy,
95+
self._config.proxy_policy,
96+
policies.ContentDecodePolicy(**kwargs),
97+
ARMAutoResourceProviderRegistrationPolicy(),
98+
self._config.redirect_policy,
99+
self._config.retry_policy,
100+
self._config.authentication_policy,
101+
self._config.custom_hook_policy,
102+
self._config.logging_policy,
103+
policies.DistributedTracingPolicy(**kwargs),
104+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
105+
self._config.http_logging_policy,
106+
]
107+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
108+
109+
self._serialize = Serializer()
110+
self._deserialize = Deserializer()
111+
self._serialize.client_side_validation = False
112+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
113+
self.elastic_monitor_resources = ElasticMonitorResourcesOperations(
114+
self._client, self._config, self._serialize, self._deserialize
115+
)
116+
self.monitored_subscriptions = MonitoredSubscriptionsOperations(
117+
self._client, self._config, self._serialize, self._deserialize
118+
)
119+
self.open_ai_integration_rp_models = OpenAIIntegrationRPModelsOperations(
120+
self._client, self._config, self._serialize, self._deserialize
121+
)
122+
self.tag_rules = TagRulesOperations(self._client, self._config, self._serialize, self._deserialize)
123+
self.elastic_versions_operation_group = ElasticVersionsOperationGroupOperations(
124+
self._client, self._config, self._serialize, self._deserialize
125+
)
126+
self.organizations_operation_group = OrganizationsOperationGroupOperations(
127+
self._client, self._config, self._serialize, self._deserialize
128+
)
129+
130+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
131+
"""Runs the network request through the client's chained policies.
132+
133+
>>> from azure.core.rest import HttpRequest
134+
>>> request = HttpRequest("GET", "https://www.example.org/")
135+
<HttpRequest [GET], url: 'https://www.example.org/'>
136+
>>> response = client.send_request(request)
137+
<HttpResponse: 200 OK>
138+
139+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
140+
141+
:param request: The network request you want to make. Required.
142+
:type request: ~azure.core.rest.HttpRequest
143+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
144+
:return: The response of your network call. Does not do error handling on your response.
145+
:rtype: ~azure.core.rest.HttpResponse
146+
"""
147+
148+
request_copy = deepcopy(request)
149+
path_format_arguments = {
150+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
151+
}
152+
153+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
154+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
155+
156+
def close(self) -> None:
157+
self._client.close()
158+
159+
def __enter__(self) -> Self:
160+
self._client.__enter__()
161+
return self
162+
163+
def __exit__(self, *exc_details: Any) -> None:
164+
self._client.__exit__(*exc_details)

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

+18-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

@@ -14,27 +14,35 @@
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 MicrosoftElasticConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for MicrosoftElastic.
20+
class ElasticClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for ElasticClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
2928
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
:type subscription_id: str
31-
:keyword api_version: Api Version. Default value is "2024-06-15-preview". Note that overriding
32-
this default value may result in unsupported behavior.
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
33+
"2025-01-15-preview". Note that overriding this default value may result in unsupported
34+
behavior.
3335
:paramtype api_version: str
3436
"""
3537

36-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37-
api_version: str = kwargs.pop("api_version", "2024-06-15-preview")
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
45+
api_version: str = kwargs.pop("api_version", "2025-01-15-preview")
3846

3947
if credential is None:
4048
raise ValueError("Parameter 'credential' must not be None.")
@@ -43,6 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4351

4452
self.credential = credential
4553
self.subscription_id = subscription_id
54+
self.base_url = base_url
4655
self.api_version = api_version
4756
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4857
kwargs.setdefault("sdk_moniker", "mgmt-elastic/{}".format(VERSION))

0 commit comments

Comments
 (0)