Skip to content

Commit

Permalink
CodeGen from PR 22638 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 7b68ec0266ff62dcc10051f1f87856a539f6fc7d into b0a96087a75bc286a7e2735f71872d63692c7baa
  • Loading branch information
SDKAuto committed Mar 6, 2023
1 parent 63e8f39 commit 9a754ee
Show file tree
Hide file tree
Showing 83 changed files with 1,654 additions and 854 deletions.
6 changes: 3 additions & 3 deletions sdk/elastic/azure-mgmt-elastic/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "4903b1ed79e30f689d7c469cfa06734cfcd106d6",
"commit": "5ea47ca684fc717dd98e74c8baa46825080f8708",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.1",
"@autorest/python@6.4.0",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/elastic/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.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=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.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/elastic/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-07-01-preview") # type: Literal["2022-07-01-preview"]
api_version: Literal["2023-02-01-preview"] = kwargs.pop("api_version", "2023-02-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -57,10 +57,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-elastic/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from . import models as _models
from ._configuration import MicrosoftElasticConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
Expand All @@ -29,6 +29,7 @@
MonitoredResourcesOperations,
MonitorsOperations,
Operations,
OrganizationsOperations,
TagRulesOperations,
TrafficFiltersOperations,
UpgradableVersionsOperations,
Expand Down Expand Up @@ -88,14 +89,16 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
:vartype detach_traffic_filter: azure.mgmt.elastic.operations.DetachTrafficFilterOperations
:ivar traffic_filters: TrafficFiltersOperations operations
:vartype traffic_filters: azure.mgmt.elastic.operations.TrafficFiltersOperations
:ivar organizations: OrganizationsOperations operations
:vartype organizations: azure.mgmt.elastic.operations.OrganizationsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000). Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-07-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand All @@ -112,7 +115,7 @@ def __init__(
self._config = MicrosoftElasticConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
Expand Down Expand Up @@ -153,6 +156,7 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.traffic_filters = TrafficFiltersOperations(self._client, self._config, self._serialize, self._deserialize)
self.organizations = OrganizationsOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -176,15 +180,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> MicrosoftElastic
def __enter__(self) -> "MicrosoftElastic":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Loading

0 comments on commit 9a754ee

Please sign in to comment.